From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 6 13:08: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 36E56106564A; Sun, 6 Jun 2010 13:08:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2406C8FC1F; Sun, 6 Jun 2010 13:08: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 o56D8abx049840; Sun, 6 Jun 2010 13:08:36 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o56D8aRd049837; Sun, 6 Jun 2010 13:08:36 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006061308.o56D8aRd049837@svn.freebsd.org> From: Martin Matuska Date: Sun, 6 Jun 2010 13:08: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: r208869 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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, 06 Jun 2010 13:08:37 -0000 Author: mm Date: Sun Jun 6 13:08:36 2010 New Revision: 208869 URL: http://svn.freebsd.org/changeset/base/208869 Log: MFC r208775: Fix freeing space after deleting large files with holes. OpenSolaris onnv revision: 9950:78fc41aa9bc5 Reviewed by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6792701) Approved by: re (kib) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.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/geom/sched/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Jun 6 11:36:08 2010 (r208868) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Jun 6 13:08:36 2010 (r208869) @@ -371,56 +371,51 @@ dmu_prefetch(objset_t *os, uint64_t obje dnode_rele(dn, FTAG); } +/* + * Get the next "chunk" of file data to free. We traverse the file from + * the end so that the file gets shorter over time (if we crashes in the + * middle, this will leave us in a better state). We find allocated file + * data by simply searching the allocated level 1 indirects. + */ static int -get_next_chunk(dnode_t *dn, uint64_t *offset, uint64_t limit) +get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t limit) { - uint64_t len = *offset - limit; - uint64_t chunk_len = dn->dn_datablksz * DMU_MAX_DELETEBLKCNT; - uint64_t subchunk = + uint64_t len = *start - limit; + uint64_t blkcnt = 0; + uint64_t maxblks = DMU_MAX_ACCESS / (1ULL << (dn->dn_indblkshift + 1)); + uint64_t iblkrange = dn->dn_datablksz * EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT); - ASSERT(limit <= *offset); + ASSERT(limit <= *start); - if (len <= chunk_len) { - *offset = limit; + if (len <= iblkrange * maxblks) { + *start = limit; return (0); } + ASSERT(ISP2(iblkrange)); - ASSERT(ISP2(subchunk)); - - while (*offset > limit) { - uint64_t initial_offset = P2ROUNDUP(*offset, subchunk); - uint64_t delta; + while (*start > limit && blkcnt < maxblks) { int err; - /* skip over allocated data */ + /* find next allocated L1 indirect */ err = dnode_next_offset(dn, - DNODE_FIND_HOLE|DNODE_FIND_BACKWARDS, offset, 1, 1, 0); - if (err == ESRCH) - *offset = limit; - else if (err) - return (err); + DNODE_FIND_BACKWARDS, start, 2, 1, 0); - ASSERT3U(*offset, <=, initial_offset); - *offset = P2ALIGN(*offset, subchunk); - delta = initial_offset - *offset; - if (delta >= chunk_len) { - *offset += delta - chunk_len; + /* if there are no more, then we are done */ + if (err == ESRCH) { + *start = limit; return (0); - } - chunk_len -= delta; - - /* skip over unallocated data */ - err = dnode_next_offset(dn, - DNODE_FIND_BACKWARDS, offset, 1, 1, 0); - if (err == ESRCH) - *offset = limit; - else if (err) + } else if (err) { return (err); + } + blkcnt += 1; - if (*offset < limit) - *offset = limit; - ASSERT3U(*offset, <, initial_offset); + /* reset offset to end of "next" block back */ + *start = P2ALIGN(*start, iblkrange); + if (*start <= limit) + *start = limit; + else + *start -= 1; } return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sun Jun 6 11:36:08 2010 (r208868) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sun Jun 6 13:08:36 2010 (r208869) @@ -1239,6 +1239,22 @@ dnode_willuse_space(dnode_t *dn, int64_t dmu_tx_willuse_space(tx, space); } +/* + * This function scans a block at the indicated "level" looking for + * a hole or data (depending on 'flags'). If level > 0, then we are + * scanning an indirect block looking at its pointers. If level == 0, + * then we are looking at a block of dnodes. If we don't find what we + * are looking for in the block, we return ESRCH. Otherwise, return + * with *offset pointing to the beginning (if searching forwards) or + * end (if searching backwards) of the range covered by the block + * pointer we matched on (or dnode). + * + * The basic search algorithm used below by dnode_next_offset() is to + * use this function to search up the block tree (widen the search) until + * we find something (i.e., we don't return ESRCH) and then search back + * down the tree (narrow the search) until we reach our original search + * level. + */ static int dnode_next_offset_level(dnode_t *dn, int flags, uint64_t *offset, int lvl, uint64_t blkfill, uint64_t txg) @@ -1318,6 +1334,7 @@ dnode_next_offset_level(dnode_t *dn, int error = ESRCH; } else { blkptr_t *bp = data; + uint64_t start = *offset; span = (lvl - 1) * epbs + dn->dn_datablkshift; minfill = 0; maxfill = blkfill << ((lvl - 1) * epbs); @@ -1327,18 +1344,25 @@ dnode_next_offset_level(dnode_t *dn, int else minfill++; - for (i = (*offset >> span) & ((1ULL << epbs) - 1); + *offset = *offset >> span; + for (i = BF64_GET(*offset, 0, epbs); i >= 0 && i < epb; i += inc) { if (bp[i].blk_fill >= minfill && bp[i].blk_fill <= maxfill && (hole || bp[i].blk_birth > txg)) break; - if (inc < 0 && *offset < (1ULL << span)) - *offset = 0; - else - *offset += (1ULL << span) * inc; + if (inc > 0 || *offset > 0) + *offset += inc; + } + *offset = *offset << span; + if (inc < 0) { + /* traversing backwards; position offset at the end */ + ASSERT3U(*offset, <=, start); + *offset = MIN(*offset + (1ULL << span) - 1, start); + } else if (*offset < start) { + *offset = start; } - if (i < 0 || i == epb) + if (i < 0 || i >= epb) error = ESRCH; } From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 7 10:22:22 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 A212A106566C; Mon, 7 Jun 2010 10:22:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 911CD8FC23; Mon, 7 Jun 2010 10:22:22 +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 o57AMMfC050466; Mon, 7 Jun 2010 10:22:22 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57AMM0b050464; Mon, 7 Jun 2010 10:22:22 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006071022.o57AMM0b050464@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Jun 2010 10:22:22 +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: r208890 - stable/8/sys/geom/part 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, 07 Jun 2010 10:22:22 -0000 Author: ae Date: Mon Jun 7 10:22:22 2010 New Revision: 208890 URL: http://svn.freebsd.org/changeset/base/208890 Log: MFC r207181: Re-calculate a geometry when reprobing as well. PR: kern/145452 Reviewed by: marcel Approved by: kib (mentor) Approved by: re (bz) Modified: stable/8/sys/geom/part/g_part.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/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Mon Jun 7 10:10:44 2010 (r208889) +++ stable/8/sys/geom/part/g_part.c Mon Jun 7 10:22:22 2010 (r208890) @@ -1067,6 +1067,15 @@ g_part_ctl_undo(struct gctl_req *req, st return (0); } table = gp->softc; + + /* + * Synthesize a disk geometry. Some partitioning schemes + * depend on it and since some file systems need it even + * when the partitition scheme doesn't, we do it here in + * scheme-independent code. + */ + pp = cp->provider; + g_part_geometry(table, cp, pp->mediasize / pp->sectorsize); } error = G_PART_READ(table, cp); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 7 13:37: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 9CEE0106567C; Mon, 7 Jun 2010 13:37:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6CF8FC26; Mon, 7 Jun 2010 13: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 o57DbDC2093422; Mon, 7 Jun 2010 13:37:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57DbDnJ093420; Mon, 7 Jun 2010 13:37:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006071337.o57DbDnJ093420@svn.freebsd.org> From: Andriy Gapon Date: Mon, 7 Jun 2010 13: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: r208892 - stable/8/sys/boot/zfs 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, 07 Jun 2010 13:37:13 -0000 Author: avg Date: Mon Jun 7 13:37:13 2010 New Revision: 208892 URL: http://svn.freebsd.org/changeset/base/208892 Log: MFC r208610: boot/zfs: fix gang block reading code - use correct size (512) while reading a gang block - skip holes while reading child blocks - advance buffer pointer while reading child blocks PR: 144214 Approved by: re(kib) Modified: stable/8/sys/boot/zfs/zfsimpl.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/geom/sched/ (props changed) Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Mon Jun 7 11:33:20 2010 (r208891) +++ stable/8/sys/boot/zfs/zfsimpl.c Mon Jun 7 13:37:13 2010 (r208892) @@ -958,12 +958,17 @@ zio_read_gang(spa_t *spa, const blkptr_t break; if (!vdev || !vdev->v_read) return (EIO); - if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) return (EIO); for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { - if (zio_read(spa, &zio_gb.zg_blkptr[i], buf)) + blkptr_t *gbp = &zio_gb.zg_blkptr[i]; + + if (BP_IS_HOLE(gbp)) + continue; + if (zio_read(spa, gbp, buf)) return (EIO); + buf = (char*)buf + BP_GET_PSIZE(gbp); } return (0); @@ -994,9 +999,8 @@ zio_read(spa_t *spa, const blkptr_t *bp, continue; if (DVA_GET_GANG(dva)) { - printf("ZFS: gang block detected!\n"); if (zio_read_gang(spa, bp, dva, buf)) - return (EIO); + continue; } else { vdevid = DVA_GET_VDEV(dva); offset = DVA_GET_OFFSET(dva); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 7 16:32: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 3597910656D7; Mon, 7 Jun 2010 16:32:13 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22AD38FC16; Mon, 7 Jun 2010 16:32: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 o57GWDQm031939; Mon, 7 Jun 2010 16:32:13 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57GWCXZ031934; Mon, 7 Jun 2010 16:32:12 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006071632.o57GWCXZ031934@svn.freebsd.org> From: Matt Jacob Date: Mon, 7 Jun 2010 16:32: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: r208894 - 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: Mon, 07 Jun 2010 16:32:13 -0000 Author: mjacob Date: Mon Jun 7 16:32:12 2010 New Revision: 208894 URL: http://svn.freebsd.org/changeset/base/208894 Log: MFC of 198262 Use callout_init_mtx on FreeBSD versions recent enough. This closes the race where interrupt thread can complete the request for which timeout has fired and while mpt_timeout has blocked on mpt_lock. Approved by: re (kib) Modified: stable/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_raid.c Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Mon Jun 7 13:44:04 2010 (r208893) +++ stable/8/sys/dev/mpt/mpt.c Mon Jun 7 16:32:12 2010 (r208894) @@ -1238,7 +1238,6 @@ retry: req->state = REQ_STATE_ALLOCATED; req->chain = NULL; mpt_assign_serno(mpt, req); - mpt_callout_init(&req->callout); } else if (sleep_ok != 0) { mpt->getreqwaiter = 1; mpt_sleep(mpt, &mpt->request_free_list, PUSER, "mptgreq", 0); @@ -2251,6 +2250,7 @@ mpt_core_attach(struct mpt_softc *mpt) for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { request_t *req = &mpt->request_pool[val]; req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); mpt_free_request(mpt, req); } MPT_UNLOCK(mpt); @@ -2334,10 +2334,18 @@ mpt_core_shutdown(struct mpt_softc *mpt) void mpt_core_detach(struct mpt_softc *mpt) { + int val; + /* * XXX: FREE MEMORY */ mpt_disable_ints(mpt); + + /* Make sure no request has pending timeouts. */ + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + mpt_callout_drain(mpt, &req->callout); + } } int Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Mon Jun 7 13:44:04 2010 (r208893) +++ stable/8/sys/dev/mpt/mpt.h Mon Jun 7 16:32:12 2010 (r208894) @@ -303,13 +303,6 @@ void mpt_map_rquest(void *, bus_dma_segm kthread_exit(status) #endif -/****************************** Timer Facilities ******************************/ -#if __FreeBSD_version > 500000 -#define mpt_callout_init(c) callout_init(c, /*mpsafe*/1); -#else -#define mpt_callout_init(c) callout_init(c); -#endif - /********************************** Endianess *********************************/ #define MPT_2_HOST64(ptr, tag) ptr->tag = le64toh(ptr->tag) #define MPT_2_HOST32(ptr, tag) ptr->tag = le32toh(ptr->tag) @@ -897,6 +890,10 @@ mpt_sleep(struct mpt_softc *mpt, void *i callout_reset(&(req)->callout, (ticks), (func), (arg)); #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c) +#define mpt_callout_drain(mpt, c) \ + callout_stop(c) #else #if 1 @@ -919,9 +916,13 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); + callout_reset(&(req)->callout, (ticks), (func), (arg)) #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init_mtx(c, &(mpt)->mpt_lock, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) #else @@ -934,18 +935,18 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define MPTLOCK_2_CAMLOCK(mpt) #define CAMLOCK_2_MPTLOCK(mpt) +#define mpt_req_timeout(req, ticks, func, arg) \ + callout_reset(&(req)->callout, (ticks), (func), (arg)) +#define mpt_req_untimeout(req, func, arg) \ + callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) + static __inline int mpt_sleep(struct mpt_softc *, void *, int, const char *, int); -#define mpt_ccb_timeout(ccb, ticks, func, arg) \ - do { \ - (ccb)->ccb_h.timeout_ch = timeout((func), (arg), (ticks)); \ - } while (0) -#define mpt_ccb_untimeout(ccb, func, arg) \ - untimeout((func), (arg), (ccb)->ccb_h.timeout_ch) -#define mpt_ccb_timeout_init(ccb) \ - callout_handle_init(&(ccb)->ccb_h.timeout_ch) - static __inline int mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) { Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Mon Jun 7 13:44:04 2010 (r208893) +++ stable/8/sys/dev/mpt/mpt_cam.c Mon Jun 7 16:32:12 2010 (r208894) @@ -1250,7 +1250,10 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, req->serno, ccb, req->ccb); @@ -1261,7 +1264,9 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } /* Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Mon Jun 7 13:44:04 2010 (r208893) +++ stable/8/sys/dev/mpt/mpt_raid.c Mon Jun 7 16:32:12 2010 (r208894) @@ -270,7 +270,7 @@ mpt_raid_attach(struct mpt_softc *mpt) mpt_handler_t handler; int error; - mpt_callout_init(&mpt->raid_timer); + mpt_callout_init(mpt, &mpt->raid_timer); error = mpt_spawn_raid_thread(mpt); if (error != 0) { @@ -319,10 +319,10 @@ mpt_raid_detach(struct mpt_softc *mpt) struct ccb_setasync csa; mpt_handler_t handler; - callout_stop(&mpt->raid_timer); + mpt_callout_drain(mpt, &mpt->raid_timer); + MPT_LOCK(mpt); mpt_terminate_raid_thread(mpt); - handler.reply_handler = mpt_raid_reply_handler; mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler, raid_handler_id); @@ -1555,9 +1555,14 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } void From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 7 20:31: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 10D04106566B; Mon, 7 Jun 2010 20:31:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA8958FC08; Mon, 7 Jun 2010 20:31: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 o57KVtaE084532; Mon, 7 Jun 2010 20:31:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57KVtD7084530; Mon, 7 Jun 2010 20:31:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006072031.o57KVtD7084530@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Jun 2010 20:31: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: r208899 - stable/8/sys/geom/part 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, 07 Jun 2010 20:31:56 -0000 Author: ae Date: Mon Jun 7 20:31:55 2010 New Revision: 208899 URL: http://svn.freebsd.org/changeset/base/208899 Log: MFC r197608: The first 96 bytes may not be zeroes. It can contain trivial boot code that merely emits an error and waits for a key press before rebooting. The error being that extended partitions are not bootable. The origin is presumed to be Windows 2000; Windows XP does not do this... For now, ignore the first 96 bytes when checking that the EBR is (for the most part) all zeroes. Tested by: Mario Lobo Dieter PR: kern/141235 Reviewed by: marcel Approved by: kib (mentor) Approved by: re (bz) Modified: stable/8/sys/geom/part/g_part_ebr.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/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/8/sys/geom/part/g_part_ebr.c Mon Jun 7 18:47:53 2010 (r208898) +++ stable/8/sys/geom/part/g_part_ebr.c Mon Jun 7 20:31:55 2010 (r208899) @@ -410,13 +410,13 @@ g_part_ebr_probe(struct g_part_table *ta goto out; /* - * The sector is all zeroes, except for the partition entries - * and some signatures or disk serial number. Those can be - * found in the 9 bytes immediately in front of the partition - * table. + * The sector is all zeroes, except for the partition entries, + * pseudo boot code and some signatures or disk serial number. + * The latter can be found in the 9 bytes immediately in front + * of the partition table. */ sum = 0; - for (index = 0; index < DOSPARTOFF - 9; index++) + for (index = 96; index < DOSPARTOFF - 9; index++) sum += buf[index]; if (sum != 0) goto out; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 8 04:41: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 C87D4106567B; Tue, 8 Jun 2010 04:41:31 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B73268FC14; Tue, 8 Jun 2010 04:41: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 o584fVsU092807; Tue, 8 Jun 2010 04:41:31 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o584fVrG092805; Tue, 8 Jun 2010 04:41:31 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006080441.o584fVrG092805@svn.freebsd.org> From: Alan Cox Date: Tue, 8 Jun 2010 04:41: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: r208903 - stable/8/sys/i386/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, 08 Jun 2010 04:41:31 -0000 Author: alc Date: Tue Jun 8 04:41:31 2010 New Revision: 208903 URL: http://svn.freebsd.org/changeset/base/208903 Log: MFC r208765 In the unlikely event that pmap_ts_referenced() demoted five superpage mappings to the same underlying physical page, the calling thread would be left forever pinned to the same processor. Approved by: re (kib) Modified: stable/8/sys/i386/i386/pmap.c Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Tue Jun 8 03:39:31 2010 (r208902) +++ stable/8/sys/i386/i386/pmap.c Tue Jun 8 04:41:31 2010 (r208903) @@ -4461,7 +4461,7 @@ pmap_ts_referenced(vm_page_t m) rtval++; if (rtval > 4) { PMAP_UNLOCK(pmap); - return (rtval); + goto out; } } } @@ -4490,6 +4490,7 @@ pmap_ts_referenced(vm_page_t m) PMAP_UNLOCK(pmap); } while ((pv = pvn) != NULL && pv != pvf); } +out: sched_unpin(); return (rtval); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 8 10:52: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 7E0A41065677; Tue, 8 Jun 2010 10:52:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6261B8FC0C; Tue, 8 Jun 2010 10:52: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 o58Aqb5Z078602; Tue, 8 Jun 2010 10:52:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58AqbUv078600; Tue, 8 Jun 2010 10:52:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006081052.o58AqbUv078600@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Jun 2010 10:52: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: r208908 - 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: Tue, 08 Jun 2010 10:52:37 -0000 Author: mav Date: Tue Jun 8 10:52:37 2010 New Revision: 208908 URL: http://svn.freebsd.org/changeset/base/208908 Log: MFC r208796: Fix PCH chipset IDs. They are 0x3bxx, not 0x3axx. Approved by: re (kib) Modified: stable/8/sys/dev/ata/chipsets/ata-intel.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Tue Jun 8 10:03:08 2010 (r208907) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Tue Jun 8 10:52:37 2010 (r208908) @@ -140,22 +140,22 @@ ata_intel_probe(device_t dev) { ATA_I82801JI_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JI_S2, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, - { 0x3a208086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a218086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a228086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a238086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a248086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a258086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a268086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a278086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a288086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a298086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2a8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2b8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2c8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2d8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2e8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, - { 0x3a2f8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b208086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b218086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b228086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b238086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b248086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b258086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b268086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b278086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b288086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b298086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2a8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2b8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2c8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2d8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2e8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, + { 0x3b2f8086, 0, INTEL_AHCI, 0, ATA_SA300, "PCH" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 8 17:26:18 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 EA85E106567C; Tue, 8 Jun 2010 17:26:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8BC88FC1D; Tue, 8 Jun 2010 17:26:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58HQITo065402; Tue, 8 Jun 2010 17:26:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58HQItr065400; Tue, 8 Jun 2010 17:26:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006081726.o58HQItr065400@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 8 Jun 2010 17:26: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: r208916 - stable/8/sys/powerpc/powermac 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, 08 Jun 2010 17:26:19 -0000 Author: nwhitehorn Date: Tue Jun 8 17:26:18 2010 New Revision: 208916 URL: http://svn.freebsd.org/changeset/base/208916 Log: MFC r208168: It is not necessary (and in some cases harmful) to hardcode ata_kauai's IRQ to 39 on K2 devices, as well as Shasta ones. Reported by: Andreas Tobler Approved by: re (kib) Modified: stable/8/sys/powerpc/powermac/ata_kauai.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/geom/sched/ (props changed) Modified: stable/8/sys/powerpc/powermac/ata_kauai.c ============================================================================== --- stable/8/sys/powerpc/powermac/ata_kauai.c Tue Jun 8 17:08:13 2010 (r208915) +++ stable/8/sys/powerpc/powermac/ata_kauai.c Tue Jun 8 17:26:18 2010 (r208916) @@ -220,8 +220,9 @@ ata_kauai_probe(device_t dev) if (compatstring != NULL && strcmp(compatstring,"shasta-ata") == 0) sc->shasta = 1; - /* Regular Kauai controllers apparently need this hack */ - if (!sc->shasta) + /* Pre-K2 controllers apparently need this hack */ + if (!sc->shasta && + (compatstring == NULL || strcmp(compatstring, "K2-UATA") != 0)) bus_set_resource(dev, SYS_RES_IRQ, 0, 39, 1); rid = PCIR_BARS; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 8 19:26:22 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 F12621065674; Tue, 8 Jun 2010 19:26:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9D78FC16; Tue, 8 Jun 2010 19:26:22 +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 o58JQMw2092029; Tue, 8 Jun 2010 19:26:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58JQM71092027; Tue, 8 Jun 2010 19:26:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006081926.o58JQM71092027@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Jun 2010 19:26:22 +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: r208923 - stable/8/sys/dev/sge 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, 08 Jun 2010 19:26:23 -0000 Author: yongari Date: Tue Jun 8 19:26:22 2010 New Revision: 208923 URL: http://svn.freebsd.org/changeset/base/208923 Log: MFC r208806: Don't blindly set IFF_DRV_OACTIVE when sge_encap() fails. If there is no queued frame, IFF_DRV_OACTIVE would never be cleared. Submitted by: Nikolay Denev < ndenev <> gmail at com > Approved by: re (bz) Modified: stable/8/sys/dev/sge/if_sge.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Tue Jun 8 18:36:03 2010 (r208922) +++ stable/8/sys/dev/sge/if_sge.c Tue Jun 8 19:26:22 2010 (r208923) @@ -1588,8 +1588,9 @@ sge_start_locked(struct ifnet *ifp) if (m_head == NULL) break; if (sge_encap(sc, &m_head)) { - if (m_head != NULL) - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 9 07:31: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 9B19910656C5; Wed, 9 Jun 2010 07:31:41 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 896BA8FC19; Wed, 9 Jun 2010 07:31: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 o597VfXA051753; Wed, 9 Jun 2010 07:31:41 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o597Vf4k051751; Wed, 9 Jun 2010 07:31:41 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006090731.o597Vf4k051751@svn.freebsd.org> From: Brian Somers Date: Wed, 9 Jun 2010 07:31: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: r208936 - stable/8/lib/libthr/thread 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, 09 Jun 2010 07:31:41 -0000 Author: brian Date: Wed Jun 9 07:31:41 2010 New Revision: 208936 URL: http://svn.freebsd.org/changeset/base/208936 Log: MFC r197477 - clean up keys deleted via pthread_key_delete() PR: 135462 Approved by: re (kib) Nod timeout: davidxu Modified: stable/8/lib/libthr/thread/thr_spec.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/8/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:32 2010 (r208935) +++ stable/8/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:41 2010 (r208936) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread->specific[key].data = NULL; curthread->specific_data_count--; } + else if (curthread->specific[key].data != NULL) { + /* + * This can happen if the key is deleted via + * pthread_key_delete without first setting the value + * to NULL in all threads. POSIX says that the + * destructor is not invoked in this case. + */ + curthread->specific[key].data = NULL; + curthread->specific_data_count--; + } /* - * If there is a destructore, call it + * If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 9 09:44: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 F33051065678; Wed, 9 Jun 2010 09:44:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E271C8FC15; Wed, 9 Jun 2010 09:44: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 o599i5vs081700; Wed, 9 Jun 2010 09:44:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o599i5OX081698; Wed, 9 Jun 2010 09:44:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006090944.o599i5OX081698@svn.freebsd.org> From: Andriy Gapon Date: Wed, 9 Jun 2010 09:44: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: r208939 - 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: Wed, 09 Jun 2010 09:44:06 -0000 Author: avg Date: Wed Jun 9 09:44:05 2010 New Revision: 208939 URL: http://svn.freebsd.org/changeset/base/208939 Log: MFC r208800: scsi_cd: pass correct pointer to free() Found with: Coverity Prevent(tm) CID: 2986 Approved by: re(kib) 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/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Wed Jun 9 08:53:50 2010 (r208938) +++ stable/8/sys/cam/scsi/scsi_cd.c Wed Jun 9 09:44:05 2010 (r208939) @@ -2528,7 +2528,7 @@ cdioctl(struct disk *dp, u_long cmd, voi error = cdgetmode(periph, ¶ms, AUDIO_PAGE); if (error) { - free(¶ms.mode_buf, M_SCSICD); + free(params.mode_buf, M_SCSICD); cam_periph_unlock(periph); break; } From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 9 10:14:00 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 3B69E1065676; Wed, 9 Jun 2010 10:14:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABBB8FC13; Wed, 9 Jun 2010 10:14:00 +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 o59AE0Xa091209; Wed, 9 Jun 2010 10:14:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59AE0lI091207; Wed, 9 Jun 2010 10:14:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006091014.o59AE0lI091207@svn.freebsd.org> From: Andriy Gapon Date: Wed, 9 Jun 2010 10:14:00 +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: r208941 - stable/8/sys/fs/udf 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, 09 Jun 2010 10:14:00 -0000 Author: avg Date: Wed Jun 9 10:13:59 2010 New Revision: 208941 URL: http://svn.freebsd.org/changeset/base/208941 Log: MFC r208671: udf_readlink: fix malloc call with uninitialized size parameter Found by: clang static analyzer Approved by: re(kib) Modified: stable/8/sys/fs/udf/udf_vnops.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/geom/sched/ (props changed) Modified: stable/8/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/8/sys/fs/udf/udf_vnops.c Wed Jun 9 09:51:16 2010 (r208940) +++ stable/8/sys/fs/udf/udf_vnops.c Wed Jun 9 10:13:59 2010 (r208941) @@ -904,9 +904,9 @@ udf_readlink(struct vop_readlink_args *a vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + iov[0].iov_len = len; buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); iov[0].iov_base = buf; - iov[0].iov_len = len; uio.uio_iov = iov; uio.uio_iovcnt = 1; uio.uio_offset = 0; From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 9 14:30:22 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 17100106566B; Wed, 9 Jun 2010 14:30:22 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0572E8FC18; Wed, 9 Jun 2010 14:30:22 +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 o59EUL0P049543; Wed, 9 Jun 2010 14:30:21 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59EULvZ049540; Wed, 9 Jun 2010 14:30:21 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006091430.o59EULvZ049540@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 9 Jun 2010 14:30: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: r208948 - stable/8/sbin/fsirand 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, 09 Jun 2010 14:30:22 -0000 Author: uqs Date: Wed Jun 9 14:30:21 2010 New Revision: 208948 URL: http://svn.freebsd.org/changeset/base/208948 Log: MFC r208074: fsirand(8): make WARNS=3 clean - Drop bogus quad_t cast for di_gen, it is a 32bit type - Print di_gen with leading zeros, to get consistent output Approved by: re (kib) Modified: stable/8/sbin/fsirand/Makefile stable/8/sbin/fsirand/fsirand.c Directory Properties: stable/8/sbin/fsirand/ (props changed) Modified: stable/8/sbin/fsirand/Makefile ============================================================================== --- stable/8/sbin/fsirand/Makefile Wed Jun 9 12:30:40 2010 (r208947) +++ stable/8/sbin/fsirand/Makefile Wed Jun 9 14:30:21 2010 (r208948) @@ -2,8 +2,8 @@ # $FreeBSD$ PROG= fsirand -WARNS?= 0 MAN= fsirand.8 +WARNS?= 3 DPADD= ${LIBUTIL} LDADD= -lutil Modified: stable/8/sbin/fsirand/fsirand.c ============================================================================== --- stable/8/sbin/fsirand/fsirand.c Wed Jun 9 12:30:40 2010 (r208947) +++ stable/8/sbin/fsirand/fsirand.c Wed Jun 9 14:30:21 2010 (r208948) @@ -47,6 +47,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -112,7 +113,7 @@ fsirand(char *device) struct ufs1_dinode *dp1; struct ufs2_dinode *dp2; caddr_t inodebuf; - size_t ibufsize; + ssize_t ibufsize; struct fs *sblock; ino_t inumber, maxino; ufs2_daddr_t sblockloc, dblk; @@ -135,14 +136,17 @@ fsirand(char *device) bsize = label.d_secsize; } + dp1 = NULL; + dp2 = NULL; + /* Read in master superblock */ (void)memset(&sbuf, 0, sizeof(sbuf)); sblock = (struct fs *)&sbuf; for (i = 0; sblock_try[i] != -1; i++) { sblockloc = sblock_try[i]; if (lseek(devfd, sblockloc, SEEK_SET) == -1) { - warn("can't seek to superblock (%qd) on %s", - sblockloc, device); + warn("can't seek to superblock (%jd) on %s", + (intmax_t)sblockloc, device); return (1); } if ((n = read(devfd, (void *)sblock, SBLOCKSIZE))!=SBLOCKSIZE) { @@ -154,7 +158,7 @@ fsirand(char *device) (sblock->fs_magic == FS_UFS2_MAGIC && sblock->fs_sblockloc == sblock_try[i])) && sblock->fs_bsize <= MAXBSIZE && - sblock->fs_bsize >= sizeof(struct fs)) + sblock->fs_bsize >= (ssize_t)sizeof(struct fs)) break; } if (sblock_try[i] == -1) { @@ -175,10 +179,10 @@ fsirand(char *device) /* Make sure backup superblocks are sane. */ sblock = (struct fs *)&sbuftmp; - for (cg = 0; cg < sblock->fs_ncg; cg++) { + for (cg = 0; cg < (int)sblock->fs_ncg; cg++) { dblk = fsbtodb(sblock, cgsblock(sblock, cg)); if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { - warn("can't seek to %qd", (off_t)dblk * bsize); + warn("can't seek to %jd", (intmax_t)dblk * bsize); return (1); } else if ((n = write(devfd, (void *)sblock, SBLOCKSIZE)) != SBLOCKSIZE) { warn("can't read backup superblock %d on %s: %s", @@ -211,7 +215,7 @@ fsirand(char *device) if (printonly && (sblock->fs_id[0] || sblock->fs_id[1])) { if (sblock->fs_id[0]) (void)printf("%s was randomized on %s", device, - ctime((const time_t *)&(sblock->fs_id[0]))); + ctime((void *)&(sblock->fs_id[0]))); (void)printf("fsid: %x %x\n", sblock->fs_id[0], sblock->fs_id[1]); } @@ -223,8 +227,8 @@ fsirand(char *device) sblock->fs_id[1] = random(); if (lseek(devfd, sblockloc, SEEK_SET) == -1) { - warn("can't seek to superblock (%qd) on %s", sblockloc, - device); + warn("can't seek to superblock (%jd) on %s", + (intmax_t)sblockloc, device); return (1); } if ((n = write(devfd, (void *)sblock, SBLOCKSIZE)) != @@ -236,12 +240,13 @@ fsirand(char *device) } /* For each cylinder group, randomize inodes and update backup sblock */ - for (cg = 0, inumber = 0; cg < sblock->fs_ncg; cg++) { + for (cg = 0, inumber = 0; cg < (int)sblock->fs_ncg; cg++) { /* Update superblock if appropriate */ if (!printonly) { dblk = fsbtodb(sblock, cgsblock(sblock, cg)); if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { - warn("can't seek to %qd", (off_t)dblk * bsize); + warn("can't seek to %jd", + (intmax_t)dblk * bsize); return (1); } else if ((n = write(devfd, (void *)sblock, SBLOCKSIZE)) != SBLOCKSIZE) { @@ -255,7 +260,7 @@ fsirand(char *device) /* Read in inodes, then print or randomize generation nums */ dblk = fsbtodb(sblock, ino_to_fsba(sblock, inumber)); if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { - warn("can't seek to %qd", (off_t)dblk * bsize); + warn("can't seek to %jd", (intmax_t)dblk * bsize); return (1); } else if ((n = read(devfd, inodebuf, ibufsize)) != ibufsize) { warnx("can't read inodes: %s", @@ -263,17 +268,17 @@ fsirand(char *device) return (1); } - for (n = 0; n < sblock->fs_ipg; n++, inumber++) { + for (n = 0; n < (int)sblock->fs_ipg; n++, inumber++) { if (sblock->fs_magic == FS_UFS1_MAGIC) dp1 = &((struct ufs1_dinode *)inodebuf)[n]; else dp2 = &((struct ufs2_dinode *)inodebuf)[n]; if (inumber >= ROOTINO) { if (printonly) - (void)printf("ino %d gen %qx\n", + (void)printf("ino %d gen %08x\n", inumber, sblock->fs_magic == FS_UFS1_MAGIC ? - (quad_t)dp1->di_gen : dp2->di_gen); + dp1->di_gen : dp2->di_gen); else if (sblock->fs_magic == FS_UFS1_MAGIC) dp1->di_gen = random(); else @@ -284,8 +289,8 @@ fsirand(char *device) /* Write out modified inodes */ if (!printonly) { if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { - warn("can't seek to %qd", - (off_t)dblk * bsize); + warn("can't seek to %jd", + (intmax_t)dblk * bsize); return (1); } else if ((n = write(devfd, inodebuf, ibufsize)) != ibufsize) { From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 9 14:31: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 3D357106566C; Wed, 9 Jun 2010 14:31:12 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9C08FC29; Wed, 9 Jun 2010 14:31: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 o59EVCQX049773; Wed, 9 Jun 2010 14:31:12 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59EVC2N049771; Wed, 9 Jun 2010 14:31:12 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006091431.o59EVC2N049771@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 9 Jun 2010 14:31: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: r208949 - stable/8/contrib/gdtoa 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, 09 Jun 2010 14:31:12 -0000 Author: uqs Date: Wed Jun 9 14:31:11 2010 New Revision: 208949 URL: http://svn.freebsd.org/changeset/base/208949 Log: MFC r208753: Add required header for isalnum(3) to quench compiler warnings Forgotten in: r174678 Submitted by: Alexander Best alexbestms at wwu.de Approved by: das Approved by: re (kib) Modified: stable/8/contrib/gdtoa/hexnan.c Directory Properties: stable/8/contrib/gdtoa/ (props changed) Modified: stable/8/contrib/gdtoa/hexnan.c ============================================================================== --- stable/8/contrib/gdtoa/hexnan.c Wed Jun 9 14:30:21 2010 (r208948) +++ stable/8/contrib/gdtoa/hexnan.c Wed Jun 9 14:31:11 2010 (r208949) @@ -31,6 +31,8 @@ THIS SOFTWARE. /* $FreeBSD$ */ +#include + #include "gdtoaimp.h" static void From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 9 14:54: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 510851065678; Wed, 9 Jun 2010 14:54:06 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26D0B8FC13; Wed, 9 Jun 2010 14:54: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 o59Es6OG054846; Wed, 9 Jun 2010 14:54:06 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59Es6jW054844; Wed, 9 Jun 2010 14:54:06 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201006091454.o59Es6jW054844@svn.freebsd.org> From: Attilio Rao Date: Wed, 9 Jun 2010 14:54: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: r208950 - 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: Wed, 09 Jun 2010 14:54:06 -0000 Author: attilio Date: Wed Jun 9 14:54:05 2010 New Revision: 208950 URL: http://svn.freebsd.org/changeset/base/208950 Log: MFC r208771: Improve wording and fix style. Sponsored by: Sandvine Incorporated Approved by: re (bz) Modified: stable/8/share/man/man4/io.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/io.4 ============================================================================== --- stable/8/share/man/man4/io.4 Wed Jun 9 14:31:11 2010 (r208949) +++ stable/8/share/man/man4/io.4 Wed Jun 9 14:54:05 2010 (r208950) @@ -72,22 +72,25 @@ all of them. The .Dv IODEV_PIO is used by all the architectures in order to request that an I/O operation -be performed. It takes a 'struct iodev_pio_req' argument -that must be previously setup. +be performed. +It takes a 'struct iodev_pio_req' argument that must be previously setup. .Pp The .Fa access -member specifies the type of operation requested. It may be: +member specifies the type of operation requested. +It may be: .Bl -tag -width IODEV_PIO_WRITE .It Dv IODEV_PIO_READ -The operation is an "in" type. A value will be read from the specified port +The operation is an "in" type. +A value will be read from the specified port (retrieved from the .Fa port member) and the result will be stored in the .Fa val member. .It Dv IODEV_PIO_WRITE -The operation is a "out" type. The value will be fetched from the +The operation is a "out" type. +The value will be fetched from the .Fa val member and will be written out to the specified port (defined as the .Fa port @@ -105,13 +108,14 @@ the kernel enforces that only the super- .Sh LEGACY The .Pa /dev/io -interface used to be very i386 specific and worked differently. The initial -implementation, in fact, simply raised the +interface used to be very i386 specific and worked differently. +The initial implementation simply raised the .Em IOPL of the current thread when .Xr open 2 -was called on the file. This behaviour is retained in the current -implementation as legacy support for both i386 and amd64 architectures. +was called on the device. +This behaviour is retained in the current implementation as legacy +support for both i386 and amd64 architectures. .Sh SEE ALSO .Xr close 2 , .Xr i386_get_ioperm 2 , From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 9 18:46:29 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 523801065670; Wed, 9 Jun 2010 18:46:29 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD7E8FC19; Wed, 9 Jun 2010 18:46:29 +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 o59IkTGp008041; Wed, 9 Jun 2010 18:46:29 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59IkT5m008040; Wed, 9 Jun 2010 18:46:29 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006091846.o59IkT5m008040@svn.freebsd.org> From: Matt Jacob Date: Wed, 9 Jun 2010 18:46:29 +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: r208956 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci geom/sched 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, 09 Jun 2010 18:46:29 -0000 Author: mjacob Date: Wed Jun 9 18:46:28 2010 New Revision: 208956 URL: http://svn.freebsd.org/changeset/base/208956 Log: Record merge for r198262 (done in r208894) Approved by: re (bz) 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/geom/sched/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 17:53:35 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 EEDD31065676; Thu, 10 Jun 2010 17:53:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD12B8FC14; Thu, 10 Jun 2010 17:53:35 +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 o5AHrZcX021741; Thu, 10 Jun 2010 17:53:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AHrZE6021738; Thu, 10 Jun 2010 17:53:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006101753.o5AHrZE6021738@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 10 Jun 2010 17:53: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: r208993 - stable/8/sys/dev/bge 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, 10 Jun 2010 17:53:36 -0000 Author: yongari Date: Thu Jun 10 17:53:35 2010 New Revision: 208993 URL: http://svn.freebsd.org/changeset/base/208993 Log: MFC r208862: Fix a bug introduced in r199011. When bge(4) reuses loaded RX buffers it should also reinitialize RX descriptors otherwise some stale data could be passed to controller. This could end up with mbuf double free or unexpected NULL pointer dereference in upper stack. To fix the issue, save loaded buffer's length and reinitialize RX descriptors with the saved value whenever bge(4) reuses the loaded RX buffers. While I'm here, increase the number of RX buffers to 512 from 256. This simplifies RX buffer handling as well as giving more RX buffers. Controller supports just fixed number of RX buffers (i.e. 512) and bge(4) used to rely on hope that our CPU is fast enough to keep up with the controller. With this change, bge(4) will use 1MB for RX buffers but I don't think it would cause problems in these days. Reported by: marcel Tested by: marcel Approved by: re (bz) Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Thu Jun 10 17:49:36 2010 (r208992) +++ stable/8/sys/dev/bge/if_bge.c Thu Jun 10 17:53:35 2010 (r208993) @@ -400,6 +400,8 @@ static void bge_setpromisc(struct bge_so static void bge_setmulti(struct bge_softc *); static void bge_setvlan(struct bge_softc *); +static __inline void bge_rxreuse_std(struct bge_softc *, int); +static __inline void bge_rxreuse_jumbo(struct bge_softc *, int); static int bge_newbuf_std(struct bge_softc *, int); static int bge_newbuf_jumbo(struct bge_softc *, int); static int bge_init_rx_ring_std(struct bge_softc *); @@ -949,6 +951,7 @@ bge_newbuf_std(struct bge_softc *sc, int sc->bge_cdata.bge_rx_std_dmamap[i] = sc->bge_cdata.bge_rx_std_sparemap; sc->bge_cdata.bge_rx_std_sparemap = map; sc->bge_cdata.bge_rx_std_chain[i] = m; + sc->bge_cdata.bge_rx_std_seglen[i] = segs[0].ds_len; r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); @@ -1006,6 +1009,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i sc->bge_cdata.bge_rx_jumbo_sparemap; sc->bge_cdata.bge_rx_jumbo_sparemap = map; sc->bge_cdata.bge_rx_jumbo_chain[i] = m; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = 0; + /* * Fill in the extended RX buffer descriptor. */ @@ -1018,18 +1026,22 @@ bge_newbuf_jumbo(struct bge_softc *sc, i r->bge_addr3.bge_addr_lo = BGE_ADDR_LO(segs[3].ds_addr); r->bge_addr3.bge_addr_hi = BGE_ADDR_HI(segs[3].ds_addr); r->bge_len3 = segs[3].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = segs[3].ds_len; case 3: r->bge_addr2.bge_addr_lo = BGE_ADDR_LO(segs[2].ds_addr); r->bge_addr2.bge_addr_hi = BGE_ADDR_HI(segs[2].ds_addr); r->bge_len2 = segs[2].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = segs[2].ds_len; case 2: r->bge_addr1.bge_addr_lo = BGE_ADDR_LO(segs[1].ds_addr); r->bge_addr1.bge_addr_hi = BGE_ADDR_HI(segs[1].ds_addr); r->bge_len1 = segs[1].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = segs[1].ds_len; case 1: r->bge_addr0.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr0.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_len0 = segs[0].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = segs[0].ds_len; break; default: panic("%s: %d segments\n", __func__, nsegs); @@ -1041,12 +1053,6 @@ bge_newbuf_jumbo(struct bge_softc *sc, i return (0); } -/* - * The standard receive ring has 512 entries in it. At 2K per mbuf cluster, - * that's 1MB or memory, which is a lot. For now, we fill only the first - * 256 ring entries and hope that our CPU is fast enough to keep up with - * the NIC. - */ static int bge_init_rx_ring_std(struct bge_softc *sc) { @@ -1054,7 +1060,7 @@ bge_init_rx_ring_std(struct bge_softc *s bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); sc->bge_std = 0; - for (i = 0; i < BGE_SSLOTS; i++) { + for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if ((error = bge_newbuf_std(sc, i)) != 0) return (error); BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); @@ -1063,8 +1069,8 @@ bge_init_rx_ring_std(struct bge_softc *s bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_std = i - 1; - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + sc->bge_std = 0; + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, BGE_STD_RX_RING_CNT - 1); return (0); } @@ -1106,14 +1112,14 @@ bge_init_rx_ring_jumbo(struct bge_softc bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_jumbo = i - 1; + sc->bge_jumbo = 0; rcb = &sc->bge_ldata.bge_info.bge_jumbo_rx_rcb; rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, BGE_JUMBO_RX_RING_CNT - 1); return (0); } @@ -3299,6 +3305,33 @@ bge_reset(struct bge_softc *sc) return(0); } +static __inline void +bge_rxreuse_std(struct bge_softc *sc, int i) +{ + struct bge_rx_bd *r; + + r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; + r->bge_flags = BGE_RXBDFLAG_END; + r->bge_len = sc->bge_cdata.bge_rx_std_seglen[i]; + r->bge_idx = i; + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); +} + +static __inline void +bge_rxreuse_jumbo(struct bge_softc *sc, int i) +{ + struct bge_extrx_bd *r; + + r = &sc->bge_ldata.bge_rx_jumbo_ring[sc->bge_jumbo]; + r->bge_flags = BGE_RXBDFLAG_JUMBO_RING | BGE_RXBDFLAG_END; + r->bge_len0 = sc->bge_cdata.bge_rx_jumbo_seglen[i][0]; + r->bge_len1 = sc->bge_cdata.bge_rx_jumbo_seglen[i][1]; + r->bge_len2 = sc->bge_cdata.bge_rx_jumbo_seglen[i][2]; + r->bge_len3 = sc->bge_cdata.bge_rx_jumbo_seglen[i][3]; + r->bge_idx = i; + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); +} + /* * Frame reception handling. This is called if there's a frame * on the receive return list. @@ -3362,24 +3395,24 @@ bge_rxeof(struct bge_softc *sc, uint16_t jumbocnt++; m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); continue; } if (bge_newbuf_jumbo(sc, rxidx) != 0) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); ifp->if_iqdrops++; continue; } BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); } else { stdcnt++; + m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); continue; } - m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (bge_newbuf_std(sc, rxidx) != 0) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); ifp->if_iqdrops++; continue; } Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Thu Jun 10 17:49:36 2010 (r208992) +++ stable/8/sys/dev/bge/if_bgereg.h Thu Jun 10 17:53:35 2010 (r208993) @@ -2561,6 +2561,8 @@ struct bge_chain_data { struct mbuf *bge_tx_chain[BGE_TX_RING_CNT]; struct mbuf *bge_rx_std_chain[BGE_STD_RX_RING_CNT]; struct mbuf *bge_rx_jumbo_chain[BGE_JUMBO_RX_RING_CNT]; + int bge_rx_std_seglen[BGE_STD_RX_RING_CNT]; + int bge_rx_jumbo_seglen[BGE_JUMBO_RX_RING_CNT][4]; }; struct bge_dmamap_arg { From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 19:11:01 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 42ADC1065677; Thu, 10 Jun 2010 19:11:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 310258FC18; Thu, 10 Jun 2010 19:11:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AJB15P038921; Thu, 10 Jun 2010 19:11:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AJB1ak038919; Thu, 10 Jun 2010 19:11:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006101911.o5AJB1ak038919@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 10 Jun 2010 19:11:01 +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: r208996 - stable/8/sys/powerpc/powerpc 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, 10 Jun 2010 19:11:01 -0000 Author: nwhitehorn Date: Thu Jun 10 19:11:00 2010 New Revision: 208996 URL: http://svn.freebsd.org/changeset/base/208996 Log: MFC r208835: Make sure that interrupt sense settings set after interrupts are enabled are respected. This fixes loading the Apple onboard audio driver (snd_ai2s) as a module after boot, which would previously cause a panic. PR: powerpc/146888 Approved by: re (kensmith) Modified: stable/8/sys/powerpc/powerpc/intr_machdep.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/geom/sched/ (props changed) Modified: stable/8/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/intr_machdep.c Thu Jun 10 18:04:25 2010 (r208995) +++ stable/8/sys/powerpc/powerpc/intr_machdep.c Thu Jun 10 19:11:00 2010 (r208996) @@ -164,6 +164,7 @@ intr_lookup(u_int irq) i->trig = INTR_TRIGGER_CONFORM; i->pol = INTR_POLARITY_CONFORM; i->irq = irq; + i->pic = NULL; i->vector = -1; mtx_lock(&intr_table_lock); @@ -325,6 +326,11 @@ powerpc_setup_intr(const char *name, u_i if (!cold) { error = powerpc_map_irq(i); + + if (!error && (i->trig != INTR_TRIGGER_CONFORM || + i->pol != INTR_POLARITY_CONFORM)) + PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); + if (!error && enable) PIC_ENABLE(i->pic, i->intline, i->vector); } @@ -350,7 +356,7 @@ powerpc_config_intr(int irq, enum intr_t i->trig = trig; i->pol = pol; - if (!cold) + if (!cold && i->pic != NULL) PIC_CONFIG(i->pic, i->intline, trig, pol); return (0); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 19:58: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 D3202106564A; Thu, 10 Jun 2010 19:58:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C112A8FC12; Thu, 10 Jun 2010 19:58: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 o5AJwsvP049555; Thu, 10 Jun 2010 19:58:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AJwsQp049554; Thu, 10 Jun 2010 19:58:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006101958.o5AJwsQp049554@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 10 Jun 2010 19:58: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: r208998 - in stable/8/release: ia64 picobsd/floppy.tree/sbin 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, 10 Jun 2010 19:58:54 -0000 Author: marcel Date: Thu Jun 10 19:58:54 2010 New Revision: 208998 URL: http://svn.freebsd.org/changeset/base/208998 Log: MFC rev 208622: The EFI system partition used to make the CD image bootable is running out of space. Bump it up... Approved by: re (kensmith) Modified: stable/8/release/ia64/mkisoimages.sh Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) Modified: stable/8/release/ia64/mkisoimages.sh ============================================================================== --- stable/8/release/ia64/mkisoimages.sh Thu Jun 10 19:38:07 2010 (r208997) +++ stable/8/release/ia64/mkisoimages.sh Thu Jun 10 19:58:54 2010 (r208998) @@ -67,7 +67,7 @@ EFIPART=efipart.sys # To create a bootable CD under EFI, the boot image should be an EFI # system partition. if [ $bootable = yes ]; then - EFISZ=40960 + EFISZ=65536 MNT=/mnt dd if=/dev/zero of=$BASE/$EFIPART count=$EFISZ md=`mdconfig -a -t vnode -f $BASE/$EFIPART` From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:01: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 AAA6F1065673; Thu, 10 Jun 2010 20:01:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9956F8FC19; Thu, 10 Jun 2010 20:01: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 o5AK1XAF050283; Thu, 10 Jun 2010 20:01:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AK1Xaw050281; Thu, 10 Jun 2010 20:01:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102001.o5AK1Xaw050281@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:01: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: r209000 - stable/8/sys/dev/acpica 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, 10 Jun 2010 20:01:33 -0000 Author: jhb Date: Thu Jun 10 20:01:33 2010 New Revision: 209000 URL: http://svn.freebsd.org/changeset/base/209000 Log: MFC 208925: The lock associated with the /dev/apm knote is already held, so use KNOTE_LOCKED() instead of KNOTE_UNLOCKED(). Approved by: re (kib) Modified: stable/8/sys/dev/acpica/acpi.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Thu Jun 10 19:59:23 2010 (r208999) +++ stable/8/sys/dev/acpica/acpi.c Thu Jun 10 20:01:33 2010 (r209000) @@ -2356,7 +2356,7 @@ acpi_ReqSleepState(struct acpi_softc *sc clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { selwakeuppri(&clone->sel_read, PZERO); - KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); + KNOTE_LOCKED(&clone->sel_read.si_note, 0); } } #endif From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:04: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 1214A1065675; Thu, 10 Jun 2010 20:04:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0117B8FC1B; Thu, 10 Jun 2010 20:04: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 o5AK4iAH051079; Thu, 10 Jun 2010 20:04:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AK4i4m051077; Thu, 10 Jun 2010 20:04:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102004.o5AK4i4m051077@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:04: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: r209002 - 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: Thu, 10 Jun 2010 20:04:45 -0000 Author: jhb Date: Thu Jun 10 20:04:44 2010 New Revision: 209002 URL: http://svn.freebsd.org/changeset/base/209002 Log: MFC 208912: Fix a sign bug that caused adaptive spinning in sx_xlock() to not work properly. Approved by: re (bz) Modified: stable/8/sys/kern/kern_sx.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/geom/sched/ (props changed) Modified: stable/8/sys/kern/kern_sx.c ============================================================================== --- stable/8/sys/kern/kern_sx.c Thu Jun 10 20:02:13 2010 (r209001) +++ stable/8/sys/kern/kern_sx.c Thu Jun 10 20:04:44 2010 (r209002) @@ -508,7 +508,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t * running or the state of the lock changes. */ x = sx->sx_lock; - if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0) { + if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) { if ((x & SX_LOCK_SHARED) == 0) { x = SX_OWNER(x); owner = (struct thread *)x; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:13:04 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 2100F106564A; Thu, 10 Jun 2010 20:13:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F2FE8FC0C; Thu, 10 Jun 2010 20:13:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKD3nJ052991; Thu, 10 Jun 2010 20:13:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKD3mu052989; Thu, 10 Jun 2010 20:13:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102013.o5AKD3mu052989@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:13: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: r209003 - stable/8/sys/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: Thu, 10 Jun 2010 20:13:04 -0000 Author: jhb Date: Thu Jun 10 20:13:03 2010 New Revision: 209003 URL: http://svn.freebsd.org/changeset/base/209003 Log: MFC 208603,208605: More gracefully handle stale file handles and attributes when opening a file via NFS. Specifically, to satisfy close-to-open-consistency, the NFS client always performs at least one RPC on a file during an open(2) to see if the file has changed. Normally this RPC is an ACCESS or GETATTR RPC that is forced by flushing a file's attribute cache during nfs_open() and then requesting new attributes. However, if the file is noticed to be stale during nfs_open(), the only recourse is to fail the open(2) call with ESTALE. On the other hand, if the ACCESS or GETATTR RPC is sent during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to obtain the new file handle in the case that a file has been replaced. This change causes the NFS client to flush the attribute cache during nfs_lookup() when validating a name cache hit if the attributes fetched during nfs_lookup() can be reused in nfs_open(). This allows the client to open a replaced file via the new file handle the first time that it notices a replaced file rather than failing with ESTALE in some cases. Approved by: re (kib) Modified: stable/8/sys/nfsclient/nfs_vnops.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/geom/sched/ (props changed) Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Thu Jun 10 20:04:44 2010 (r209002) +++ stable/8/sys/nfsclient/nfs_vnops.c Thu Jun 10 20:13:03 2010 (r209003) @@ -932,7 +932,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct mbuf *mreq, *mrep, *md, *mb; long len; nfsfh_t *fhp; - struct nfsnode *np; + struct nfsnode *np, *newnp; int error = 0, attrflag, fhsize, ltype; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; @@ -958,10 +958,27 @@ nfs_lookup(struct vop_lookup_args *ap) * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback * to doing a lookup RPC. + * + * To better handle stale file handles and attributes, + * clear the attribute cache of this node if it is a + * leaf component, part of an open() call, and not + * locally modified before fetching the attributes. + * This should allow stale file handles to be detected + * here where we can fall back to a LOOKUP RPC to + * recover rather than having nfs_open() detect the + * stale file handle and failing open(2) with ESTALE. */ newvp = *vpp; - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) - && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { + newnp = VTONFS(newvp); + if ((cnp->cn_flags & (ISLASTCN | ISOPEN)) == + (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { + mtx_lock(&newnp->n_mtx); + newnp->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); + mtx_unlock(&newnp->n_mtx); + } + if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + vattr.va_ctime.tv_sec == newnp->n_ctime) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:20: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 E5D031065672; Thu, 10 Jun 2010 20:20:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3EF28FC18; Thu, 10 Jun 2010 20:20: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 o5AKKk4i054883; Thu, 10 Jun 2010 20:20:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKKkQc054880; Thu, 10 Jun 2010 20:20:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102020.o5AKKkQc054880@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:20:46 +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: r209007 - stable/8/sys/net80211 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, 10 Jun 2010 20:20:47 -0000 Author: rpaulo Date: Thu Jun 10 20:20:46 2010 New Revision: 209007 URL: http://svn.freebsd.org/changeset/base/209007 Log: MFC r208699: Fix resource leaks in ieee80211_ioctl_setchanlist() in case of error. Found with: Coverity Prevent(tm) CID: 4115 Approved by: re (kensmith) Modified: stable/8/sys/net80211/ieee80211_ioctl.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/geom/sched/ (props changed) Modified: stable/8/sys/net80211/ieee80211_ioctl.c ============================================================================== --- stable/8/sys/net80211/ieee80211_ioctl.c Thu Jun 10 20:15:45 2010 (r209006) +++ stable/8/sys/net80211/ieee80211_ioctl.c Thu Jun 10 20:20:46 2010 (r209007) @@ -1590,8 +1590,10 @@ ieee80211_ioctl_setchanlist(struct ieee8 if (list == NULL) return ENOMEM; error = copyin(ireq->i_data, list, ireq->i_len); - if (error) + if (error) { + free(list, M_TEMP); return error; + } nchan = 0; chanlist = list + ireq->i_len; /* NB: zero'd already */ maxchan = ireq->i_len * NBBY; @@ -1607,8 +1609,10 @@ ieee80211_ioctl_setchanlist(struct ieee8 nchan++; } } - if (nchan == 0) + if (nchan == 0) { + free(list, M_TEMP); return EINVAL; + } if (ic->ic_bsschan != IEEE80211_CHAN_ANYC && /* XXX */ isclr(chanlist, ic->ic_bsschan->ic_ieee)) ic->ic_bsschan = IEEE80211_CHAN_ANYC; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:23: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 09BA11065709; Thu, 10 Jun 2010 20:23:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC1648FC23; Thu, 10 Jun 2010 20:23: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 o5AKNK44055502; Thu, 10 Jun 2010 20:23:20 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKNK0A055500; Thu, 10 Jun 2010 20:23:20 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102023.o5AKNK0A055500@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:23:20 +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: r209008 - stable/8/sys/dev/ath/ath_hal/ar5416 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, 10 Jun 2010 20:23:21 -0000 Author: rpaulo Date: Thu Jun 10 20:23:20 2010 New Revision: 209008 URL: http://svn.freebsd.org/changeset/base/209008 Log: MFC r208703: Fix an off by one in ar9285SetPowerCalTable(). Found with: Coverity Prevent(tm) CID: 3979 Approved by: re (kensmit) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Thu Jun 10 20:20:46 2010 (r209007) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Thu Jun 10 20:23:20 2010 (r209008) @@ -634,7 +634,7 @@ ar9285SetPowerCalTable(struct ath_hal *a OS_REG_WRITE(ah, AR_PHY_TPCRG1, (OS_REG_READ(ah, AR_PHY_TPCRG1) & ~(AR_PHY_TPCRG1_NUM_PD_GAIN | AR_PHY_TPCRG1_PD_GAIN_1 | AR_PHY_TPCRG1_PD_GAIN_2 | AR_PHY_TPCRG1_PD_GAIN_3)) | SM(numXpdGain - 1, AR_PHY_TPCRG1_NUM_PD_GAIN) | SM(xpdGainValues[0], AR_PHY_TPCRG1_PD_GAIN_1 ) | - SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | SM(xpdGainValues[2], AR_PHY_TPCRG1_PD_GAIN_3)); + SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | SM(0, AR_PHY_TPCRG1_PD_GAIN_3)); for (i = 0; i < AR5416_MAX_CHAINS; i++) { From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:26:35 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 343981065670; Thu, 10 Jun 2010 20:26:35 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 216578FC0C; Thu, 10 Jun 2010 20:26:35 +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 o5AKQZ4L056241; Thu, 10 Jun 2010 20:26:35 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKQYK5056232; Thu, 10 Jun 2010 20:26:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102026.o5AKQYK5056232@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:26:34 +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: r209009 - in stable/8/sys/dev/ath/ath_hal: . ar5416 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, 10 Jun 2010 20:26:35 -0000 Author: rpaulo Date: Thu Jun 10 20:26:34 2010 New Revision: 209009 URL: http://svn.freebsd.org/changeset/base/209009 Log: MFC r208711: Bring in a couple of fixes from the Linux ath9k related to chip hangs. While there, try to make the register write pattern look like what's done by ath9k. Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ah.h stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ah.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah.h Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ah.h Thu Jun 10 20:26:34 2010 (r209009) @@ -324,6 +324,7 @@ typedef enum { HAL_INT_RXORN = 0x00000020, HAL_INT_TX = 0x00000040, /* Non-common mapping */ HAL_INT_TXDESC = 0x00000080, + HAL_INT_TIM_TIMER= 0x00000100, HAL_INT_TXURN = 0x00000800, HAL_INT_MIB = 0x00001000, HAL_INT_RXPHY = 0x00004000, Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Thu Jun 10 20:26:34 2010 (r209009) @@ -38,11 +38,8 @@ v4kEepromGet(struct ath_hal *ah, int par int i; switch (param) { - case AR_EEP_NFTHRESH_5: - *(int16_t *)val = pModal[0].noiseFloorThreshCh[0]; - return HAL_OK; case AR_EEP_NFTHRESH_2: - *(int16_t *)val = pModal[1].noiseFloorThreshCh[0]; + *(int16_t *)val = pModal->noiseFloorThreshCh[0]; return HAL_OK; case AR_EEP_MACADDR: /* Get MAC Address */ sum = 0; @@ -67,14 +64,10 @@ v4kEepromGet(struct ath_hal *ah, int par return pBase->opCapFlags; case AR_EEP_RFSILENT: return pBase->rfSilent; - case AR_EEP_OB_5: - return pModal[CHAN_A_IDX].ob; - case AR_EEP_DB_5: - return pModal[CHAN_A_IDX].db; case AR_EEP_OB_2: - return pModal[CHAN_B_IDX].ob; + return pModal->ob; case AR_EEP_DB_2: - return pModal[CHAN_B_IDX].db; + return pModal->db; case AR_EEP_TXMASK: return pBase->txMask; case AR_EEP_RXMASK: @@ -84,11 +77,9 @@ v4kEepromGet(struct ath_hal *ah, int par case AR_EEP_TXGAIN_TYPE: return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ? pBase->txGainType : AR5416_EEP_TXGAIN_ORIG; -#if 0 case AR_EEP_OL_PWRCTRL: HALASSERT(val == AH_NULL); - return pBase->openLoopPwrCntl ? HAL_OK : HAL_EIO; -#endif + return HAL_EIO; case AR_EEP_AMODE: HALASSERT(val == AH_NULL); return pBase->opCapFlags & AR5416_OPFLAGS_11A ? @@ -110,15 +101,11 @@ v4kEepromGet(struct ath_hal *ah, int par case AR_EEP_AES: case AR_EEP_BURST: case AR_EEP_RFKILL: - case AR_EEP_TURBO5DISABLE: case AR_EEP_TURBO2DISABLE: HALASSERT(val == AH_NULL); return HAL_OK; case AR_EEP_ANTGAINMAX_2: - *(int8_t *) val = ee->ee_antennaGainMax[1]; - return HAL_OK; - case AR_EEP_ANTGAINMAX_5: - *(int8_t *) val = ee->ee_antennaGainMax[0]; + *(int8_t *) val = ee->ee_antennaGainMax; return HAL_OK; default: HALASSERT(0); @@ -136,10 +123,7 @@ v4kEepromSet(struct ath_hal *ah, int par switch (param) { case AR_EEP_ANTGAINMAX_2: - ee->ee_antennaGainMax[1] = (int8_t) v; - return HAL_OK; - case AR_EEP_ANTGAINMAX_5: - ee->ee_antennaGainMax[0] = (int8_t) v; + ee->ee_antennaGainMax = (int8_t) v; return HAL_OK; } return HAL_EINVAL; @@ -252,7 +236,7 @@ v4kEepromReadCTLInfo(struct ath_hal *ah, RD_EDGES_POWER *rep = ee->ee_rdEdgesPower; int i, j; - HALASSERT(AR5416_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES); + HALASSERT(AR5416_4K_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES); for (i = 0; ee->ee_base.ctlIndex[i] != 0 && i < AR5416_4K_NUM_CTLS; i++) { for (j = 0; j < NUM_EDGES; j ++) { Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Thu Jun 10 20:26:34 2010 (r209009) @@ -23,6 +23,8 @@ #include "ah_eeprom.h" #include "ah_eeprom_v14.h" +#define AR9285_RDEXT_DEFAULT 0x1F + #undef owl_eep_start_loc #ifdef __LINUX_ARM_ARCH__ /* AP71 */ #define owl_eep_start_loc 0 @@ -150,6 +152,6 @@ typedef struct { uint16_t ee_numCtls; RD_EDGES_POWER ee_rdEdgesPower[NUM_EDGES*AR5416_4K_NUM_CTLS]; /* XXX these are dynamically calculated for use by shared code */ - int8_t ee_antennaGainMax[2]; + int8_t ee_antennaGainMax; } HAL_EEPROM_v4k; #endif /* _AH_EEPROM_V4K_H_ */ Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Jun 10 20:26:34 2010 (r209009) @@ -120,6 +120,13 @@ ar5416GetPendingInterrupts(struct ath_ha ahp->ah_intrTxqs |= MS(isr1, AR_ISR_S1_QCU_TXEOL); } + if (AR_SREV_MERLIN(ah) || AR_SREV_KITE(ah)) { + uint32_t isr5; + isr5 = OS_REG_READ(ah, AR_ISR_S5_S); + if (isr5 & AR_ISR_S5_TIM_TIMER) + *masked |= HAL_INT_TIM_TIMER; + } + /* Interrupt Mitigation on AR5416 */ #ifdef AR5416_INT_MITIGATION if (isr & (AR_ISR_RXMINTR | AR_ISR_RXINTM)) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Jun 10 20:26:34 2010 (r209009) @@ -170,7 +170,16 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO OS_REG_WRITE(ah, AR_RSSI_THR, rssiThrReg); OS_MARK(ah, AH_MARK_RESET_LINE, __LINE__); + if (AR_SREV_MERLIN_10_OR_LATER(ah)) + OS_REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE); + if (AR_SREV_KITE(ah)) { + uint32_t val; + val = OS_REG_READ(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS); + val &= ~AR_PHY_RIFS_INIT_DELAY; + OS_REG_WRITE(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS, val); + } + AH5416(ah)->ah_writeIni(ah, chan); /* Setup 11n MAC/Phy mode registers */ @@ -1019,8 +1028,11 @@ ar5416SetResetPowerOn(struct ath_hal *ah /* * RTC reset and clear */ + OS_REG_WRITE(ah, AR_RC, AR_RC_AHB); OS_REG_WRITE(ah, AR_RTC_RESET, 0); OS_DELAY(20); + OS_REG_WRITE(ah, AR_RC, 0); + OS_REG_WRITE(ah, AR_RTC_RESET, 1); /* Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Thu Jun 10 20:26:34 2010 (r209009) @@ -111,6 +111,9 @@ #define AR_PHY_HEAVY_CLIP_ENABLE 0x99E0 +#define AR_PHY_HEAVY_CLIP_FACTOR_RIFS 0x99ec +#define AR_PHY_RIFS_INIT_DELAY 0x03ff0000 + #define AR_PHY_M_SLEEP 0x99f0 /* sleep control registers */ #define AR_PHY_REFCLKDLY 0x99f4 #define AR_PHY_REFCLKPD 0x99f8 Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Thu Jun 10 20:26:34 2010 (r209009) @@ -127,6 +127,7 @@ #define AR_EXTRCCNT 0x8328 /* extension channel rx clear count */ #define AR_SELFGEN_MASK 0x832c /* rx and cal chain masks */ #define AR_PCU_TXBUF_CTRL 0x8340 +#define AR_PCU_MISC_MODE2 0x8344 /* DMA & PCI Registers in PCI space (usable during sleep)*/ #define AR_RC_AHB 0x00000001 /* AHB reset */ @@ -244,6 +245,10 @@ #define AR_ISR_S2_GTT 0x00800000 /* Global transmit timeout */ #define AR_ISR_S2_TSFOOR 0x40000000 /* RX TSF out of range */ +#define AR_ISR_S5 0x0098 +#define AR_ISR_S5_S 0x00d8 +#define AR_ISR_S5_TIM_TIMER 0x00000010 + #define AR_INTR_SPURIOUS 0xffffffff #define AR_INTR_RTC_IRQ 0x00000001 /* rtc in shutdown state */ #define AR_INTR_MAC_IRQ 0x00000002 /* pending mac interrupt */ @@ -495,6 +500,8 @@ #define AR_PCU_CLEAR_VMF 0x01000000 /* clear vmf mode (fast cc)*/ #define AR_PCU_CLEAR_BA_VALID 0x04000000 /* clear ba state */ +#define AR_PCU_MISC_MODE2_HWWAR1 0x00100000 + /* GPIO Interrupt */ #define AR_INTR_GPIO 0x3FF00000 /* gpio interrupted */ #define AR_INTR_GPIO_S 20 @@ -521,6 +528,8 @@ #define AR_GPIO_INTR_POL_VAL 0x1FFF #define AR_GPIO_INTR_POL_VAL_S 0 +#define AR_GPIO_JTAG_DISABLE 0x00020000 + #define AR_2040_JOINED_RX_CLEAR 0x00000001 /* use ctl + ext rx_clear for cca */ #define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Thu Jun 10 20:23:20 2010 (r209008) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Thu Jun 10 20:26:34 2010 (r209009) @@ -316,6 +316,16 @@ ar9285WriteIni(struct ath_hal *ah, const regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_common, 1, regWrites); + OS_REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); + + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + uint32_t val; + val = OS_REG_READ(ah, AR_PCU_MISC_MODE2) & + (~AR_PCU_MISC_MODE2_HWWAR1); + OS_REG_WRITE(ah, AR_PCU_MISC_MODE2, val); + OS_REG_WRITE(ah, 0x9800 + (651 << 2), 0x11); + } + } /* From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:28: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 2B65B1065678; Thu, 10 Jun 2010 20:28:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184438FC21; Thu, 10 Jun 2010 20:28: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 o5AKSgOc056740; Thu, 10 Jun 2010 20:28:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKSgUU056738; Thu, 10 Jun 2010 20:28:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102028.o5AKSgUU056738@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:28: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: r209010 - stable/8/sys/dev/ath/ath_hal/ar5416 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, 10 Jun 2010 20:28:43 -0000 Author: rpaulo Date: Thu Jun 10 20:28:42 2010 New Revision: 209010 URL: http://svn.freebsd.org/changeset/base/209010 Log: MFC r208712: Rewrite ar9285SetBoardValues() to match what ath9k does and fix out of bounds reads. Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Thu Jun 10 20:26:34 2010 (r209009) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Thu Jun 10 20:28:42 2010 (r209010) @@ -245,107 +245,60 @@ ar9285SetBoardValues(struct ath_hal *ah, const HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; const struct ar5416eeprom_4k *eep = &ee->ee_base; const MODAL_EEP4K_HEADER *pModal; - int i, regChainOffset; - uint8_t txRxAttenLocal; /* workaround for eeprom versions <= 14.2 */ + uint8_t txRxAttenLocal = 23; HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); pModal = &eep->modalHeader; - /* NB: workaround for eeprom versions <= 14.2 */ - txRxAttenLocal = 23; - OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon); - for (i = 0; i < AR5416_4K_MAX_CHAINS; i++) { - if (AR_SREV_MERLIN(ah)) { - if (i >= 2) break; - } - if (AR_SREV_OWL_20_OR_LATER(ah) && - (AH5416(ah)->ah_rx_chainmask == 0x5 || - AH5416(ah)->ah_tx_chainmask == 0x5) && i != 0) { - /* Regs are swapped from chain 2 to 1 for 5416 2_0 with - * only chains 0 and 2 populated - */ - regChainOffset = (i == 1) ? 0x2000 : 0x1000; - } else { - regChainOffset = i * 0x1000; - } - - OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset, pModal->antCtrlChain[i]); - OS_REG_WRITE(ah, AR_PHY_TIMING_CTRL4 + regChainOffset, - (OS_REG_READ(ah, AR_PHY_TIMING_CTRL4 + regChainOffset) & + OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, pModal->antCtrlChain[0]); + OS_REG_WRITE(ah, AR_PHY_TIMING_CTRL4, + (OS_REG_READ(ah, AR_PHY_TIMING_CTRL4) & ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | - SM(pModal->iqCalICh[i], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | - SM(pModal->iqCalQCh[i], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); - - /* - * Large signal upgrade. - * XXX update - */ + SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | + SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); - if ((i == 0) || AR_SREV_OWL_20_OR_LATER(ah)) { - OS_REG_WRITE(ah, AR_PHY_RXGAIN + regChainOffset, - (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & ~AR_PHY_RXGAIN_TXRX_ATTEN) | - SM(IS_EEP_MINOR_V3(ah) ? pModal->txRxAttenCh[i] : txRxAttenLocal, - AR_PHY_RXGAIN_TXRX_ATTEN)); - - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | - SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); - } - } - - OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, pModal->switchSettling); - OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, pModal->adcDesiredSize); - OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_PGA, pModal->pgaDesiredSize); - OS_REG_WRITE(ah, AR_PHY_RF_CTL4, - SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAA_OFF) - | SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAB_OFF) - | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAA_ON) - | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAB_ON)); - - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, pModal->txEndToRxOn); - - OS_REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62, - pModal->thresh62); - OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA0_THRESH62, - pModal->thresh62); - - /* Minor Version Specific application */ - if (IS_EEP_MINOR_V2(ah)) { - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_DATA_START, pModal->txFrameToDataStart); - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_PA_ON, pModal->txFrameToPaOn); - } - if (IS_EEP_MINOR_V3(ah)) { if (IEEE80211_IS_CHAN_HT40(chan)) { /* Overwrite switch settling with HT40 value */ - OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, pModal->swSettleHt40); + OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, + pModal->swSettleHt40); } - - if ((AR_SREV_OWL_20_OR_LATER(ah)) && - ( AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5)){ - /* Reg Offsets are swapped for logical mapping */ - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM(pModal->bswMargin[2], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM(pModal->bswAtten[2], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM(pModal->bswMargin[1], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM(pModal->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - } else { - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM(pModal->bswMargin[1], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM(pModal->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM(pModal->bswMargin[2],AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM(pModal->bswAtten[2], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - } - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_MARGIN, pModal->bswMargin[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_ATTEN, pModal->bswAtten[0]); - } + txRxAttenLocal = pModal->txRxAttenCh[0]; + + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, + pModal->bswMargin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN1_DB, + pModal->bswAtten[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, + pModal->xatten2Margin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_XATTEN2_DB, + pModal->xatten2Db[0]); + + /* block 1 has the same values as block 0 */ + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, pModal->bswMargin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN1_DB, pModal->bswAtten[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, pModal->xatten2Margin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000, + AR_PHY_GAIN_2GHZ_XATTEN2_DB, pModal->xatten2Db[0]); + + } + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN, + AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN, + AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); + + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, + AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, + AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); + + if (AR_SREV_KITE_11(ah)) + OS_REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14)); + return AH_TRUE; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:34:23 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 11C57106566B; Thu, 10 Jun 2010 20:34:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F40288FC12; Thu, 10 Jun 2010 20:34:22 +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 o5AKYMLo058083; Thu, 10 Jun 2010 20:34:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKYMXX058081; Thu, 10 Jun 2010 20:34:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102034.o5AKYMXX058081@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:34:22 +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: r209011 - stable/8/sys/dev/ath/ath_hal/ar5211 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, 10 Jun 2010 20:34:23 -0000 Author: rpaulo Date: Thu Jun 10 20:34:22 2010 New Revision: 209011 URL: http://svn.freebsd.org/changeset/base/209011 Log: MFC r208644: Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. While there, fix 'const static' typo. Submitted by: Arnaud Lacombe Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Jun 10 20:28:42 2010 (r209010) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Jun 10 20:34:22 2010 (r209011) @@ -46,7 +46,7 @@ typedef struct { } CHAN_INFO_2GHZ; #define CI_2GHZ_INDEX_CORRECTION 19 -const static CHAN_INFO_2GHZ chan2GHzData[] = { +static const CHAN_INFO_2GHZ chan2GHzData[] = { { 1, 0x46, 96 }, /* 2312 -19 */ { 1, 0x46, 97 }, /* 2317 -18 */ { 1, 0x46, 98 }, /* 2322 -17 */ @@ -926,9 +926,10 @@ ar5211IsNfGood(struct ath_hal *ah, struc if (!getNoiseFloorThresh(ah, chan, &nfThresh)) return AH_FALSE; - if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) + if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: NF did not complete in calibration window\n", __func__); + } nf = ar5211GetNoiseFloor(ah); if (nf > nfThresh) { HALDEBUG(ah, HAL_DEBUG_ANY, From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:36: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 406DA106564A; Thu, 10 Jun 2010 20:36:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E7C28FC1C; Thu, 10 Jun 2010 20:36: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 o5AKaVIb058661; Thu, 10 Jun 2010 20:36:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKaVVY058659; Thu, 10 Jun 2010 20:36:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102036.o5AKaVVY058659@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:36: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: r209012 - stable/8/sys/dev/ath/ath_hal/ar5210 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, 10 Jun 2010 20:36:31 -0000 Author: rpaulo Date: Thu Jun 10 20:36:30 2010 New Revision: 209012 URL: http://svn.freebsd.org/changeset/base/209012 Log: MFC r208643: Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. Submitted by: Arnaud Lacombe Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_reset.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Thu Jun 10 20:34:22 2010 (r209011) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Thu Jun 10 20:36:30 2010 (r209012) @@ -526,9 +526,10 @@ ar5210PerCalibrationN(struct ath_hal *ah /* AGC calibration (this was added to make the NF threshold check work) */ OS_REG_WRITE(ah, AR_PHY_AGCCTL, OS_REG_READ(ah, AR_PHY_AGCCTL) | AR_PHY_AGC_CAL); - if (!ath_hal_wait(ah, AR_PHY_AGCCTL, AR_PHY_AGC_CAL, 0)) + if (!ath_hal_wait(ah, AR_PHY_AGCCTL, AR_PHY_AGC_CAL, 0)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: AGC calibration timeout\n", __func__); + } /* Rewrite our AGC values we stored off earlier (return AGC to normal operation) */ OS_REG_WRITE(ah, 0x9858, reg9858); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:51: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 C41E91065676; Thu, 10 Jun 2010 20:51:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFC8E8FC0C; Thu, 10 Jun 2010 20:51: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 o5AKpDaA062091; Thu, 10 Jun 2010 20:51:13 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKpDfY062053; Thu, 10 Jun 2010 20:51:13 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102051.o5AKpDfY062053@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:51: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: r209014 - in stable/8/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5312 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, 10 Jun 2010 20:51:16 -0000 Author: rpaulo Date: Thu Jun 10 20:51:13 2010 New Revision: 209014 URL: http://svn.freebsd.org/changeset/base/209014 Log: MFC r204644: Replace Id keyword with FreeBSD keyword and set the svn props correctly. No functional change. Approved by: re (bz) Modified: stable/8/sys/dev/ath/ath_hal/ah_debug.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_decode.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_devid.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_eeprom.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_eeprom_v3.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ah_soc.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_power.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210desc.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210phy.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5210reg.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_power.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211desc.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211phy.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/ar5211reg.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5211/boss.ini (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.ini (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212desc.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5212phy.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5212/ar5311reg.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_power.c (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312phy.h (contents, props changed) stable/8/sys/dev/ath/ath_hal/ar5312/ar5312reg.h (contents, props changed) 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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_debug.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_debug.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_debug.h,v 1.1 2008/10/12 16:44:34 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_DEBUG_H_ #define _ATH_AH_DEBUG_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_decode.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_decode.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_decode.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_decode.h,v 1.4 2008/11/10 04:08:00 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_DECODE_H_ #define _ATH_AH_DECODE_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_devid.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_devid.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_devid.h,v 1.4 2008/10/06 18:32:46 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_DEVID_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom.h,v 1.11 2008/11/27 22:32:48 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_EEPROM_H_ #define _ATH_AH_EEPROM_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v1.c,v 1.1 2008/11/11 02:40:11 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v1.h,v 1.1 2008/11/11 02:40:11 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_EEPROM_V1_H_ #define _ATH_AH_EEPROM_V1_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v3.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v3.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v3.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v3.h,v 1.2 2008/11/10 04:08:00 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_EEPROM_V3_H_ #define _ATH_AH_EEPROM_V3_H_ Modified: stable/8/sys/dev/ath/ath_hal/ah_soc.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_soc.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ah_soc.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_soc.h,v 1.4 2008/11/10 04:08:00 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AH_SOC_H_ #define _ATH_AH_SOC_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210_beacon.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210_keycache.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_power.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210_power.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210_recv.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210desc.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210desc.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210desc.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210desc.h,v 1.5 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5210DESC_H #define _DEV_ATH_AR5210DESC_H Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210phy.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210phy.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210phy.h,v 1.4 2008/11/10 01:19:37 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5210PHY_H #define _DEV_ATH_AR5210PHY_H Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5210reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5210reg.h,v 1.4 2008/11/10 01:19:37 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5210REG_H #define _DEV_ATH_AR5210REG_H Modified: stable/8/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5k_0007.ini,v 1.2 2008/11/10 01:19:37 sam Exp $ + * $FreeBSD$ */ /* crete register init */ Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_beacon.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_keycache.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_power.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_power.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211_recv.c,v 1.4 2008/11/10 04:08:02 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211desc.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211desc.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211desc.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211desc.h,v 1.5 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5211DESC_H #define _DEV_ATH_AR5211DESC_H Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211phy.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211phy.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211phy.h,v 1.4 2008/11/10 01:19:38 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5211PHY_H #define _DEV_ATH_AR5211PHY_H Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211reg.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211reg.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5211reg.h,v 1.4 2008/11/10 01:19:38 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5211REG_H #define _DEV_ATH_AR5211REG_H Modified: stable/8/sys/dev/ath/ath_hal/ar5211/boss.ini ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/boss.ini Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5211/boss.ini Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: boss.ini,v 1.3 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ /* Auto Generated PCI Register Writes. Created: 09/12/02 */ Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.ini ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.ini Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.ini Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212.ini,v 1.3 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ /* Auto Generated PCI Register Writes. Created: 09/01/04 */ Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_beacon.c,v 1.6 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_eeprom.c,v 1.6 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_keycache.c,v 1.4 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212desc.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212desc.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212desc.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212desc.h,v 1.4 2008/11/10 04:08:03 sam Exp $ + * $FreeBSD$ */ #ifndef _ATH_AR5212_DESC_H_ #define _ATH_AR5212_DESC_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212phy.h,v 1.7 2008/11/19 21:23:01 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5212PHY_H_ #define _DEV_ATH_AR5212PHY_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5311reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5311reg.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5311reg.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5311reg.h,v 1.3 2008/10/06 18:32:50 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5311REG_H_ #define _DEV_ATH_AR5311REG_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_eeprom.c,v 1.4 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_interrupts.c,v 1.2 2008/11/10 01:19:39 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_misc.c,v 1.4 2008/11/22 07:40:15 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_power.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_power.c Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312_power.c Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312_power.c,v 1.4 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312phy.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312phy.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312phy.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312phy.h,v 1.3 2008/10/06 18:32:50 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5312PHY_H_ #define _DEV_ATH_AR5312PHY_H_ Modified: stable/8/sys/dev/ath/ath_hal/ar5312/ar5312reg.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5312/ar5312reg.h Thu Jun 10 20:40:38 2010 (r209013) +++ stable/8/sys/dev/ath/ath_hal/ar5312/ar5312reg.h Thu Jun 10 20:51:13 2010 (r209014) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5312reg.h,v 1.4 2008/11/10 04:08:04 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_AR5312REG_H_ #define _DEV_ATH_AR5312REG_H_ From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 10 20:54: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 EA5401065678; Thu, 10 Jun 2010 20:54:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF4468FC17; Thu, 10 Jun 2010 20:54: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 o5AKsrni062950; Thu, 10 Jun 2010 20:54:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKsrsJ062948; Thu, 10 Jun 2010 20:54:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006102054.o5AKsrsJ062948@svn.freebsd.org> From: Rui Paulo Date: Thu, 10 Jun 2010 20:54: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: r209015 - stable/8/sys/dev/ath/ath_hal 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, 10 Jun 2010 20:54:54 -0000 Author: rpaulo Date: Thu Jun 10 20:54:53 2010 New Revision: 209015 URL: http://svn.freebsd.org/changeset/base/209015 Log: MFC r208642: Don't shadow the global variable 'version'. Submitted by: Arnaud Lacombe Approved by: re (kensmith) Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Thu Jun 10 20:51:13 2010 (r209014) +++ stable/8/sys/dev/ath/ath_hal/ah_eeprom_v1.c Thu Jun 10 20:54:53 2010 (r209015) @@ -112,7 +112,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a { HAL_EEPROM_v1 *ee = AH_PRIVATE(ah)->ah_eeprom; uint16_t athvals[AR_EEPROM_ATHEROS_MAX]; /* XXX off stack */ - uint16_t protect, version, eeval; + uint16_t protect, eeprom_version, eeval; uint32_t sum; int i, loc; @@ -138,18 +138,18 @@ ath_hal_v1EepromAttach(struct ath_hal *a HALDEBUG(ah, HAL_DEBUG_ATTACH, "EEPROM protect 0x%x\n", protect); /* XXX check proper access before continuing */ - if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &version)) { + if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &eeprom_version)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unable to read EEPROM version\n", __func__); return HAL_EEREAD; } - if (((version>>12) & 0xf) != 1) { + if (((eeprom_version>>12) & 0xf) != 1) { /* * This code only groks the version 1 EEPROM layout. */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unsupported EEPROM version 0x%x found\n", - __func__, version); + __func__, eeprom_version); return HAL_EEVERSION; } @@ -183,7 +183,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a return HAL_ENOMEM; } - ee->ee_version = version; + ee->ee_version = eeprom_version; ee->ee_protect = protect; ee->ee_antenna = athvals[2]; ee->ee_biasCurrents = athvals[3]; @@ -243,7 +243,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a } AH_PRIVATE(ah)->ah_eeprom = ee; - AH_PRIVATE(ah)->ah_eeversion = version; + AH_PRIVATE(ah)->ah_eeversion = eeprom_version; AH_PRIVATE(ah)->ah_eepromDetach = v1EepromDetach; AH_PRIVATE(ah)->ah_eepromGet = v1EepromGet; AH_PRIVATE(ah)->ah_eepromSet = v1EepromSet; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 02:24:10 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 789C9106567D; Fri, 11 Jun 2010 02:24:10 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id E57718FC1E; Fri, 11 Jun 2010 02:24:09 +0000 (UTC) Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.44]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id o5B1kPQQ062423 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 11 Jun 2010 11:16:30 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <201006102034.o5AKYMXX058081@svn.freebsd.org> Date: Fri, 11 Jun 2010 11:16:24 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: <3BE36947-BCB4-4A6D-9040-873CFD144F3B@gsoft.com.au> References: <201006102034.o5AKYMXX058081@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1078) X-Spam-Score: -2.51 () ALL_TRUSTED,BAYES_00,T_RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 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: r209011 - stable/8/sys/dev/ath/ath_hal/ar5211 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, 11 Jun 2010 02:24:10 -0000 On 11/06/2010, at 6:04, Rui Paulo wrote: > Log: > MFC r208644: > Due to the way HALDEBUG() is defined, we need to add curly brackets > when using it as a sole if clause instruction. > While there, fix 'const static' typo. Why not fix HALDEBUG? ie wrap it in do { } while (0) Although that said when I looked at HALDEBUG on 8.0 it was defined as a = function so it is a non issue there. HAL_DEBUG is different but I can't actually find where that is defined. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 03:13: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 B3A43106564A; Fri, 11 Jun 2010 03:13:21 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A16B98FC0A; Fri, 11 Jun 2010 03:13: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 o5B3DKrn048456; Fri, 11 Jun 2010 03:13:20 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5B3DKhQ048446; Fri, 11 Jun 2010 03:13:20 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201006110313.o5B3DKhQ048446@svn.freebsd.org> From: Randall Stewart Date: Fri, 11 Jun 2010 03:13:20 +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: r209028 - stable/8/sys/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, 11 Jun 2010 03:13:21 -0000 Author: rrs Date: Fri Jun 11 03:13:19 2010 New Revision: 209028 URL: http://svn.freebsd.org/changeset/base/209028 Log: MFC: Fix a number of bugs and race conditions. r208160: Bring back of the iterator thread. It now properly handles VNETS having only one thread. The old timer based code was full of LOR's and other issues. r208852: Cleanup bug. Basically when an un-accepted socket was hanging on a closed listener, we would leak the inp never cleaning it up r208853: Enhance the use under invarients of the audit for locks function and fix a bug where a close collision with a cookie being processed would cause a crash. r208854: Use the proper increment macros when working with the sent_queue_retran_cnt r208855: Align comments properly, Fix a bug where we were NOT looking at the resend markings for control chunks and also not decrementing the retran count which caused extra calls to retransmission. Alos add a valid no locks call to the output routine. r208856: Spacing issues in auth/bsd addr. r208857: Get rid of a windows ifdef that somehow leaked in r208863: Missing error leg returns in some failure cases r208864: LOR fix between the iterator and sctp_inpcb_close r208874: Don't call the sctp_inpcb_free from abort an association since you don't know what locks you hold and a timer will take care of the situation when the gone flag is set r208875: sctp_inpcb_free bug - a socket under the right situation could get stuck (from the accept queue) and never start the proper cleanup timer) r208876: Further enhance invariant lock validation, Fix a bug where a closed socket and a INIT-ACK could collide and cause a crash r208878: Clear up another bug in sctp_inpcb_free where we would end up due to a race in freeing hit a destroy of a contended lock. r208879: Optimize the cleanup and make some additional fixes in the sysctl code so that it won't reference a GONE INP and crash us r208883 & r208891: Fix so we don't open a hole between a sock lock and a call to socantrcvmore.. we could before hit a race that would kill the socket underneath us leading to a crash r208897: CUM-ACK calculation was messed up. So basically large message got broken from the original NR_sack integration. r208902: Make sure that we don't move a bit to the NR array that is behind the cum-ack r208952: Use both bit maps to calculte the cum-ack. r208953: Fix bug having to do with freeing an sctp_inpcb_free(). 1) make sure not to remove the flag until you get the lock again. 2) make sure all log_closing calls hold the lock. 3) Release all the locks when everthing is done and call callout_drain not callout_stop.. r208970: Fix some places on user allocation of a new sctp_inpcb where we run out of resource that we make sure to NULL the so_pcb pointer. Approved by: re - (bz@freebsd.org) Modified: stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_bsd_addr.h stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_lock_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.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/geom/sched/ (props changed) Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_auth.c Fri Jun 11 03:13:19 2010 (r209028) @@ -895,9 +895,9 @@ static inline int sctp_get_hmac_block_len(uint16_t hmac_algo) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: #ifdef HAVE_SHA224 - case SCTP_AUTH_HMAC_ID_SHA224: + case SCTP_AUTH_HMAC_ID_SHA224: #endif return (64); #ifdef HAVE_SHA2 @@ -918,7 +918,7 @@ static void sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t * ctx) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Init(&ctx->sha1); break; #ifdef HAVE_SHA224 @@ -948,7 +948,7 @@ sctp_hmac_update(uint16_t hmac_algo, sct uint8_t * text, uint32_t textlen) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Update(&ctx->sha1, text, textlen); break; #ifdef HAVE_SHA224 @@ -978,7 +978,7 @@ sctp_hmac_final(uint16_t hmac_algo, sctp uint8_t * digest) { switch (hmac_algo) { - case SCTP_AUTH_HMAC_ID_SHA1: + case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Final(digest, &ctx->sha1); break; #ifdef HAVE_SHA224 Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Jun 11 03:13:19 2010 (r209028) @@ -49,16 +49,6 @@ __FBSDID("$FreeBSD$"); #include /* Declare all of our malloc named types */ - -/* Note to Michael/Peter for mac-os, - * I think mac has this too since I - * do see the M_PCB type, so I - * will also put in the mac file the - * MALLOC_DECLARE. If this does not - * work for mac uncomment the defines for - * the strings that we use in Panda, I put - * them in comments in the mac-os file. - */ MALLOC_DEFINE(SCTP_M_MAP, "sctp_map", "sctp asoc map descriptor"); MALLOC_DEFINE(SCTP_M_STRMI, "sctp_stri", "sctp stream in array"); MALLOC_DEFINE(SCTP_M_STRMO, "sctp_stro", "sctp stream out array"); @@ -79,47 +69,77 @@ MALLOC_DEFINE(SCTP_M_MVRF, "sctp_mvrf", MALLOC_DEFINE(SCTP_M_ITER, "sctp_iter", "sctp iterator control"); MALLOC_DEFINE(SCTP_M_SOCKOPT, "sctp_socko", "sctp socket option"); -#if defined(SCTP_USE_THREAD_BASED_ITERATOR) +/* Global NON-VNET structure that controls the iterator */ +struct iterator_control sctp_it_ctl; +static int __sctp_thread_based_iterator_started = 0; + + +static void +sctp_cleanup_itqueue(void) +{ + struct sctp_iterator *it; + + while ((it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead)) != NULL) { + if (it->function_atend != NULL) { + (*it->function_atend) (it->pointer, it->val); + } + TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); + SCTP_FREE(it, SCTP_M_ITER); + } +} + + void sctp_wakeup_iterator(void) { - wakeup(&SCTP_BASE_INFO(iterator_running)); + wakeup(&sctp_it_ctl.iterator_running); } static void sctp_iterator_thread(void *v) { - CURVNET_SET((struct vnet *)v); SCTP_IPI_ITERATOR_WQ_LOCK(); - SCTP_BASE_INFO(iterator_running) = 0; while (1) { - msleep(&SCTP_BASE_INFO(iterator_running), - &SCTP_BASE_INFO(ipi_iterator_wq_mtx), + msleep(&sctp_it_ctl.iterator_running, + &sctp_it_ctl.ipi_iterator_wq_mtx, 0, "waiting_for_work", 0); - if (SCTP_BASE_INFO(threads_must_exit)) { + if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_MUST_EXIT) { SCTP_IPI_ITERATOR_WQ_DESTROY(); + SCTP_ITERATOR_LOCK_DESTROY(); + sctp_cleanup_itqueue(); + __sctp_thread_based_iterator_started = 0; kthread_exit(); } sctp_iterator_worker(); } - CURVNET_RESTORE(); } void sctp_startup_iterator(void) { + if (__sctp_thread_based_iterator_started) { + /* You only get one */ + return; + } + /* init the iterator head */ + __sctp_thread_based_iterator_started = 1; + sctp_it_ctl.iterator_running = 0; + sctp_it_ctl.iterator_flags = 0; + sctp_it_ctl.cur_it = NULL; + SCTP_ITERATOR_LOCK_INIT(); + SCTP_IPI_ITERATOR_WQ_INIT(); + TAILQ_INIT(&sctp_it_ctl.iteratorhead); + int ret; ret = kproc_create(sctp_iterator_thread, - (void *)curvnet, - &SCTP_BASE_INFO(thread_proc), + (void *)NULL, + &sctp_it_ctl.thread_proc, RFPROC, SCTP_KTHREAD_PAGES, SCTP_KTRHEAD_NAME); } -#endif - #ifdef INET6 void Modified: stable/8/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.h Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_bsd_addr.h Fri Jun 11 03:13:19 2010 (r209028) @@ -37,12 +37,11 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) -#if defined(SCTP_USE_THREAD_BASED_ITERATOR) +extern struct iterator_control sctp_it_ctl; void sctp_wakeup_iterator(void); void sctp_startup_iterator(void); -#endif #ifdef INET6 void sctp_gather_internal_ifa_flags(struct sctp_ifa *ifa); Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_constants.h Fri Jun 11 03:13:19 2010 (r209028) @@ -87,10 +87,6 @@ __FBSDID("$FreeBSD$"); /* #define SCTP_AUDITING_ENABLED 1 used for debug/auditing */ #define SCTP_AUDIT_SIZE 256 -/* temporary disabled since it does not work with VNET. */ -#if 0 -#define SCTP_USE_THREAD_BASED_ITERATOR 1 -#endif #define SCTP_KTRHEAD_NAME "sctp_iterator" #define SCTP_KTHREAD_PAGES 0 @@ -572,7 +568,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_TIMER_TYPE_EVENTWAKE 13 #define SCTP_TIMER_TYPE_STRRESET 14 #define SCTP_TIMER_TYPE_INPKILL 15 -#define SCTP_TIMER_TYPE_ITERATOR 16 #define SCTP_TIMER_TYPE_EARLYFR 17 #define SCTP_TIMER_TYPE_ASOCKILL 18 #define SCTP_TIMER_TYPE_ADDR_WQ 19 @@ -899,7 +894,7 @@ __FBSDID("$FreeBSD$"); /* third argument */ #define SCTP_CALLED_DIRECTLY_NOCMPSET 0 #define SCTP_CALLED_AFTER_CMPSET_OFCLOSE 1 - +#define SCTP_CALLED_FROM_INPKILL_TIMER 2 /* second argument */ #define SCTP_FREE_SHOULD_USE_ABORT 1 #define SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE 0 Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_indata.c Fri Jun 11 03:13:19 2010 (r209028) @@ -289,12 +289,20 @@ sctp_build_ctl_cchunk(struct sctp_inpcb static void sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn) { - uint32_t gap, i; + uint32_t gap, i, cumackp1; int fnd = 0; if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { return; } + cumackp1 = asoc->cumulative_tsn + 1; + if (compare_with_wrap(cumackp1, tsn, MAX_TSN)) { + /* + * this tsn is behind the cum ack and thus we don't need to + * worry about it being moved from one to the other. + */ + return; + } SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { printf("gap:%x tsn:%x\n", gap, tsn); @@ -2245,15 +2253,19 @@ sctp_slide_mapping_arrays(struct sctp_tc /* * Now we also need to check the mapping array in a couple of ways. * 1) Did we move the cum-ack point? + * + * When you first glance at this you might think that all entries that + * make up the postion of the cum-ack would be in the nr-mapping + * array only.. i.e. things up to the cum-ack are always + * deliverable. Thats true with one exception, when its a fragmented + * message we may not deliver the data until some threshold (or all + * of it) is in place. So we must OR the nr_mapping_array and + * mapping_array to get a true picture of the cum-ack. */ struct sctp_association *asoc; int at; + uint8_t val; int slide_from, slide_end, lgap, distance; - - /* EY nr_mapping array variables */ - /* int nr_at; */ - /* int nr_last_all_ones = 0; */ - /* int nr_slide_from, nr_slide_end, nr_lgap, nr_distance; */ uint32_t old_cumack, old_base, old_highest, highest_tsn; asoc = &stcb->asoc; @@ -2268,11 +2280,12 @@ sctp_slide_mapping_arrays(struct sctp_tc */ at = 0; for (slide_from = 0; slide_from < stcb->asoc.mapping_array_size; slide_from++) { - if (asoc->nr_mapping_array[slide_from] == 0xff) { + val = asoc->nr_mapping_array[slide_from] | asoc->mapping_array[slide_from]; + if (val == 0xff) { at += 8; } else { /* there is a 0 bit */ - at += sctp_map_lookup_tab[asoc->nr_mapping_array[slide_from]]; + at += sctp_map_lookup_tab[val]; break; } } @@ -3849,7 +3862,8 @@ sctp_window_probe_recovery(struct sctp_t sctp_total_flight_decrease(stcb, tp1); /* Now mark for resend */ tp1->sent = SCTP_DATAGRAM_RESEND; - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP, tp1->whoTo->flight_size, @@ -4262,7 +4276,7 @@ again: sctp_flight_size_increase(tp1); sctp_total_flight_increase(stcb, tp1); } else if (tp1->sent == SCTP_DATAGRAM_RESEND) { - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); } } } @@ -5263,7 +5277,7 @@ again: sctp_flight_size_increase(tp1); sctp_total_flight_increase(stcb, tp1); } else if (tp1->sent == SCTP_DATAGRAM_RESEND) { - asoc->sent_queue_retran_cnt++; + sctp_ucount_incr(asoc->sent_queue_retran_cnt); } } } Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_input.c Fri Jun 11 03:13:19 2010 (r209028) @@ -3067,7 +3067,7 @@ process_chunk_drop(struct sctp_tcb *stcb struct sctp_nets *net, uint8_t flg) { switch (desc->chunk_type) { - case SCTP_DATA: + case SCTP_DATA: /* find the tsn to resend (possibly */ { uint32_t tsn; @@ -4534,7 +4534,8 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { - if (locked_tcb) { + if (locked_tcb != stcb) { + /* Very unlikely */ SCTP_TCB_UNLOCK(locked_tcb); } *offset = length; @@ -4861,6 +4862,10 @@ process_control_chunks: } else { if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ + abend: + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } *offset = length; return (NULL); } @@ -4908,6 +4913,11 @@ process_control_chunks: if (linp) { SCTP_ASOC_CREATE_LOCK(linp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { + SCTP_ASOC_CREATE_UNLOCK(linp); + goto abend; + } } if (netp) { ret_buf = @@ -5408,16 +5418,25 @@ sctp_process_ecn_marked_b(struct sctp_tc } #ifdef INVARIANTS -static void -sctp_validate_no_locks(struct sctp_inpcb *inp) +#ifdef __GNUC__ +__attribute__((noinline)) +#endif + void + sctp_validate_no_locks(struct sctp_inpcb *inp) { - struct sctp_tcb *stcb; + struct sctp_tcb *lstcb; - LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { - if (mtx_owned(&stcb->tcb_mtx)) { + LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) { + if (mtx_owned(&lstcb->tcb_mtx)) { panic("Own lock on stcb at return from input"); } } + if (mtx_owned(&inp->inp_create_mtx)) { + panic("Own create lock on inp"); + } + if (mtx_owned(&inp->inp_mtx)) { + panic("Own inp lock on inp"); + } } #endif Modified: stable/8/sys/netinet/sctp_lock_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_lock_bsd.h Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_lock_bsd.h Fri Jun 11 03:13:19 2010 (r209028) @@ -107,42 +107,36 @@ extern int sctp_logoff_stuff; #define SCTP_INP_INFO_WUNLOCK() rw_wunlock(&SCTP_BASE_INFO(ipi_ep_mtx)) -#define SCTP_IPI_ADDR_INIT() \ +#define SCTP_IPI_ADDR_INIT() \ rw_init(&SCTP_BASE_INFO(ipi_addr_mtx), "sctp-addr") - #define SCTP_IPI_ADDR_DESTROY() do { \ if(rw_wowned(&SCTP_BASE_INFO(ipi_addr_mtx))) { \ rw_wunlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } \ rw_destroy(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } while (0) - - - #define SCTP_IPI_ADDR_RLOCK() do { \ rw_rlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } while (0) - #define SCTP_IPI_ADDR_WLOCK() do { \ rw_wlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \ } while (0) - #define SCTP_IPI_ADDR_RUNLOCK() rw_runlock(&SCTP_BASE_INFO(ipi_addr_mtx)) #define SCTP_IPI_ADDR_WUNLOCK() rw_wunlock(&SCTP_BASE_INFO(ipi_addr_mtx)) #define SCTP_IPI_ITERATOR_WQ_INIT() \ - mtx_init(&SCTP_BASE_INFO(ipi_iterator_wq_mtx), "sctp-it-wq", "sctp_it_wq", MTX_DEF) + mtx_init(&sctp_it_ctl.ipi_iterator_wq_mtx, "sctp-it-wq", "sctp_it_wq", MTX_DEF) #define SCTP_IPI_ITERATOR_WQ_DESTROY() \ - mtx_destroy(&SCTP_BASE_INFO(ipi_iterator_wq_mtx)) + mtx_destroy(&sctp_it_ctl.ipi_iterator_wq_mtx) #define SCTP_IPI_ITERATOR_WQ_LOCK() do { \ - mtx_lock(&SCTP_BASE_INFO(ipi_iterator_wq_mtx)); \ + mtx_lock(&sctp_it_ctl.ipi_iterator_wq_mtx); \ } while (0) -#define SCTP_IPI_ITERATOR_WQ_UNLOCK() mtx_unlock(&SCTP_BASE_INFO(ipi_iterator_wq_mtx)) +#define SCTP_IPI_ITERATOR_WQ_UNLOCK() mtx_unlock(&sctp_it_ctl.ipi_iterator_wq_mtx) #define SCTP_IP_PKTLOG_INIT() \ @@ -191,6 +185,13 @@ extern int sctp_logoff_stuff; #define SCTP_INP_LOCK_DESTROY(_inp) \ mtx_destroy(&(_inp)->inp_mtx) +#define SCTP_INP_LOCK_CONTENDED(_inp) ((_inp)->inp_mtx.mtx_lock & MTX_CONTESTED) + +#define SCTP_INP_READ_CONTENDED(_inp) ((_inp)->inp_rdata_mtx.mtx_lock & MTX_CONTESTED) + +#define SCTP_ASOC_CREATE_LOCK_CONTENDED(_inp) ((_inp)->inp_create_mtx.mtx_lock & MTX_CONTESTED) + + #define SCTP_ASOC_CREATE_LOCK_DESTROY(_inp) \ mtx_destroy(&(_inp)->inp_create_mtx) @@ -300,25 +301,45 @@ extern int sctp_logoff_stuff; #endif #define SCTP_ITERATOR_LOCK_INIT() \ - mtx_init(&SCTP_BASE_INFO(it_mtx), "sctp-it", "iterator", MTX_DEF) + mtx_init(&sctp_it_ctl.it_mtx, "sctp-it", "iterator", MTX_DEF) #ifdef INVARIANTS #define SCTP_ITERATOR_LOCK() \ do { \ - if (mtx_owned(&SCTP_BASE_INFO(it_mtx))) \ + if (mtx_owned(&sctp_it_ctl.it_mtx)) \ panic("Iterator Lock"); \ - mtx_lock(&SCTP_BASE_INFO(it_mtx)); \ + mtx_lock(&sctp_it_ctl.it_mtx); \ } while (0) #else #define SCTP_ITERATOR_LOCK() \ do { \ - mtx_lock(&SCTP_BASE_INFO(it_mtx)); \ + mtx_lock(&sctp_it_ctl.it_mtx); \ } while (0) #endif -#define SCTP_ITERATOR_UNLOCK() mtx_unlock(&SCTP_BASE_INFO(it_mtx)) -#define SCTP_ITERATOR_LOCK_DESTROY() mtx_destroy(&SCTP_BASE_INFO(it_mtx)) +#define SCTP_ITERATOR_UNLOCK() mtx_unlock(&sctp_it_ctl.it_mtx) +#define SCTP_ITERATOR_LOCK_DESTROY() mtx_destroy(&sctp_it_ctl.it_mtx) + + +#define SCTP_WQ_ADDR_INIT() do { \ + mtx_init(&SCTP_BASE_INFO(wq_addr_mtx), "sctp-addr-wq","sctp_addr_wq",MTX_DEF); \ + } while (0) + +#define SCTP_WQ_ADDR_DESTROY() do { \ + if(mtx_owned(&SCTP_BASE_INFO(wq_addr_mtx))) { \ + mtx_unlock(&SCTP_BASE_INFO(wq_addr_mtx)); \ + } \ + mtx_destroy(&SCTP_BASE_INFO(wq_addr_mtx)); \ + } while (0) + +#define SCTP_WQ_ADDR_LOCK() do { \ + mtx_lock(&SCTP_BASE_INFO(wq_addr_mtx)); \ +} while (0) +#define SCTP_WQ_ADDR_UNLOCK() do { \ + mtx_unlock(&SCTP_BASE_INFO(wq_addr_mtx)); \ +} while (0) + #define SCTP_INCR_EP_COUNT() \ Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_output.c Fri Jun 11 03:13:19 2010 (r209028) @@ -3053,32 +3053,32 @@ sctp_source_address_selection(struct sct * it out * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz * For V4 - *------------------------------------------ + * ------------------------------------------ * source * dest * result * ----------------------------------------- * Private * Global * NAT * ----------------------------------------- * Private * Private * No problem * ----------------------------------------- - * Global * Private * Huh, How will this work? + * Global * Private * Huh, How will this work? * ----------------------------------------- - * Global * Global * No Problem - *------------------------------------------ + * Global * Global * No Problem + *------------------------------------------ * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz * For V6 - *------------------------------------------ + *------------------------------------------ * source * dest * result * ----------------------------------------- * Linklocal * Global * * ----------------------------------------- * Linklocal * Linklocal * No problem * ----------------------------------------- - * Global * Linklocal * Huh, How will this work? + * Global * Linklocal * Huh, How will this work? * ----------------------------------------- - * Global * Global * No Problem - *------------------------------------------ + * Global * Global * No Problem + *------------------------------------------ * zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz - * + * * And then we add to that what happens if there are multiple addresses * assigned to an interface. Remember the ifa on a ifn is a linked * list of addresses. So one interface can have more than one IP @@ -3091,13 +3091,13 @@ sctp_source_address_selection(struct sct * Decisions: * * - count the number of addresses on the interface. - * - if it is one, no problem except case . - * For we will assume a NAT out there. + * - if it is one, no problem except case . + * For we will assume a NAT out there. * - if there are more than one, then we need to worry about scope P * or G. We should prefer G -> G and P -> P if possible. * Then as a secondary fall back to mixed types G->P being a last * ditch one. - * - The above all works for bound all, but bound specific we need to + * - The above all works for bound all, but bound specific we need to * use the same concept but instead only consider the bound * addresses. If the bound set is NOT assigned to the interface then * we must use rotation amongst the bound addresses.. @@ -8913,6 +8913,9 @@ sctp_chunk_retransmission(struct sctp_in if ((chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) || (chk->rec.chunk_id.id == SCTP_STREAM_RESET) || (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN)) { + if (chk->sent != SCTP_DATAGRAM_RESEND) { + continue; + } if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { if (chk != asoc->str_reset) { /* @@ -8973,7 +8976,7 @@ sctp_chunk_retransmission(struct sctp_in /* (void)SCTP_GETTIME_TIMEVAL(&chk->whoTo->last_sent_time); */ *cnt_out += 1; chk->sent = SCTP_DATAGRAM_SENT; - /* sctp_ucount_decr(asoc->sent_queue_retran_cnt); */ + sctp_ucount_decr(stcb->asoc.sent_queue_retran_cnt); if (fwd_tsn == 0) { return (0); } else { @@ -13427,6 +13430,13 @@ out_unlocked: } } #endif +#ifdef INVARIANTS + if (inp) { + sctp_validate_no_locks(inp); + } else { + printf("Warning - inp is NULL so cant validate locks\n"); + } +#endif if (top) { sctp_m_freem(top); } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Jun 11 03:00:48 2010 (r209027) +++ stable/8/sys/netinet/sctp_pcb.c Fri Jun 11 03:13:19 2010 (r209028) @@ -692,13 +692,11 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = sctp_ifap; wi->action = SCTP_ADD_IP_ADDRESS; - SCTP_IPI_ITERATOR_WQ_LOCK(); - /* - * Should this really be a tailq? As it is we will process - * the newest first :-0 - */ + + SCTP_WQ_ADDR_LOCK(); LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_IPI_ITERATOR_WQ_UNLOCK(); + SCTP_WQ_ADDR_UNLOCK(); + sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, @@ -806,13 +804,13 @@ out_now: (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = sctp_ifap; wi->action = SCTP_DEL_IP_ADDRESS; - SCTP_IPI_ITERATOR_WQ_LOCK(); + SCTP_WQ_ADDR_LOCK(); /* * Should this really be a tailq? As it is we will process * the newest first :-0 */ LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_IPI_ITERATOR_WQ_UNLOCK(); + SCTP_WQ_ADDR_UNLOCK(); sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, @@ -2298,7 +2296,7 @@ sctp_inpcb_alloc(struct socket *so, uint if (inp->sctp_asocidhash == NULL) { SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_INP_INFO_WUNLOCK(); - return error; + return (ENOBUFS); } #ifdef IPSEC { @@ -2340,6 +2338,7 @@ sctp_inpcb_alloc(struct socket *so, uint * in protosw */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EOPNOTSUPP); + so->so_pcb = NULL; SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (EOPNOTSUPP); } @@ -2358,6 +2357,7 @@ sctp_inpcb_alloc(struct socket *so, uint if (inp->sctp_tcbhash == NULL) { SCTP_PRINTF("Out of SCTP-INPCB->hashinit - no resources\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS); + so->so_pcb = NULL; SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (ENOBUFS); } @@ -3017,57 +3017,68 @@ continue_anyway: static void -sctp_iterator_inp_being_freed(struct sctp_inpcb *inp, struct sctp_inpcb *inp_next) +sctp_iterator_inp_being_freed(struct sctp_inpcb *inp) { - struct sctp_iterator *it; + struct sctp_iterator *it, *nit; /* * We enter with the only the ITERATOR_LOCK in place and a write * lock on the inp_info stuff. */ - + it = sctp_it_ctl.cur_it; + if (it && (it->vn != curvnet)) { + /* Its not looking at our VNET */ + return; + } + if (it && (it->inp == inp)) { + /* + * This is tricky and we hold the iterator lock, but when it + * returns and gets the lock (when we release it) the + * iterator will try to operate on inp. We need to stop that + * from happening. But of course the iterator has a + * reference on the stcb and inp. We can mark it and it will + * stop. + * + * If its a single iterator situation, we set the end iterator + * flag. Otherwise we set the iterator to go to the next + * inp. + * + */ + if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { + sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT; + } else { + sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_INP; + } + } /* - * Go through all iterators, we must do this since it is possible - * that some iterator does NOT have the lock, but is waiting for it. - * And the one that had the lock has either moved in the last - * iteration or we just cleared it above. We need to find all of - * those guys. The list of iterators should never be very big - * though. - */ - TAILQ_FOREACH(it, &SCTP_BASE_INFO(iteratorhead), sctp_nxt_itr) { - if (it == inp->inp_starting_point_for_iterator) - /* skip this guy, he's special */ + * Now go through and remove any single reference to our inp that + * may be still pending on the list + */ + SCTP_IPI_ITERATOR_WQ_LOCK(); + it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead); + while (it) { + nit = TAILQ_NEXT(it, sctp_nxt_itr); + if (it->vn != curvnet) { + it = nit; continue; + } if (it->inp == inp) { - /* - * This is tricky and we DON'T lock the iterator. - * Reason is he's running but waiting for me since - * inp->inp_starting_point_for_iterator has the lock - * on me (the guy above we skipped). This tells us - * its is not running but waiting for - * inp->inp_starting_point_for_iterator to be - * released by the guy that does have our INP in a - * lock. - */ + /* This one points to me is it inp specific? */ if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { - it->inp = NULL; - it->stcb = NULL; + /* Remove and free this one */ + TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, + it, sctp_nxt_itr); + if (it->function_atend != NULL) { + (*it->function_atend) (it->pointer, it->val); + } + SCTP_FREE(it, SCTP_M_ITER); } else { - /* set him up to do the next guy not me */ - it->inp = inp_next; - it->stcb = NULL; + it->inp = LIST_NEXT(it->inp, sctp_list); } } + it = nit; } - it = inp->inp_starting_point_for_iterator; - if (it) { - if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { - it->inp = NULL; - } else { - it->inp = inp_next; - } - it->stcb = NULL; - } + SCTP_IPI_ITERATOR_WQ_UNLOCK(); } /* release sctp_inpcb unbind the port */ @@ -3083,12 +3094,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, * all associations. d) finally the ep itself. */ struct sctp_pcb *m; - struct sctp_inpcb *inp_save; struct sctp_tcb *asoc, *nasoc; struct sctp_laddr *laddr, *nladdr; struct inpcb *ip_pcb; struct socket *so; - + int being_refed = 0; struct sctp_queued_to_read *sq; @@ -3099,12 +3109,21 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 0); #endif - SCTP_ITERATOR_LOCK(); + if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { + /* + * Once we are in we can remove the flag from = 1 is only + * passed from the actual closing routines that are called + * via the sockets layer. + */ + SCTP_ITERATOR_LOCK(); + /* mark any iterators on the list or being processed */ + sctp_iterator_inp_being_freed(inp); + SCTP_ITERATOR_UNLOCK(); + } so = inp->sctp_socket; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { /* been here before.. eeks.. get out of here */ SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 1); #endif @@ -3114,19 +3133,15 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(inp); - /* First time through we have the socket lock, after that no more. */ if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { - /* - * Once we are in we can remove the flag from = 1 is only - * passed from the actual closing routines that are called - * via the sockets layer. - */ inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; /* socket is gone, so no more wakeups allowed */ inp->sctp_flags |= SCTP_PCB_FLAGS_DONT_WAKE; inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT; inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT; + } + /* First time through we have the socket lock, after that no more. */ sctp_timer_stop(SCTP_TIMER_TYPE_NEWCOOKIE, inp, NULL, NULL, SCTP_FROM_SCTP_PCB + SCTP_LOC_1); @@ -3152,8 +3167,17 @@ sctp_inpcb_free(struct sctp_inpcb *inp, nasoc = LIST_NEXT(asoc, sctp_tcblist); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { /* Skip guys being freed */ - /* asoc->sctp_socket = NULL; FIXME MT */ cnt_in_sd++; + if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { + /* + * Special case - we did not start a + * kill timer on the asoc due to it + * was not closed. So go ahead and + * start it now. + */ + asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); + } SCTP_TCB_UNLOCK(asoc); continue; } @@ -3314,14 +3338,13 @@ sctp_inpcb_free(struct sctp_inpcb *inp, } /* now is there some left in our SHUTDOWN state? */ if (cnt_in_sd) { - SCTP_INP_WUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 2); #endif inp->sctp_socket = NULL; + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return; } } @@ -3344,6 +3367,10 @@ sctp_inpcb_free(struct sctp_inpcb *inp, asoc = nasoc) { nasoc = LIST_NEXT(asoc, sctp_tcblist); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { + asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); + } cnt++; continue; } @@ -3392,38 +3419,62 @@ sctp_inpcb_free(struct sctp_inpcb *inp, if (cnt) { /* Ok we have someone out there that will kill us */ (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); - SCTP_INP_WUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 3); #endif + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return; } - if ((inp->refcount) || (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { + if (SCTP_INP_LOCK_CONTENDED(inp)) + being_refed++; + if (SCTP_INP_READ_CONTENDED(inp)) + being_refed++; + if (SCTP_ASOC_CREATE_LOCK_CONTENDED(inp)) + being_refed++; + + if ((inp->refcount) || + (being_refed) || + (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); +#ifdef SCTP_LOG_CLOSING + sctp_log_closing(inp, NULL, 4); +#endif sctp_timer_start(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL); SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 4); -#endif return; } - (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); inp->sctp_ep.signature_change.type = 0; inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_ALLGONE; + /* + * Remove it from the list .. last thing we need a lock for. + */ + LIST_REMOVE(inp, sctp_list); + SCTP_INP_WUNLOCK(inp); + SCTP_ASOC_CREATE_UNLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); + /* + * Now we release all locks. Since this INP cannot be found anymore + * except possbily by the kill timer that might be running. We call + * the drain function here. It should hit the case were it sees the + * ACTIVE flag cleared and exit out freeing us to proceed and + * destroy everything. + */ + if (from != SCTP_CALLED_FROM_INPKILL_TIMER) { + (void)SCTP_OS_TIMER_STOP_DRAIN(&inp->sctp_ep.signature_change.timer); + } else { + /* Probably un-needed */ + (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); + } #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 5); #endif - (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); - inp->sctp_ep.signature_change.type = SCTP_TIMER_TYPE_NONE; - /* Clear the read queue */ + if ((inp->sctp_asocidhash) != NULL) { SCTP_HASH_FREE(inp->sctp_asocidhash, inp->hashasocidmark); inp->sctp_asocidhash = NULL; @@ -3494,11 +3545,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, shared_key = LIST_FIRST(&inp->sctp_ep.shared_keys); } - inp_save = LIST_NEXT(inp, sctp_list); - LIST_REMOVE(inp, sctp_list); - - /* fix any iterators only after out of the list */ - sctp_iterator_inp_being_freed(inp, inp_save); /* * if we have an address list the following will free the list of * ifaddr's that are set into this ep. Again macro limitations here, @@ -3531,8 +3577,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_LOCK_DESTROY(inp); SCTP_INP_READ_DESTROY(inp); SCTP_ASOC_CREATE_LOCK_DESTROY(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_ITERATOR_UNLOCK(); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_DECR_EP_COUNT(); } @@ -4581,8 +4625,12 @@ sctp_free_assoc(struct sctp_inpcb *inp, * Someone holds a reference OR the socket is unaccepted * yet. */ - if (stcb->asoc.refcnt) + if ((stcb->asoc.refcnt) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { + stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); + } SCTP_TCB_UNLOCK(stcb); if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) @@ -4645,8 +4693,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, SS_ISCONFIRMING | SS_ISCONNECTED); } - SOCK_UNLOCK(so); - socantrcvmore(so); + socantrcvmore_locked(so); sctp_sowwakeup(inp, so); sctp_sorwakeup(inp, so); SCTP_SOWAKEUP(so); @@ -5436,8 +5483,6 @@ sctp_pcb_init() /* init the empty list of (All) Endpoints */ LIST_INIT(&SCTP_BASE_INFO(listhead)); - /* init the iterator head */ - TAILQ_INIT(&SCTP_BASE_INFO(iteratorhead)); /* init the hash table of endpoints */ TUNABLE_INT_FETCH("net.inet.sctp.tcbhashsize", &SCTP_BASE_SYSCTL(sctp_hashtblsize)); @@ -5500,16 +5545,15 @@ sctp_pcb_init() /* Master Lock INIT for info structure */ SCTP_INP_INFO_LOCK_INIT(); SCTP_STATLOG_INIT_LOCK(); - SCTP_ITERATOR_LOCK_INIT(); SCTP_IPI_COUNT_INIT(); SCTP_IPI_ADDR_INIT(); - SCTP_IPI_ITERATOR_WQ_INIT(); #ifdef SCTP_PACKET_LOGGING SCTP_IP_PKTLOG_INIT(); #endif LIST_INIT(&SCTP_BASE_INFO(addr_wq)); + SCTP_WQ_ADDR_INIT(); /* not sure if we need all the counts */ SCTP_BASE_INFO(ipi_count_ep) = 0; /* assoc/tcb zone info */ @@ -5537,11 +5581,7 @@ sctp_pcb_init() LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 08:23: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 9153C10656BC; Fri, 11 Jun 2010 08:23:24 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5088FC17; Fri, 11 Jun 2010 08:23:23 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id B024811B84F; Fri, 11 Jun 2010 02:50:19 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id IQKODBH7A5DV; Fri, 11 Jun 2010 02:50:19 -0500 Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <3BE36947-BCB4-4A6D-9040-873CFD144F3B@gsoft.com.au> Date: Fri, 11 Jun 2010 08:50:16 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <7E348ECC-5F60-4788-99F5-4B8D88E3AF65@freebsd.org> References: <201006102034.o5AKYMXX058081@svn.freebsd.org> <3BE36947-BCB4-4A6D-9040-873CFD144F3B@gsoft.com.au> To: "Daniel O'Connor" X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: SPOOFED: Re: svn commit: r209011 - stable/8/sys/dev/ath/ath_hal/ar5211 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, 11 Jun 2010 08:23:24 -0000 On 11 Jun 2010, at 02:46, Daniel O'Connor wrote: >=20 > On 11/06/2010, at 6:04, Rui Paulo wrote: >> Log: >> MFC r208644: >> Due to the way HALDEBUG() is defined, we need to add curly brackets >> when using it as a sole if clause instruction. >> While there, fix 'const static' typo. >=20 > Why not fix HALDEBUG? ie wrap it in do { } while (0) >=20 > Although that said when I looked at HALDEBUG on 8.0 it was defined as = a function so it is a non issue there. >=20 > HAL_DEBUG is different but I can't actually find where that is = defined. There's actually no problem in the code. This was to shut up a compiler = warning on NetBSD. I probably should've said that in the commit log. Regards, -- Rui Paulo From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 11:24: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 27516106567B; Fri, 11 Jun 2010 11:24:24 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 164788FC1D; Fri, 11 Jun 2010 11:24: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 o5BBONKE059828; Fri, 11 Jun 2010 11:24:23 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BBON50059826; Fri, 11 Jun 2010 11:24:23 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006111124.o5BBON50059826@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 11:24: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: r209038 - stable/8/usr.bin/mail 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, 11 Jun 2010 11:24:24 -0000 Author: uqs Date: Fri Jun 11 11:24:23 2010 New Revision: 209038 URL: http://svn.freebsd.org/changeset/base/209038 Log: MFC r208592: mail(1) misses addresses when replying to all There's a parsing error for fields where addresses are not separated by space. This is often produced by MS Outlook. PR: bin/131861 Submitted by: Pete French Tested by: Pete French Reviewed by: mikeh Approved by: re (kib) Modified: stable/8/usr.bin/mail/util.c Directory Properties: stable/8/usr.bin/mail/ (props changed) Modified: stable/8/usr.bin/mail/util.c ============================================================================== --- stable/8/usr.bin/mail/util.c Fri Jun 11 09:27:33 2010 (r209037) +++ stable/8/usr.bin/mail/util.c Fri Jun 11 11:24:23 2010 (r209038) @@ -496,10 +496,11 @@ skin(name) *cp2++ = ' '; } *cp2++ = c; - if (c == ',' && *cp == ' ' && !gotlt) { + if (c == ',' && !gotlt && + (*cp == ' ' || *cp == '"' || *cp == '<')) { *cp2++ = ' '; - while (*++cp == ' ') - ; + while (*cp == ' ') + cp++; lastsp = 0; bufend = cp2; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 14:06:35 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 6FB3910656D4; Fri, 11 Jun 2010 14:06:35 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6A48FC24; Fri, 11 Jun 2010 14:06:35 +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 o5BE6Zoa096073; Fri, 11 Jun 2010 14:06:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BE6ZAP096069; Fri, 11 Jun 2010 14:06:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006111406.o5BE6ZAP096069@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 11 Jun 2010 14:06: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: r209042 - in 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: Fri, 11 Jun 2010 14:06:35 -0000 Author: nwhitehorn Date: Fri Jun 11 14:06:35 2010 New Revision: 209042 URL: http://svn.freebsd.org/changeset/base/209042 Log: MFC r208870: Some revisions of the Serverworks K2 SATA controller have a data corruption bug where if an ATA command is issued before DMA is started, data will become available to the controller before it knows what to do with it. This results in either data corruption or a controller crash. This patch remedies the problem by adopting the workaround employed by Linux and Darwin: starting the DMA engine prior to sending the ATA command. Reviewed by: mav Approved by: re (kib) Modified: stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/ata/ata-lowlevel.c stable/8/sys/dev/ata/chipsets/ata-serverworks.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Fri Jun 11 14:05:34 2010 (r209041) +++ stable/8/sys/dev/ata/ata-all.h Fri Jun 11 14:06:35 2010 (r209042) @@ -564,6 +564,7 @@ struct ata_channel { #define ATA_CHECKS_CABLE 0x20 #define ATA_NO_ATAPI_DMA 0x40 #define ATA_SATA 0x80 +#define ATA_DMA_BEFORE_CMD 0x100 int pm_level; /* power management level */ int devices; /* what is present */ Modified: stable/8/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/8/sys/dev/ata/ata-lowlevel.c Fri Jun 11 14:05:34 2010 (r209041) +++ stable/8/sys/dev/ata/ata-lowlevel.c Fri Jun 11 14:06:35 2010 (r209042) @@ -141,6 +141,14 @@ ata_begin_transaction(struct ata_request goto begin_finished; } + /* start DMA engine if necessary */ + if ((ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { + device_printf(request->parent, "error starting DMA\n"); + request->result = EIO; + goto begin_finished; + } + /* issue command */ if (ch->hw.command(request)) { device_printf(request->parent, "error issuing %s command\n", @@ -150,7 +158,8 @@ ata_begin_transaction(struct ata_request } /* start DMA engine */ - if (ch->dma.start && ch->dma.start(request)) { + if (!(ch->flags & ATA_DMA_BEFORE_CMD) && + ch->dma.start && ch->dma.start(request)) { device_printf(request->parent, "error starting DMA\n"); request->result = EIO; goto begin_finished; Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 11 14:05:34 2010 (r209041) +++ stable/8/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 11 14:06:35 2010 (r209042) @@ -241,6 +241,16 @@ ata_serverworks_ch_attach(device_t dev) ATA_OUTL(ctlr->r_res2, ch_offset + 0x88, 0); ATA_OUTL(ctlr->r_res2, ch_offset + 0x80, ATA_INL(ctlr->r_res2, ch_offset + 0x80) & ~0x00040000); + + /* + * Some controllers have a bug where they will send the command + * to the drive before seeing a DMA start, and then can begin + * receiving data before the DMA start arrives. The controller + * will then become confused and either corrupt the data or crash. + * Remedy this by starting DMA before sending the drive command. + */ + + ch->flags |= ATA_DMA_BEFORE_CMD; } /* chip does not reliably do 64K DMA transfers */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 14:10: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 A3327106566B; Fri, 11 Jun 2010 14:10:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 905B98FC12; Fri, 11 Jun 2010 14:10: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 o5BEAKk4097032; Fri, 11 Jun 2010 14:10:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BEAKWm097029; Fri, 11 Jun 2010 14:10:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006111410.o5BEAKWm097029@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 11 Jun 2010 14:10:20 +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: r209044 - in stable/8/sys: dev/ata/chipsets powerpc/ofw 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, 11 Jun 2010 14:10:20 -0000 Author: nwhitehorn Date: Fri Jun 11 14:10:20 2010 New Revision: 209044 URL: http://svn.freebsd.org/changeset/base/209044 Log: MFC r208162, 208836, 208837: Program the K2 SATA controller's interrupt to be level-triggered low, and respect the edge/level settings in the device tree. OpenPIC on powerpc sets interrupts to be level high by default. On Apple interrupt controllers, all level interrupts are low regardless of programming except interrupt 0, used by K2 SATA on some Apple systems, with the result that the K2 SATA IRQ is misconfigured. Pending review of changes to this default, work around this by changing the programming of the K2 SATA interrupt to level low. Approved by: re (kib) Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c stable/8/sys/powerpc/ofw/ofw_pcibus.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 11 14:09:49 2010 (r209043) +++ stable/8/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 11 14:10:20 2010 (r209044) @@ -221,9 +221,9 @@ ata_serverworks_ch_attach(device_t dev) #ifdef __powerpc__ ch->hw.status = ata_serverworks_status; - /* Make sure that our interrupt is edge triggered */ + /* Make sure that our interrupt is level low */ powerpc_config_intr(bus_get_resource_start(device_get_parent(dev), - SYS_RES_IRQ, 0), INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH); + SYS_RES_IRQ, 0), INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); #endif if (ctlr->chip->chipid == ATA_K2) { Modified: stable/8/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/8/sys/powerpc/ofw/ofw_pcibus.c Fri Jun 11 14:09:49 2010 (r209043) +++ stable/8/sys/powerpc/ofw/ofw_pcibus.c Fri Jun 11 14:10:20 2010 (r209044) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -192,20 +193,36 @@ ofw_pcibus_enum_devtree(device_t dev, u_ pci_add_child(dev, (struct pci_devinfo *)dinfo); /* - * Some devices don't have an intpin set, but do have - * interrupts. These are fully specified, and set in the + * Some devices don't have an intpin set, but do have + * interrupts. These are fully specified, and set in the * interrupts property, so add that value to the device's * resource list. - */ - if (dinfo->opd_dinfo.cfg.intpin == 0) { - ofw_pci_intr_t intr; + */ + if (dinfo->opd_dinfo.cfg.intpin == 0) { + ofw_pci_intr_t intr[2]; + phandle_t iparent; + int icells; if (OF_getprop(child, "interrupts", &intr, sizeof(intr)) > 0) { - resource_list_add(&dinfo->opd_dinfo.resources, - SYS_RES_IRQ, 0, intr, intr, 1); + iparent = 0; + icells = 1; + OF_getprop(child, "interrupt-parent", &iparent, + sizeof(iparent)); + OF_getprop(iparent, "#interrupt-cells", &icells, + sizeof(icells)); + + if (iparent != 0 && icells > 1) { + powerpc_config_intr(intr[0], + (intr[1] & 1) ? INTR_TRIGGER_LEVEL : + INTR_TRIGGER_EDGE, + INTR_POLARITY_HIGH); + } + + resource_list_add(&dinfo->opd_dinfo.resources, + SYS_RES_IRQ, 0, intr[0], intr[0], 1); } - } + } } } From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 15:09: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 E8540106566B; Fri, 11 Jun 2010 15:09:41 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id B18588FC15; Fri, 11 Jun 2010 15:09:41 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id CE7862F88; Fri, 11 Jun 2010 11:04:29 -0400 (EDT) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 26A3A2F30; Fri, 11 Jun 2010 11:04:29 -0400 (EDT) Received: from mweb2.acsu.buffalo.edu (mweb2.acsu.buffalo.edu [128.205.5.239]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id 1704C2EDF; Fri, 11 Jun 2010 11:04:29 -0400 (EDT) Received: from [128.205.32.76] (bauer.cse.Buffalo.EDU [128.205.32.76]) by mweb2.acsu.buffalo.edu (Postfix) with ESMTP id BB8EE207A9; Fri, 11 Jun 2010 11:04:28 -0400 (EDT) From: Ken Smith To: Martin Matuska In-Reply-To: <201005180959.o4I9xAsu012265@svn.freebsd.org> References: <201005180959.o4I9xAsu012265@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-wJv6dOEKbrDWguRSifwQ" Date: Fri, 11 Jun 2010 11:04:28 -0400 Message-ID: <1276268668.89354.38.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% 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: r208258 - in stable/8: contrib/top etc/mtree lib lib/liblzma lib/libusb share/mk usr.bin usr.bin/less usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec 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, 11 Jun 2010 15:09:42 -0000 --=-wJv6dOEKbrDWguRSifwQ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Tue, 2010-05-18 at 09:59 +0000, Martin Matuska wrote: > Author: mm > Date: Tue May 18 09:59:09 2010 > New Revision: 208258 > URL: http://svn.freebsd.org/changeset/base/208258 >=20 > Log: > MFC r207842, r207844, r208099: > =20 > MFC r207842: > Import of liblzma, xz, xzdec, lzmainfo from vendor branch > Add support for xz and lzma to lesspipe.sh (xzless, lzless) > =20 > MFC r207844: > Add two public headers missing in r207842 > Adjust CFLAGS for lzmainfo, xz, xzdec > =20 > MFC r208099: > Add versioned symbols to liblzma > Use default SHLIB_MAJOR. > =20 > Approved by: delphij (mentor) >=20 xz on sparc64 appears to be broken. Some time between 8.1-BETA1 and now the libpng (required for release builds because it's part of the "docproj" port set) shifted from fetching a .bz2 file to fetching a .xz file. Uncompressing the file works fine on amd64 and i386 architectures but fails on sparc64. I haven't had time to dig into why it's busted but I figured I should at least let others know about it right away. Is it possible some knob related to big endian versus little endian isn't being handled quite right? --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-wJv6dOEKbrDWguRSifwQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAkwSUHEACgkQ/G14VSmup/bUNQCfbn+2DrdyJmtHafjZqpynTq6p JswAnA6D4bp2CRCQhbksUNNTb0cc1iul =1RJ2 -----END PGP SIGNATURE----- --=-wJv6dOEKbrDWguRSifwQ-- From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 15:21: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 E5DDD1065672; Fri, 11 Jun 2010 15:21:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4A5E8FC23; Fri, 11 Jun 2010 15:21: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 o5BFLCg2012871; Fri, 11 Jun 2010 15:21:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BFLCoM012869; Fri, 11 Jun 2010 15:21:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201006111521.o5BFLCoM012869@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 11 Jun 2010 15:21: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: r209046 - stable/8/lib/libc/posix1e 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, 11 Jun 2010 15:21:13 -0000 Author: trasz Date: Fri Jun 11 15:21:12 2010 New Revision: 209046 URL: http://svn.freebsd.org/changeset/base/209046 Log: Fix usage of uninitialized variable. Found with: Coverity Prevent CID: 7517 Approved by: re (kib) Modified: stable/8/lib/libc/posix1e/acl_strip.c Modified: stable/8/lib/libc/posix1e/acl_strip.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_strip.c Fri Jun 11 14:11:24 2010 (r209045) +++ stable/8/lib/libc/posix1e/acl_strip.c Fri Jun 11 15:21:12 2010 (r209046) @@ -46,7 +46,7 @@ static acl_t _nfs4_acl_strip_np(const acl_t aclp, int recalculate_mask) { acl_t newacl; - mode_t mode; + mode_t mode = 0; newacl = acl_init(ACL_MAX_ENTRIES); if (newacl == NULL) { From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 15:24:04 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 86DEC1065670; Fri, 11 Jun 2010 15:24:04 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5B0CE8FC08; Fri, 11 Jun 2010 15:24:02 +0000 (UTC) Received: by bwz2 with SMTP id 2so539042bwz.13 for ; Fri, 11 Jun 2010 08:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=Ts+DbTHIWy7C2OYN435r1T3A4xQh4czPlSURZXNMggA=; b=cZx/b5i3lPnDHWiWsn/MnWaFd250JgIvHoO8V+8MtmCGyOp2p9QqnmpP7O7u6f6xEG TWFkmB/ROXgji79eKBY423qqYwIJrPkqi3/0HdH9QGU7e2iH2ukOovEuKgYUkPh+CtsF 43Xc4kGt4Aa1lG8hUrlSAseGr53S26N5BnRZY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=cVUixopY8kv6ksvSJyPY9OR0iq7BOjYypg+r2mlMTr2Hn6zmXwuxesuezIwhzRjToJ yPsLpXMacs2qkX0icJPjf29V9kVA9Ahzj4bwBtH8jvhxezuX9k5nu3ZE8PFNQR5A/4sh eWaA6eLZjiOT7WyIwD51cyCNf+ft2WqLaPdm4= Received: by 10.204.83.228 with SMTP id g36mr1415180bkl.133.1276269840649; Fri, 11 Jun 2010 08:24:00 -0700 (PDT) Received: from enapierala.wheel.pl (58.wheelsystems.com [83.12.187.58]) by mx.google.com with ESMTPS id v14sm5389203bkz.8.2010.06.11.08.23.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 08:23:59 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <201006111521.o5BFLCoM012869@svn.freebsd.org> Date: Fri, 11 Jun 2010 17:23:40 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006111521.o5BFLCoM012869@svn.freebsd.org> To: Edward Tomasz Napierala X-Mailer: Apple Mail (2.1078) 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: r209046 - stable/8/lib/libc/posix1e 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, 11 Jun 2010 15:24:04 -0000 Wiadomo=B6=E6 napisana przez Edward Tomasz Napierala w dniu 2010-06-11, = o godz. 17:21: > Author: trasz > Date: Fri Jun 11 15:21:12 2010 > New Revision: 209046 > URL: http://svn.freebsd.org/changeset/base/209046 >=20 > Log: MFC r208784: > Fix usage of uninitialized variable. >=20 > Found with: Coverity Prevent > CID: 7517 > Approved by: re (kib) >=20 > Modified: > stable/8/lib/libc/posix1e/acl_strip.c [..] -- If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 15:26: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 1D5011065674; Fri, 11 Jun 2010 15:26:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC1E8FC17; Fri, 11 Jun 2010 15:26: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 o5BFQFLj014015; Fri, 11 Jun 2010 15:26:15 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BFQFN8014013; Fri, 11 Jun 2010 15:26:15 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201006111526.o5BFQFN8014013@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 11 Jun 2010 15:26:15 +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: r209047 - stable/8/lib/libc/posix1e 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, 11 Jun 2010 15:26:16 -0000 Author: trasz Date: Fri Jun 11 15:26:15 2010 New Revision: 209047 URL: http://svn.freebsd.org/changeset/base/209047 Log: MFC r208811: Don't use pointer to 64 bit value (id_t) to point to 32 bit value (uid_t). Found with: Coverity Prevent CID: 7466, 7467 Approved by: re (kib) Modified: stable/8/lib/libc/posix1e/acl_to_text_nfs4.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/posix1e/acl_to_text_nfs4.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_to_text_nfs4.c Fri Jun 11 15:21:12 2010 (r209046) +++ stable/8/lib/libc/posix1e/acl_to_text_nfs4.c Fri Jun 11 15:26:15 2010 (r209047) @@ -50,7 +50,7 @@ format_who(char *str, size_t size, const acl_tag_t tag; struct passwd *pwd; struct group *grp; - id_t *id; + uid_t *id; error = acl_get_tag_type(entry, &tag); if (error) @@ -62,7 +62,7 @@ format_who(char *str, size_t size, const break; case ACL_USER: - id = (id_t *)acl_get_qualifier(entry); + id = (uid_t *)acl_get_qualifier(entry); if (id == NULL) return (-1); /* XXX: Thread-unsafe. */ @@ -81,7 +81,7 @@ format_who(char *str, size_t size, const break; case ACL_GROUP: - id = (id_t *)acl_get_qualifier(entry); + id = (uid_t *)acl_get_qualifier(entry); if (id == NULL) return (-1); /* XXX: Thread-unsafe. */ @@ -141,7 +141,7 @@ format_additional_id(char *str, size_t s { int error; acl_tag_t tag; - id_t *id; + uid_t *id; error = acl_get_tag_type(entry, &tag); if (error) @@ -155,7 +155,7 @@ format_additional_id(char *str, size_t s break; default: - id = (id_t *)acl_get_qualifier(entry); + id = (uid_t *)acl_get_qualifier(entry); if (id == NULL) return (-1); snprintf(str, size, ":%d", (unsigned int)*id); From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 15:28:29 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 7C8F01065674; Fri, 11 Jun 2010 15:28:29 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 492138FC19; Fri, 11 Jun 2010 15:28:29 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L3U00B00WBG2U00@smtpauth1.wiscmail.wisc.edu>; Fri, 11 Jun 2010 10:28:28 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.74.68]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L3U00005WBEXJ40@smtpauth1.wiscmail.wisc.edu>; Fri, 11 Jun 2010 10:28:27 -0500 (CDT) Date: Fri, 11 Jun 2010 10:28:26 -0500 From: Nathan Whitehorn In-reply-to: <1276268668.89354.38.camel@bauer.cse.buffalo.edu> To: Ken Smith Message-id: <4C12561A.4060707@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.74.68 X-Spam-PmxInfo: Server=avs-11, Version=5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.11.152114, SenderIP=76.210.74.68 References: <201005180959.o4I9xAsu012265@svn.freebsd.org> <1276268668.89354.38.camel@bauer.cse.buffalo.edu> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100407 Thunderbird/3.0.4 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Martin Matuska Subject: Re: svn commit: r208258 - in stable/8: contrib/top etc/mtree lib lib/liblzma lib/libusb share/mk usr.bin usr.bin/less usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec 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, 11 Jun 2010 15:28:29 -0000 On 06/11/10 10:04, Ken Smith wrote: > On Tue, 2010-05-18 at 09:59 +0000, Martin Matuska wrote: > >> Author: mm >> Date: Tue May 18 09:59:09 2010 >> New Revision: 208258 >> URL: http://svn.freebsd.org/changeset/base/208258 >> >> Log: >> MFC r207842, r207844, r208099: >> >> MFC r207842: >> Import of liblzma, xz, xzdec, lzmainfo from vendor branch >> Add support for xz and lzma to lesspipe.sh (xzless, lzless) >> >> MFC r207844: >> Add two public headers missing in r207842 >> Adjust CFLAGS for lzmainfo, xz, xzdec >> >> MFC r208099: >> Add versioned symbols to liblzma >> Use default SHLIB_MAJOR. >> >> Approved by: delphij (mentor) >> >> > xz on sparc64 appears to be broken. Some time between 8.1-BETA1 > and now the libpng (required for release builds because it's part > of the "docproj" port set) shifted from fetching a .bz2 file to > fetching a .xz file. Uncompressing the file works fine on amd64 > and i386 architectures but fails on sparc64. > > I haven't had time to dig into why it's busted but I figured I > should at least let others know about it right away. Is it > possible some knob related to big endian versus little endian > isn't being handled quite right? > This is at least also true on powerpc (both 32 and 64 bit), so it is almost certainly an endian issue. -Nathan From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 15:35: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 58447106566B; Fri, 11 Jun 2010 15:35:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 214988FC0A; Fri, 11 Jun 2010 15:35:32 +0000 (UTC) MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_rDOR3eg50bTzTJBUsFfZug)" Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L3U00B0CWN8OM00@smtpauth3.wiscmail.wisc.edu>; Fri, 11 Jun 2010 10:35:32 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.74.68]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L3U0079BWN0JF50@smtpauth3.wiscmail.wisc.edu>; Fri, 11 Jun 2010 10:35:26 -0500 (CDT) Date: Fri, 11 Jun 2010 10:35:24 -0500 From: Nathan Whitehorn In-reply-to: <4C12561A.4060707@freebsd.org> To: Ken Smith Message-id: <4C1257BC.8030702@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.74.68 X-Spam-PmxInfo: Server=avs-14, Version=5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.11.152715, SenderIP=76.210.74.68 References: <201005180959.o4I9xAsu012265@svn.freebsd.org> <1276268668.89354.38.camel@bauer.cse.buffalo.edu> <4C12561A.4060707@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100407 Thunderbird/3.0.4 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Martin Matuska Subject: Re: svn commit: r208258 - in stable/8: contrib/top etc/mtree lib lib/liblzma lib/libusb share/mk usr.bin usr.bin/less usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec 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, 11 Jun 2010 15:35:33 -0000 This is a multi-part message in MIME format. --Boundary_(ID_rDOR3eg50bTzTJBUsFfZug) Content-type: text/plain; CHARSET=US-ASCII; format=flowed Content-transfer-encoding: 7BIT On 06/11/10 10:28, Nathan Whitehorn wrote: > On 06/11/10 10:04, Ken Smith wrote: >> On Tue, 2010-05-18 at 09:59 +0000, Martin Matuska wrote: >>> Author: mm >>> Date: Tue May 18 09:59:09 2010 >>> New Revision: 208258 >>> URL: http://svn.freebsd.org/changeset/base/208258 >>> >>> Log: >>> MFC r207842, r207844, r208099: >>> >>> MFC r207842: >>> Import of liblzma, xz, xzdec, lzmainfo from vendor branch >>> Add support for xz and lzma to lesspipe.sh (xzless, lzless) >>> >>> MFC r207844: >>> Add two public headers missing in r207842 >>> Adjust CFLAGS for lzmainfo, xz, xzdec >>> >>> MFC r208099: >>> Add versioned symbols to liblzma >>> Use default SHLIB_MAJOR. >>> >>> Approved by: delphij (mentor) >>> >> xz on sparc64 appears to be broken. Some time between 8.1-BETA1 >> and now the libpng (required for release builds because it's part >> of the "docproj" port set) shifted from fetching a .bz2 file to >> fetching a .xz file. Uncompressing the file works fine on amd64 >> and i386 architectures but fails on sparc64. >> >> I haven't had time to dig into why it's busted but I figured I >> should at least let others know about it right away. Is it >> possible some knob related to big endian versus little endian >> isn't being handled quite right? > > This is at least also true on powerpc (both 32 and 64 bit), so it is > almost certainly an endian issue. I've attached a patch to the liblzma config.h that makes xz work, at least on powerpc. -Nathan --Boundary_(ID_rDOR3eg50bTzTJBUsFfZug) Content-type: text/plain; name=lzma-patch.diff Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=lzma-patch.diff Index: config.h =================================================================== --- config.h (revision 209045) +++ config.h (working copy) @@ -84,12 +84,6 @@ # define __EXTENSIONS__ 1 #endif #define VERSION "4.999.9beta" -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ +#if BYTE_ORDER == BIG_ENDIAN # define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif #endif --Boundary_(ID_rDOR3eg50bTzTJBUsFfZug)-- From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 15:55:18 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 B01551065675; Fri, 11 Jun 2010 15:55:18 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF1E8FC18; Fri, 11 Jun 2010 15:55:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BFtIgG020560; Fri, 11 Jun 2010 15:55:18 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BFtI2W020558; Fri, 11 Jun 2010 15:55:18 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006111555.o5BFtI2W020558@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 11 Jun 2010 15:55: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: r209049 - stable/8/bin/pax 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, 11 Jun 2010 15:55:18 -0000 Author: uqs Date: Fri Jun 11 15:55:18 2010 New Revision: 209049 URL: http://svn.freebsd.org/changeset/base/209049 Log: iMFC r208484: Fix back references in substitute command for pax(1) pax(1) was trying to copy the back-referenced data from the match pattern, not the matched data. Approved by: re (kib) Modified: stable/8/bin/pax/pat_rep.c Directory Properties: stable/8/bin/pax/ (props changed) Modified: stable/8/bin/pax/pat_rep.c ============================================================================== --- stable/8/bin/pax/pat_rep.c Fri Jun 11 15:49:39 2010 (r209048) +++ stable/8/bin/pax/pat_rep.c Fri Jun 11 15:55:18 2010 (r209049) @@ -76,7 +76,7 @@ static char * range_match(char *, int); #ifdef NET2_REGEX static int resub(regexp *, char *, char *, char *); #else -static int resub(regex_t *, regmatch_t *, char *, char *, char *); +static int resub(regex_t *, regmatch_t *, char *, char *, char *, char *); #endif /* @@ -929,7 +929,7 @@ rep_name(char *name, int *nlen, int prnt # ifdef NET2_REGEX if ((res = resub(pt->rcmp,pt->nstr,outpt,endpt)) < 0) { # else - if ((res = resub(&(pt->rcmp),pm,pt->nstr,outpt,endpt)) + if ((res = resub(&(pt->rcmp),pm,inpt,pt->nstr,outpt,endpt)) < 0) { # endif if (prnt) @@ -1071,7 +1071,7 @@ resub(regexp *prog, char *src, char *des */ static int -resub(regex_t *rp, regmatch_t *pm, char *src, char *dest, +resub(regex_t *rp, regmatch_t *pm, char *orig, char *src, char *dest, char *destend) { char *spt; @@ -1121,7 +1121,7 @@ resub(regex_t *rp, regmatch_t *pm, char */ if (len > (destend - dpt)) len = destend - dpt; - if (l_strncpy(dpt, src + pmpt->rm_so, len) != len) + if (l_strncpy(dpt, orig + pmpt->rm_so, len) != len) return(-1); dpt += len; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 17:38: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 594821065673; Fri, 11 Jun 2010 17:38:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4885C8FC0A; Fri, 11 Jun 2010 17:38: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 o5BHcO02043512; Fri, 11 Jun 2010 17:38:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BHcOTQ043510; Fri, 11 Jun 2010 17:38:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006111738.o5BHcOTQ043510@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jun 2010 17:38:24 +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: r209054 - stable/8/bin/pax 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, 11 Jun 2010 17:38:24 -0000 Author: delphij Date: Fri Jun 11 17:38:24 2010 New Revision: 209054 URL: http://svn.freebsd.org/changeset/base/209054 Log: MFC r205940: Remove unused files. PR: bin/38256 Approved by: re (kib) Deleted: stable/8/bin/pax/cpio.1 stable/8/bin/pax/tar.1 Modified: stable/8/bin/pax/Makefile Directory Properties: stable/8/bin/pax/ (props changed) Modified: stable/8/bin/pax/Makefile ============================================================================== --- stable/8/bin/pax/Makefile Fri Jun 11 17:03:26 2010 (r209053) +++ stable/8/bin/pax/Makefile Fri Jun 11 17:38:24 2010 (r209054) @@ -29,9 +29,6 @@ PROG= pax SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \ gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c -#XXX NOTYET -#MAN= pax.1 tar.1 cpio.1 -#LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio .if ${MACHINE_ARCH} == "arm" WARNS?= 3 From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 19:17: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 CF0DD1065672; Fri, 11 Jun 2010 19:17:36 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB40C8FC1C; Fri, 11 Jun 2010 19:17: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 o5BJHawN065640; Fri, 11 Jun 2010 19:17:36 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BJHa93065633; Fri, 11 Jun 2010 19:17:36 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201006111917.o5BJHa93065633@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 11 Jun 2010 19:17: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: r209061 - in stable/8/sys: amd64/include/xen dev/cxgb/sys dev/xen/netfront i386/include/xen kern 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: Fri, 11 Jun 2010 19:17:36 -0000 Author: ken Date: Fri Jun 11 19:17:36 2010 New Revision: 209061 URL: http://svn.freebsd.org/changeset/base/209061 Log: MFC 199549, 199997, 204158, 207673, and 208901. Bring in a number of netfront changes: r199549 | jhb Remove commented out reference to if_watchdog and an assignment of zero to if_timer. Reviewed by: scottl r199997 | gibbs Add media ioctl support and link notifications so that devd will attempt to run dhclient on a netfront (xn) device that is setup for DHCP in /etc/rc.conf. PR: kern/136251 (fixed differently than the submitted patch) r204158 | kmacy - make printf conditional - fix witness warnings by making configuration lock a mutex r207673 | joel Switch to our preferred 2-clause BSD license. Approved by: kmacy r208901 | ken A number of netfront fixes and stability improvements: - Re-enable TSO. This was broken previously due to CSUM_TSO clearing the CSUM_TCP flag, so our checksum flags were incorrectly set going to the netback driver. That was fixed in r206844 in tcp_output.c, so we can turn TSO back on here. - Fix the way transmit slots are calculated, so that we can't overfill the ring. - Avoid sending packets with more fragments/segments than netback can handle. The Linux netback code can only handle packets of MAX_SKB_FRAGS, which turns out to be 18 on machines with 4K pages. We can easily generate packets with 32 or so fragments with TSO turned on. Right now the solution is just to drop the packets (since netback doesn't seem to handle it gracefully), but we should come up with a way to allow a driver to tell the TCP stack the maximum number of fragments it can handle in a single packet. - Fix the way the consumer is tracked in the receive path. It could get out of sync fairly easily. - Use standard Xen ring macros to make it clearer how netfront is using the rings. - Get rid of Linux-ish negative errno return values. - Added more documentation to the driver. - Refactored code to make it easier to read. - Some other minor fixes. Reviewed by: gibbs Sponsored by: Spectra Logic Approved by: re (bz) Modified: stable/8/sys/amd64/include/xen/xenfunc.h stable/8/sys/amd64/include/xen/xenvar.h stable/8/sys/dev/cxgb/sys/mvec.h stable/8/sys/dev/cxgb/sys/uipc_mvec.c stable/8/sys/dev/xen/netfront/netfront.c stable/8/sys/i386/include/xen/xenfunc.h stable/8/sys/i386/include/xen/xenvar.h stable/8/sys/kern/subr_bufring.c stable/8/sys/sys/buf_ring.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/geom/sched/ (props changed) Modified: stable/8/sys/amd64/include/xen/xenfunc.h ============================================================================== --- stable/8/sys/amd64/include/xen/xenfunc.h Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/amd64/include/xen/xenfunc.h Fri Jun 11 19:17:36 2010 (r209061) @@ -1,6 +1,5 @@ -/* - * - * Copyright (c) 2004,2005 Kip Macy +/*- + * Copyright (c) 2004, 2005 Kip Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,22 +10,22 @@ * 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. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * 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$ */ - #ifndef _XEN_XENFUNC_H_ #define _XEN_XENFUNC_H_ Modified: stable/8/sys/amd64/include/xen/xenvar.h ============================================================================== --- stable/8/sys/amd64/include/xen/xenvar.h Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/amd64/include/xen/xenvar.h Fri Jun 11 19:17:36 2010 (r209061) @@ -1,29 +1,27 @@ -/* +/*- * Copyright (c) 2008 Kip Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * 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$ */ Modified: stable/8/sys/dev/cxgb/sys/mvec.h ============================================================================== --- stable/8/sys/dev/cxgb/sys/mvec.h Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/dev/cxgb/sys/mvec.h Fri Jun 11 19:17:36 2010 (r209061) @@ -1,33 +1,31 @@ -/************************************************************************** - * - * Copyright (c) 2007,2009 Kip Macy kmacy@freebsd.org +/*- + * Copyright (c) 2007, 2009 Kip Macy * 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. The name of Kip Macy nor the names of other - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. + * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 COPYRIGHT OWNER 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. + * 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$ * - ***************************************************************************/ + */ #ifndef _MVEC_H_ #define _MVEC_H_ Modified: stable/8/sys/dev/cxgb/sys/uipc_mvec.c ============================================================================== --- stable/8/sys/dev/cxgb/sys/uipc_mvec.c Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/dev/cxgb/sys/uipc_mvec.c Fri Jun 11 19:17:36 2010 (r209061) @@ -1,32 +1,28 @@ -/************************************************************************** - * - * Copyright (c) 2007-2008, Kip Macy kmacy@freebsd.org +/*- + * Copyright (c) 2007-2008 Kip Macy * 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. The name of Kip Macy nor the names of other - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. + * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 COPYRIGHT OWNER 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. - * - * - ***************************************************************************/ + * 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. + */ #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/8/sys/dev/xen/netfront/netfront.c Fri Jun 11 19:03:59 2010 (r209060) +++ stable/8/sys/dev/xen/netfront/netfront.c Fri Jun 11 19:17:36 2010 (r209061) @@ -1,19 +1,27 @@ -/* - * +/*- * Copyright (c) 2004-2006 Kip Macy * All rights reserved. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * 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. */ @@ -116,7 +124,16 @@ static const int MODPARM_rx_copy = 1; static const int MODPARM_rx_flip = 0; #endif -#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2) +/** + * \brief The maximum allowed data fragments in a single transmit + * request. + * + * This limit is imposed by the backend driver. We assume here that + * we are dealing with a Linux driver domain and have set our limit + * to mirror the Linux MAX_SKB_FRAGS constant. + */ +#define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) + #define RX_COPY_THRESHOLD 256 #define net_ratelimit() 0 @@ -132,6 +149,9 @@ static void xn_tick_locked(struct netfro static void xn_tick(void *); static void xn_intr(void *); +static inline int xn_count_frags(struct mbuf *m); +static int xn_assemble_tx_request(struct netfront_info *sc, + struct mbuf *m_head); static void xn_start_locked(struct ifnet *); static void xn_start(struct ifnet *); static int xn_ioctl(struct ifnet *, u_long, caddr_t); @@ -155,6 +175,9 @@ static void netif_disconnect_backend(str static int setup_device(device_t dev, struct netfront_info *info); static void end_access(int ref, void *page); +static int xn_ifmedia_upd(struct ifnet *ifp); +static void xn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); + /* Xenolinux helper functions */ int network_connect(struct netfront_info *); @@ -163,8 +186,8 @@ static void xn_free_rx_ring(struct netfr static void xn_free_tx_ring(struct netfront_info *); static int xennet_get_responses(struct netfront_info *np, - struct netfront_rx_info *rinfo, RING_IDX rp, struct mbuf **list, - int *pages_flipped_p); + struct netfront_rx_info *rinfo, RING_IDX rp, RING_IDX *cons, + struct mbuf **list, int *pages_flipped_p); #define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) @@ -176,11 +199,12 @@ static int xennet_get_responses(struct n * not the other way around. The size must track the free index arrays. */ struct xn_chain_data { - struct mbuf *xn_tx_chain[NET_TX_RING_SIZE+1]; - int xn_tx_chain_cnt; - struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; + struct mbuf *xn_tx_chain[NET_TX_RING_SIZE+1]; + int xn_tx_chain_cnt; + struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; }; +#define NUM_ELEMENTS(x) (sizeof(x)/sizeof(*x)) struct net_device_stats { @@ -230,7 +254,7 @@ struct netfront_info { struct mtx tx_lock; struct mtx rx_lock; - struct sx sc_lock; + struct mtx sc_lock; u_int handle; u_int irq; @@ -240,32 +264,29 @@ struct netfront_info { /* Receive-ring batched refills. */ #define RX_MIN_TARGET 32 #define RX_MAX_TARGET NET_RX_RING_SIZE - int rx_min_target, rx_max_target, rx_target; - - /* - * {tx,rx}_skbs store outstanding skbuffs. The first entry in each - * array is an index into a chain of free entries. - */ + int rx_min_target; + int rx_max_target; + int rx_target; grant_ref_t gref_tx_head; grant_ref_t grant_tx_ref[NET_TX_RING_SIZE + 1]; grant_ref_t gref_rx_head; grant_ref_t grant_rx_ref[NET_TX_RING_SIZE + 1]; -#define TX_MAX_TARGET min(NET_RX_RING_SIZE, 256) - device_t xbdev; - int tx_ring_ref; - int rx_ring_ref; - uint8_t mac[ETHER_ADDR_LEN]; + device_t xbdev; + int tx_ring_ref; + int rx_ring_ref; + uint8_t mac[ETHER_ADDR_LEN]; struct xn_chain_data xn_cdata; /* mbufs */ - struct mbuf_head xn_rx_batch; /* head of the batch queue */ + struct mbuf_head xn_rx_batch; /* head of the batch queue */ int xn_if_flags; struct callout xn_stat_ch; - u_long rx_pfn_array[NET_RX_RING_SIZE]; - multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; - mmu_update_t rx_mmu[NET_RX_RING_SIZE]; + u_long rx_pfn_array[NET_RX_RING_SIZE]; + multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; + mmu_update_t rx_mmu[NET_RX_RING_SIZE]; + struct ifmedia sc_media; }; #define rx_mbufs xn_cdata.xn_rx_chain @@ -274,7 +295,7 @@ struct netfront_info { #define XN_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->tx_lock, #_name"_tx", "network transmit lock", MTX_DEF); \ mtx_init(&(_sc)->rx_lock, #_name"_rx", "network receive lock", MTX_DEF); \ - sx_init(&(_sc)->sc_lock, #_name"_rx") + mtx_init(&(_sc)->sc_lock, #_name"_sc", "netfront softc lock", MTX_DEF) #define XN_RX_LOCK(_sc) mtx_lock(&(_sc)->rx_lock) #define XN_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->rx_lock) @@ -282,15 +303,15 @@ struct netfront_info { #define XN_TX_LOCK(_sc) mtx_lock(&(_sc)->tx_lock) #define XN_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->tx_lock) -#define XN_LOCK(_sc) sx_xlock(&(_sc)->sc_lock); -#define XN_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_lock); +#define XN_LOCK(_sc) mtx_lock(&(_sc)->sc_lock); +#define XN_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_lock); -#define XN_LOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_lock, SX_LOCKED); +#define XN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_lock, MA_OWNED); #define XN_RX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rx_lock, MA_OWNED); #define XN_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_lock, MA_OWNED); #define XN_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->rx_lock); \ mtx_destroy(&(_sc)->tx_lock); \ - sx_destroy(&(_sc)->sc_lock); + mtx_destroy(&(_sc)->sc_lock); struct netfront_rx_info { struct netif_rx_response rx; @@ -310,18 +331,22 @@ struct netfront_rx_info { */ static inline void -add_id_to_freelist(struct mbuf **list, unsigned short id) +add_id_to_freelist(struct mbuf **list, uintptr_t id) { - KASSERT(id != 0, ("add_id_to_freelist: the head item (0) must always be free.")); + KASSERT(id != 0, + ("%s: the head item (0) must always be free.", __func__)); list[id] = list[0]; - list[0] = (void *)(u_long)id; + list[0] = (struct mbuf *)id; } static inline unsigned short get_id_from_freelist(struct mbuf **list) { - u_int id = (u_int)(u_long)list[0]; - KASSERT(id != 0, ("get_id_from_freelist: the head item (0) must always remain free.")); + uintptr_t id; + + id = (uintptr_t)list[0]; + KASSERT(id != 0, + ("%s: the head item (0) must always remain free.", __func__)); list[0] = list[id]; return (id); } @@ -333,8 +358,7 @@ xennet_rxidx(RING_IDX idx) } static inline struct mbuf * -xennet_get_rx_mbuf(struct netfront_info *np, - RING_IDX ri) +xennet_get_rx_mbuf(struct netfront_info *np, RING_IDX ri) { int i = xennet_rxidx(ri); struct mbuf *m; @@ -355,9 +379,13 @@ xennet_get_rx_ref(struct netfront_info * #define IPRINTK(fmt, args...) \ printf("[XEN] " fmt, ##args) +#ifdef INVARIANTS #define WPRINTK(fmt, args...) \ printf("[XEN] " fmt, ##args) -#if 0 +#else +#define WPRINTK(fmt, args...) +#endif +#ifdef DEBUG #define DPRINTK(fmt, args...) \ printf("[XEN] %s: " fmt, __func__, ##args) #else @@ -477,25 +505,25 @@ talk_to_backend(device_t dev, struct net goto destroy_ring; } err = xenbus_printf(xbt, node, "tx-ring-ref","%u", - info->tx_ring_ref); + info->tx_ring_ref); if (err) { message = "writing tx ring-ref"; goto abort_transaction; } err = xenbus_printf(xbt, node, "rx-ring-ref","%u", - info->rx_ring_ref); + info->rx_ring_ref); if (err) { message = "writing rx ring-ref"; goto abort_transaction; } err = xenbus_printf(xbt, node, - "event-channel", "%u", irq_to_evtchn_port(info->irq)); + "event-channel", "%u", irq_to_evtchn_port(info->irq)); if (err) { message = "writing event-channel"; goto abort_transaction; } err = xenbus_printf(xbt, node, "request-rx-copy", "%u", - info->copying_receiver); + info->copying_receiver); if (err) { message = "writing request-rx-copy"; goto abort_transaction; @@ -656,9 +684,9 @@ xn_free_rx_ring(struct netfront_info *sc int i; for (i = 0; i < NET_RX_RING_SIZE; i++) { - if (sc->xn_cdata.xn_rx_chain[i] != NULL) { - m_freem(sc->xn_cdata.xn_rx_chain[i]); - sc->xn_cdata.xn_rx_chain[i] = NULL; + if (sc->xn_cdata.rx_mbufs[i] != NULL) { + m_freem(sc->rx_mbufs[i]); + sc->rx_mbufs[i] = NULL; } } @@ -675,8 +703,8 @@ xn_free_tx_ring(struct netfront_info *sc int i; for (i = 0; i < NET_TX_RING_SIZE; i++) { - if (sc->xn_cdata.xn_tx_chain[i] != NULL) { - m_freem(sc->xn_cdata.xn_tx_chain[i]); + if (sc->tx_mbufs[i] != NULL) { + m_freem(sc->tx_mbufs[i]); sc->xn_cdata.xn_tx_chain[i] = NULL; } } @@ -685,39 +713,36 @@ xn_free_tx_ring(struct netfront_info *sc #endif } -/* - * Do some brief math on the number of descriptors available to - * determine how many slots are available. - * - * Firstly - wouldn't something with RING_FREE_REQUESTS() be more applicable? - * Secondly - MAX_SKB_FRAGS is a Linux construct which may not apply here. - * Thirdly - it isn't used here anyway; the magic constant '24' is possibly - * wrong? - * The "2" is presumably to ensure there are also enough slots available for - * the ring entries used for "options" (eg, the TSO entry before a packet - * is queued); I'm not sure why its 2 and not 1. Perhaps to make sure there's - * a "free" node in the tx mbuf list (node 0) to represent the freelist? +/** + * \brief Verify that there is sufficient space in the Tx ring + * buffer for a maximally sized request to be enqueued. * - * This only figures out whether any xenbus ring descriptors are available; - * it doesn't at all reflect how many tx mbuf ring descriptors are also - * available. + * A transmit request requires a transmit descriptor for each packet + * fragment, plus up to 2 entries for "options" (e.g. TSO). */ static inline int -netfront_tx_slot_available(struct netfront_info *np) +xn_tx_slot_available(struct netfront_info *np) { - return ((np->tx.req_prod_pvt - np->tx.rsp_cons) < - (TX_MAX_TARGET - /* MAX_SKB_FRAGS */ 24 - 2)); + return (RING_FREE_REQUESTS(&np->tx) > (MAX_TX_REQ_FRAGS + 2)); } + static void netif_release_tx_bufs(struct netfront_info *np) { - struct mbuf *m; int i; for (i = 1; i <= NET_TX_RING_SIZE; i++) { - m = np->xn_cdata.xn_tx_chain[i]; + struct mbuf *m; + + m = np->tx_mbufs[i]; - if (((u_long)m) < KERNBASE) + /* + * We assume that no kernel addresses are + * less than NET_TX_RING_SIZE. Any entry + * in the table that is below this number + * must be an index from free-list tracking. + */ + if (((uintptr_t)m) <= NET_TX_RING_SIZE) continue; gnttab_grant_foreign_access_ref(np->grant_tx_ref[i], xenbus_get_otherend_id(np->xbdev), @@ -756,19 +781,25 @@ network_alloc_rx_buffers(struct netfront return; /* - * Allocate skbuffs greedily, even though we batch updates to the + * Allocate mbufs greedily, even though we batch updates to the * receive ring. This creates a less bursty demand on the memory - * allocator, so should reduce the chance of failed allocation + * allocator, and so should reduce the chance of failed allocation * requests both for ourself and for other kernel subsystems. + * + * Here we attempt to maintain rx_target buffers in flight, counting + * buffers that we have yet to process in the receive ring. */ batch_target = sc->rx_target - (req_prod - sc->rx.rsp_cons); for (i = mbufq_len(&sc->xn_rx_batch); i < batch_target; i++) { MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) + if (m_new == NULL) { + printf("%s: MGETHDR failed\n", __func__); goto no_mbuf; + } m_cljget(m_new, M_DONTWAIT, MJUMPAGESIZE); if ((m_new->m_flags & M_EXT) == 0) { + printf("%s: m_cljget failed\n", __func__); m_freem(m_new); no_mbuf: @@ -785,16 +816,29 @@ no_mbuf: mbufq_tail(&sc->xn_rx_batch, m_new); } - /* Is the batch large enough to be worthwhile? */ + /* + * If we've allocated at least half of our target number of entries, + * submit them to the backend - we have enough to make the overhead + * of submission worthwhile. Otherwise wait for more mbufs and + * request entries to become available. + */ if (i < (sc->rx_target/2)) { if (req_prod >sc->rx.sring->req_prod) goto push; return; } - /* Adjust floating fill target if we risked running out of buffers. */ - if ( ((req_prod - sc->rx.sring->rsp_prod) < (sc->rx_target / 4)) && - ((sc->rx_target *= 2) > sc->rx_max_target) ) - sc->rx_target = sc->rx_max_target; + + /* + * Double floating fill target if we risked having the backend + * run out of empty buffers for receive traffic. We define "running + * low" as having less than a fourth of our target buffers free + * at the time we refilled the queue. + */ + if ((req_prod - sc->rx.sring->rsp_prod) < (sc->rx_target / 4)) { + sc->rx_target *= 2; + if (sc->rx_target > sc->rx_max_target) + sc->rx_target = sc->rx_max_target; + } refill: for (nr_flips = i = 0; ; i++) { @@ -806,9 +850,8 @@ refill: id = xennet_rxidx(req_prod + i); - KASSERT(sc->xn_cdata.xn_rx_chain[id] == NULL, - ("non-NULL xm_rx_chain")); - sc->xn_cdata.xn_rx_chain[id] = m_new; + KASSERT(sc->rx_mbufs[id] == NULL, ("non-NULL xm_rx_chain")); + sc->rx_mbufs[id] = m_new; ref = gnttab_claim_grant_reference(&sc->gref_rx_head); KASSERT((short)ref >= 0, ("negative ref")); @@ -932,14 +975,13 @@ xn_rxeof(struct netfront_info *np) memset(extras, 0, sizeof(rinfo.extras)); m = NULL; - err = xennet_get_responses(np, &rinfo, rp, &m, + err = xennet_get_responses(np, &rinfo, rp, &i, &m, &pages_flipped); if (unlikely(err)) { if (m) mbufq_tail(&errq, m); np->stats.rx_errors++; - i = np->rx.rsp_cons; continue; } @@ -961,7 +1003,7 @@ xn_rxeof(struct netfront_info *np) np->stats.rx_bytes += m->m_pkthdr.len; mbufq_tail(&rxq, m); - np->rx.rsp_cons = ++i; + np->rx.rsp_cons = i; } if (pages_flipped) { @@ -1056,7 +1098,6 @@ xn_txeof(struct netfront_info *np) return; ifp = np->xn_ifp; - ifp->if_timer = 0; do { prod = np->tx.sring->rsp_prod; @@ -1067,9 +1108,16 @@ xn_txeof(struct netfront_info *np) if (txr->status == NETIF_RSP_NULL) continue; + if (txr->status != NETIF_RSP_OKAY) { + printf("%s: WARNING: response is %d!\n", + __func__, txr->status); + } id = txr->id; - m = np->xn_cdata.xn_tx_chain[id]; + m = np->tx_mbufs[id]; KASSERT(m != NULL, ("mbuf not found in xn_tx_chain")); + KASSERT((uintptr_t)m > NET_TX_RING_SIZE, + ("mbuf already on the free list, but we're " + "trying to free it again!")); M_ASSERTVALID(m); /* @@ -1080,10 +1128,8 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - printf("network_tx_buf_gc: warning " - "-- grant still in use by backend " - "domain.\n"); - goto out; + panic("grant id %u still in use by the backend", + id); } gnttab_end_foreign_access_ref( np->grant_tx_ref[id]); @@ -1091,12 +1137,9 @@ xn_txeof(struct netfront_info *np) &np->gref_tx_head, np->grant_tx_ref[id]); np->grant_tx_ref[id] = GRANT_INVALID_REF; - np->xn_cdata.xn_tx_chain[id] = NULL; - add_id_to_freelist(np->xn_cdata.xn_tx_chain, id); + np->tx_mbufs[id] = NULL; + add_id_to_freelist(np->tx_mbufs, id); np->xn_cdata.xn_tx_chain_cnt--; - if (np->xn_cdata.xn_tx_chain_cnt < 0) { - panic("netif_release_tx_bufs: tx_chain_cnt must be >= 0"); - } m_free(m); /* Only mark the queue active if we've freed up at least one slot to try */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1118,7 +1161,6 @@ xn_txeof(struct netfront_info *np) mb(); } while (prod != np->tx.sring->rsp_prod); - out: if (np->tx_full && ((np->tx.sring->req_prod - prod) < NET_TX_RING_SIZE)) { np->tx_full = 0; @@ -1142,7 +1184,7 @@ xn_intr(void *xsc) ifp->if_drv_flags & IFF_DRV_RUNNING)) return; #endif - if (np->tx.rsp_cons != np->tx.sring->rsp_prod) { + if (RING_HAS_UNCONSUMED_RESPONSES(&np->tx)) { XN_TX_LOCK(np); xn_txeof(np); XN_TX_UNLOCK(np); @@ -1174,10 +1216,9 @@ xennet_move_rx_slot(struct netfront_info static int xennet_get_extras(struct netfront_info *np, - struct netif_extra_info *extras, RING_IDX rp) + struct netif_extra_info *extras, RING_IDX rp, RING_IDX *cons) { struct netif_extra_info *extra; - RING_IDX cons = np->rx.rsp_cons; int err = 0; @@ -1185,17 +1226,17 @@ xennet_get_extras(struct netfront_info * struct mbuf *m; grant_ref_t ref; - if (unlikely(cons + 1 == rp)) { + if (unlikely(*cons + 1 == rp)) { #if 0 if (net_ratelimit()) WPRINTK("Missing extra info\n"); #endif - err = -EINVAL; + err = EINVAL; break; } extra = (struct netif_extra_info *) - RING_GET_RESPONSE(&np->rx, ++cons); + RING_GET_RESPONSE(&np->rx, ++(*cons)); if (unlikely(!extra->type || extra->type >= XEN_NETIF_EXTRA_TYPE_MAX)) { @@ -1204,23 +1245,22 @@ xennet_get_extras(struct netfront_info * WPRINTK("Invalid extra type: %d\n", extra->type); #endif - err = -EINVAL; + err = EINVAL; } else { memcpy(&extras[extra->type - 1], extra, sizeof(*extra)); } - m = xennet_get_rx_mbuf(np, cons); - ref = xennet_get_rx_ref(np, cons); + m = xennet_get_rx_mbuf(np, *cons); + ref = xennet_get_rx_ref(np, *cons); xennet_move_rx_slot(np, m, ref); } while (extra->flags & XEN_NETIF_EXTRA_FLAG_MORE); - np->rx.rsp_cons = cons; return err; } static int xennet_get_responses(struct netfront_info *np, - struct netfront_rx_info *rinfo, RING_IDX rp, + struct netfront_rx_info *rinfo, RING_IDX rp, RING_IDX *cons, struct mbuf **list, int *pages_flipped_p) { @@ -1229,45 +1269,48 @@ xennet_get_responses(struct netfront_inf struct multicall_entry *mcl; struct netif_rx_response *rx = &rinfo->rx; struct netif_extra_info *extras = rinfo->extras; - RING_IDX cons = np->rx.rsp_cons; struct mbuf *m, *m0, *m_prev; - grant_ref_t ref = xennet_get_rx_ref(np, cons); - int max = 5 /* MAX_SKB_FRAGS + (rx->status <= RX_COPY_THRESHOLD) */; + grant_ref_t ref = xennet_get_rx_ref(np, *cons); + RING_IDX ref_cons = *cons; + int max = 5 /* MAX_TX_REQ_FRAGS + (rx->status <= RX_COPY_THRESHOLD) */; int frags = 1; int err = 0; u_long ret; - m0 = m = m_prev = xennet_get_rx_mbuf(np, cons); + m0 = m = m_prev = xennet_get_rx_mbuf(np, *cons); if (rx->flags & NETRXF_extra_info) { - err = xennet_get_extras(np, extras, rp); - cons = np->rx.rsp_cons; + err = xennet_get_extras(np, extras, rp, cons); } if (m0 != NULL) { - m0->m_pkthdr.len = 0; - m0->m_next = NULL; + m0->m_pkthdr.len = 0; + m0->m_next = NULL; } for (;;) { u_long mfn; #if 0 - printf("rx->status=%hd rx->offset=%hu frags=%u\n", + DPRINTK("rx->status=%hd rx->offset=%hu frags=%u\n", rx->status, rx->offset, frags); #endif if (unlikely(rx->status < 0 || rx->offset + rx->status > PAGE_SIZE)) { + #if 0 if (net_ratelimit()) WPRINTK("rx->offset: %x, size: %u\n", rx->offset, rx->status); #endif xennet_move_rx_slot(np, m, ref); - err = -EINVAL; - goto next; + if (m0 == m) + m0 = NULL; + m = NULL; + err = EINVAL; + goto next_skip_queue; } /* @@ -1276,11 +1319,12 @@ xennet_get_responses(struct netfront_inf * situation to the system controller to reboot the backed. */ if (ref == GRANT_INVALID_REF) { + #if 0 if (net_ratelimit()) WPRINTK("Bad rx response id %d.\n", rx->id); #endif - err = -EINVAL; + err = EINVAL; goto next; } @@ -1289,12 +1333,10 @@ xennet_get_responses(struct netfront_inf * headroom, ... */ if (!(mfn = gnttab_end_foreign_transfer_ref(ref))) { - if (net_ratelimit()) - WPRINTK("Unfulfilled rx req " - "(id=%d, st=%d).\n", - rx->id, rx->status); + WPRINTK("Unfulfilled rx req (id=%d, st=%d).\n", + rx->id, rx->status); xennet_move_rx_slot(np, m, ref); - err = -ENOMEM; + err = ENOMEM; goto next; } @@ -1332,23 +1374,43 @@ next: m->m_data += rx->offset; m0->m_pkthdr.len += rx->status; +next_skip_queue: if (!(rx->flags & NETRXF_more_data)) break; - if (cons + frags == rp) { + if (*cons + frags == rp) { if (net_ratelimit()) WPRINTK("Need more frags\n"); - err = -ENOENT; + err = ENOENT; + printf("%s: cons %u frags %u rp %u, not enough frags\n", + __func__, *cons, frags, rp); break; } + /* + * Note that m can be NULL, if rx->status < 0 or if + * rx->offset + rx->status > PAGE_SIZE above. + */ m_prev = m; - rx = RING_GET_RESPONSE(&np->rx, cons + frags); - m = xennet_get_rx_mbuf(np, cons + frags); + rx = RING_GET_RESPONSE(&np->rx, *cons + frags); + m = xennet_get_rx_mbuf(np, *cons + frags); - m_prev->m_next = m; + /* + * m_prev == NULL can happen if rx->status < 0 or if + * rx->offset + * rx->status > PAGE_SIZE above. + */ + if (m_prev != NULL) + m_prev->m_next = m; + + /* + * m0 can be NULL if rx->status < 0 or if * rx->offset + + * rx->status > PAGE_SIZE above. + */ + if (m0 == NULL) + m0 = m; m->m_next = NULL; - ref = xennet_get_rx_ref(np, cons + frags); + ref = xennet_get_rx_ref(np, *cons + frags); + ref_cons = *cons + frags; frags++; } *list = m0; @@ -1356,11 +1418,12 @@ next: if (unlikely(frags > max)) { if (net_ratelimit()) WPRINTK("Too many frags\n"); - err = -E2BIG; + printf("%s: too many frags %d > max %d\n", __func__, frags, + max); + err = E2BIG; } - if (unlikely(err)) - np->rx.rsp_cons = cons + frags; + *cons += frags; *pages_flipped_p = pages_flipped; @@ -1389,209 +1452,228 @@ xn_tick(void *xsc) XN_RX_UNLOCK(sc); } -static void -xn_start_locked(struct ifnet *ifp) + +/** + * \brief Count the number of fragments in an mbuf chain. + * + * Surprisingly, there isn't an M* macro for this. + */ +static inline int +xn_count_frags(struct mbuf *m) { - int otherend_id; - unsigned short id; - struct mbuf *m_head, *m; - struct netfront_info *sc; - netif_tx_request_t *tx; + int nfrags; + + for (nfrags = 0; m != NULL; m = m->m_next) + nfrags++; + + return (nfrags); +} + +/** + * Given an mbuf chain, make sure we have enough room and then push + * it onto the transmit ring. + */ +static int +xn_assemble_tx_request(struct netfront_info *sc, struct mbuf *m_head) +{ + struct ifnet *ifp; + struct mbuf *m; + u_int nfrags; netif_extra_info_t *extra; - RING_IDX i; - grant_ref_t ref; - u_long mfn, tx_bytes; - int notify, nfrags; + int otherend_id; - sc = ifp->if_softc; - otherend_id = xenbus_get_otherend_id(sc->xbdev); - tx_bytes = 0; + ifp = sc->xn_ifp; - if (!netfront_carrier_ok(sc)) - return; - - for (i = sc->tx.req_prod_pvt; TRUE; i++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 20:38: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 EC1A81065677; Fri, 11 Jun 2010 20:38:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA8AE8FC1D; Fri, 11 Jun 2010 20:38: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 o5BKcKrb083698; Fri, 11 Jun 2010 20:38:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BKcK83083694; Fri, 11 Jun 2010 20:38:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006112038.o5BKcK83083694@svn.freebsd.org> From: Michael Tuexen Date: Fri, 11 Jun 2010 20:38:20 +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: r209067 - stable/8/sys/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, 11 Jun 2010 20:38:22 -0000 Author: tuexen Date: Fri Jun 11 20:38:20 2010 New Revision: 209067 URL: http://svn.freebsd.org/changeset/base/209067 Log: MFC 209029 3 Fixes - a) There was a case where a ICMP message could cause us to return leaving a stuck lock on an stcb. b) The iterator needed some tweaks to fix its lock ordering. c) The ITERATOR_LOCK is no longer needed in the freeing of a stcb. Now that the timer based one is gone we don't have a multiple resume situation. Add to that that there was somewhere a path out of the freeing of an assoc that did NOT release the iterator_lock.. it was time to clean this old code up and in the process fix the lock bug. Approved by: re (bz) Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.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/geom/sched/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Jun 11 20:08:20 2010 (r209066) +++ stable/8/sys/netinet/sctp_pcb.c Fri Jun 11 20:38:20 2010 (r209067) @@ -3075,6 +3075,11 @@ sctp_iterator_inp_being_freed(struct sct } else { it->inp = LIST_NEXT(it->inp, sctp_list); } + /* + * When its put in the refcnt is incremented so decr + * it + */ + SCTP_INP_DECR_REF(inp); } it = nit; } @@ -4428,38 +4433,6 @@ sctp_add_vtag_to_timewait(uint32_t tag, } -static void -sctp_iterator_asoc_being_freed(struct sctp_inpcb *inp, struct sctp_tcb *stcb) -{ - struct sctp_iterator *it; - - /* - * Unlock the tcb lock we do this so we avoid a dead lock scenario - * where the iterator is waiting on the TCB lock and the TCB lock is - * waiting on the iterator lock. - */ - it = stcb->asoc.stcb_starting_point_for_iterator; - if (it == NULL) { - return; - } - if (it->inp != stcb->sctp_ep) { - /* hmm, focused on the wrong one? */ - return; - } - if (it->stcb != stcb) { - return; - } - it->stcb = LIST_NEXT(stcb, sctp_tcblist); - if (it->stcb == NULL) { - /* done with all asoc's in this assoc */ - if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { - it->inp = NULL; - } else { - it->inp = LIST_NEXT(inp, sctp_list); - } - } -} - /*- * Free the association after un-hashing the remote port. This @@ -4665,7 +4638,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_TCB_UNLOCK(stcb); - SCTP_ITERATOR_LOCK(); SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(inp); SCTP_TCB_LOCK(stcb); @@ -4704,7 +4676,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, * Make it invalid too, that way if its about to run it will abort * and return. */ - sctp_iterator_asoc_being_freed(inp, stcb); /* re-increment the lock */ if (from_inpcbfree == SCTP_NORMAL_PROC) { atomic_add_int(&stcb->asoc.refcnt, -1); @@ -4721,7 +4692,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (from_inpcbfree == SCTP_NORMAL_PROC) { SCTP_INP_INCR_REF(inp); SCTP_INP_WUNLOCK(inp); - SCTP_ITERATOR_UNLOCK(); } /* pull from vtag hash */ LIST_REMOVE(stcb, sctp_asocs); @@ -6694,20 +6664,22 @@ sctp_initiate_iterator(inp_func inpf, it->no_chunk_output = chunk_output_off; it->vn = curvnet; if (s_inp) { + /* Assume lock is held here */ it->inp = s_inp; + SCTP_INP_INCR_REF(it->inp); it->iterator_flags = SCTP_ITERATOR_DO_SINGLE_INP; } else { SCTP_INP_INFO_RLOCK(); it->inp = LIST_FIRST(&SCTP_BASE_INFO(listhead)); - + if (it->inp) { + SCTP_INP_INCR_REF(it->inp); + } SCTP_INP_INFO_RUNLOCK(); it->iterator_flags = SCTP_ITERATOR_DO_ALL_INP; } SCTP_IPI_ITERATOR_WQ_LOCK(); - if (it->inp) { - SCTP_INP_INCR_REF(it->inp); - } + TAILQ_INSERT_TAIL(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); if (sctp_it_ctl.iterator_running == 0) { sctp_wakeup_iterator(); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Jun 11 20:08:20 2010 (r209066) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Jun 11 20:38:20 2010 (r209067) @@ -402,6 +402,9 @@ sctp_ctlinput(cmd, sa, vip) SCTP_INP_DECR_REF(inp); SCTP_INP_WUNLOCK(inp); } + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } } } return; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Jun 11 20:08:20 2010 (r209066) +++ stable/8/sys/netinet/sctputil.c Fri Jun 11 20:38:20 2010 (r209067) @@ -1255,15 +1255,20 @@ sctp_iterator_work(struct sctp_iterator { int iteration_count = 0; int inp_skip = 0; + int first_in = 1; + struct sctp_inpcb *tinp; + SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); if (it->inp) { + SCTP_INP_RLOCK(it->inp); SCTP_INP_DECR_REF(it->inp); } if (it->inp == NULL) { /* iterator is complete */ done_with_iterator: SCTP_ITERATOR_UNLOCK(); + SCTP_INP_INFO_RUNLOCK(); if (it->function_atend != NULL) { (*it->function_atend) (it->pointer, it->val); } @@ -1271,7 +1276,11 @@ done_with_iterator: return; } select_a_new_ep: - SCTP_INP_RLOCK(it->inp); + if (first_in) { + first_in = 0; + } else { + SCTP_INP_RLOCK(it->inp); + } while (((it->pcb_flags) && ((it->inp->sctp_flags & it->pcb_flags) != it->pcb_flags)) || ((it->pcb_features) && @@ -1281,8 +1290,9 @@ select_a_new_ep: SCTP_INP_RUNLOCK(it->inp); goto done_with_iterator; } - SCTP_INP_RUNLOCK(it->inp); + tinp = it->inp; it->inp = LIST_NEXT(it->inp, sctp_list); + SCTP_INP_RUNLOCK(tinp); if (it->inp == NULL) { goto done_with_iterator; } @@ -1323,6 +1333,8 @@ select_a_new_ep: SCTP_INP_INCR_REF(it->inp); SCTP_INP_RUNLOCK(it->inp); SCTP_ITERATOR_UNLOCK(); + SCTP_INP_INFO_RUNLOCK(); + SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); if (sctp_it_ctl.iterator_flags) { /* We won't be staying here */ @@ -1382,9 +1394,7 @@ no_stcb: if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { it->inp = NULL; } else { - SCTP_INP_INFO_RLOCK(); it->inp = LIST_NEXT(it->inp, sctp_list); - SCTP_INP_INFO_RUNLOCK(); } if (it->inp == NULL) { goto done_with_iterator; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 21:54:04 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 D4BA71065670; Fri, 11 Jun 2010 21:54:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C304D8FC19; Fri, 11 Jun 2010 21:54:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BLs4wd000749; Fri, 11 Jun 2010 21:54:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BLs4lS000746; Fri, 11 Jun 2010 21:54:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112154.o5BLs4lS000746@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 21:54: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: r209073 - stable/8/sys/geom/part 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, 11 Jun 2010 21:54:04 -0000 Author: marius Date: Fri Jun 11 21:54:04 2010 New Revision: 209073 URL: http://svn.freebsd.org/changeset/base/209073 Log: MFC: r208746 Don't leak memory on destruction. Reviewed by: marcel Approved by: re (kib) Modified: stable/8/sys/geom/part/g_part_bsd.c stable/8/sys/geom/part/g_part_gpt.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/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/8/sys/geom/part/g_part_bsd.c Fri Jun 11 21:46:45 2010 (r209072) +++ stable/8/sys/geom/part/g_part_bsd.c Fri Jun 11 21:54:04 2010 (r209073) @@ -239,6 +239,12 @@ g_part_bsd_create(struct g_part_table *b static int g_part_bsd_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_bsd_table *table; + + table = (struct g_part_bsd_table *)basetable; + if (table->bbarea != NULL) + g_free(table->bbarea); + table->bbarea = NULL; /* Wipe the second sector to clear the partitioning. */ basetable->gpt_smhead |= 2; Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Fri Jun 11 21:46:45 2010 (r209072) +++ stable/8/sys/geom/part/g_part_gpt.c Fri Jun 11 21:54:04 2010 (r209073) @@ -462,6 +462,12 @@ g_part_gpt_create(struct g_part_table *b static int g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_gpt_table *table; + + table = (struct g_part_gpt_table *)basetable; + if (table->hdr != NULL) + g_free(table->hdr); + table->hdr = NULL; /* * Wipe the first 2 sectors as well as the last to clear the From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 22:01: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 67EA61065673; Fri, 11 Jun 2010 22:01:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 561FA8FC1B; Fri, 11 Jun 2010 22:01: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 o5BM1wdV002739; Fri, 11 Jun 2010 22:01:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BM1wBI002737; Fri, 11 Jun 2010 22:01:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112201.o5BM1wBI002737@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:01: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: r209075 - stable/8/sys/dev/cas 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, 11 Jun 2010 22:01:58 -0000 Author: marius Date: Fri Jun 11 22:01:58 2010 New Revision: 209075 URL: http://svn.freebsd.org/changeset/base/209075 Log: MFC: r208776 Avoid possible NULL-dereferences. Found with: Coverity Prevent(tm) CID: 3428 Approved by: re (kib) Modified: stable/8/sys/dev/cas/if_cas.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/geom/sched/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Fri Jun 11 21:54:06 2010 (r209074) +++ stable/8/sys/dev/cas/if_cas.c Fri Jun 11 22:01:58 2010 (r209075) @@ -1787,6 +1787,7 @@ cas_rint(struct cas_softc *sc) } } idx2 = 0; + m2 = NULL; rxds2 = NULL; if ((word1 & CAS_RC1_SPLIT_PKT) != 0) { KASSERT((word1 & CAS_RC1_RELEASE_NEXT) != 0, @@ -1799,32 +1800,39 @@ cas_rint(struct cas_softc *sc) __func__, idx2); #endif rxds2 = &sc->sc_rxdsoft[idx2]; - MGET(m2, M_DONTWAIT, MT_DATA); - if (m2 != NULL) { - refcount_acquire( - &rxds2->rxds_refcount); - m2->m_len = len - m->m_len; - bus_dmamap_sync(sc->sc_rdmatag, - rxds2->rxds_dmamap, - BUS_DMASYNC_POSTREAD); + if (m != NULL) { + MGET(m2, M_DONTWAIT, MT_DATA); + if (m2 != NULL) { + refcount_acquire( + &rxds2->rxds_refcount); + m2->m_len = len - m->m_len; + bus_dmamap_sync( + sc->sc_rdmatag, + rxds2->rxds_dmamap, + BUS_DMASYNC_POSTREAD); #if __FreeBSD_version < 800016 - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, rxds2, - M_RDONLY, EXT_NET_DRV); + MEXTADD(m2, + (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, + rxds2, M_RDONLY, + EXT_NET_DRV); #else - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, - sc, (void *)(uintptr_t)idx2, - M_RDONLY, EXT_NET_DRV); + MEXTADD(m2, + (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, sc, + (void *)(uintptr_t)idx2, + M_RDONLY, EXT_NET_DRV); #endif - if ((m2->m_flags & M_EXT) == 0) { - m_freem(m2); - m2 = NULL; + if ((m2->m_flags & M_EXT) == + 0) { + m_freem(m2); + m2 = NULL; + } } } if (m2 != NULL) m->m_next = m2; - else { + else if (m != NULL) { m_freem(m); m = NULL; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 22:25: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 11884106564A; Fri, 11 Jun 2010 22:25:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F29B68FC16; Fri, 11 Jun 2010 22:25: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 o5BMPoR7008095; Fri, 11 Jun 2010 22:25:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMPobc008092; Fri, 11 Jun 2010 22:25:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112225.o5BMPobc008092@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:25: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: r209077 - in stable/8: sbin/geom/class/part sys/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: Fri, 11 Jun 2010 22:25:51 -0000 Author: marius Date: Fri Jun 11 22:25:50 2010 New Revision: 209077 URL: http://svn.freebsd.org/changeset/base/209077 Log: MFC: r208777 - In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap file to be of maximum size. - Add special handling required for SMI/VTOC8 disklabel partcode, i.e. avoid overwriting the label when writing the bootstrap code to the partition starting at 0 and install it to all partitions when the -i option is omitted just like geom_sunlabel(4) and sunlabel(8) do by default. - Add missing prototypes. - Add const where applicable. Reviewed by: marcel Approved by: re (kib) Modified: stable/8/sbin/geom/class/part/geom_part.c stable/8/sys/sys/vtoc.h Directory Properties: stable/8/sbin/geom/class/part/ (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/geom/sched/ (props changed) Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Fri Jun 11 22:01:58 2010 (r209076) +++ stable/8/sbin/geom/class/part/geom_part.c Fri Jun 11 22:25:50 2010 (r209077) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -59,13 +60,27 @@ static char autofill[] = "*"; static char optional[] = ""; static char flags[] = "C"; -static char bootcode_param[] = "bootcode"; -static char index_param[] = "index"; -static char partcode_param[] = "partcode"; - +static const char const bootcode_param[] = "bootcode"; +static const char const index_param[] = "index"; +static const char const partcode_param[] = "partcode"; + +static struct gclass *find_class(struct gmesh *, const char *); +static struct ggeom * find_geom(struct gclass *, const char *); +static const char *find_geomcfg(struct ggeom *, const char *); +static const char *find_provcfg(struct gprovider *, const char *); +static struct gprovider *find_provider(struct ggeom *, + unsigned long long); +static const char *fmtsize(int64_t); +static int gpart_autofill(struct gctl_req *); +static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); +static void *gpart_bootfile_read(const char *, ssize_t *); static void gpart_issue(struct gctl_req *, unsigned int); static void gpart_show(struct gctl_req *, unsigned int); +static void gpart_show_geom(struct ggeom *, const char *); +static int gpart_show_hasopt(struct gctl_req *, const char *, const char *); +static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t); +static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *); struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { @@ -132,7 +147,7 @@ struct g_command PUBSYM(class_commands)[ { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL - }, + }, G_CMD_SENTINEL }; @@ -502,7 +517,7 @@ gpart_bootfile_read(const char *bootfile errx(EXIT_FAILURE, "%s: not a regular file", bootfile); if (sb.st_size == 0) errx(EXIT_FAILURE, "%s: empty file", bootfile); - if (*size > 0 && sb.st_size >= *size) + if (*size > 0 && sb.st_size > *size) errx(EXIT_FAILURE, "%s: file too big (%zu limit)", bootfile, *size); @@ -522,35 +537,14 @@ gpart_bootfile_read(const char *bootfile } static void -gpart_write_partcode(struct gctl_req *req, int idx, void *code, ssize_t size) +gpart_write_partcode(struct ggeom *gp, int idx, void *code, ssize_t size) { char dsf[128]; - struct gmesh mesh; - struct gclass *classp; - struct ggeom *gp; struct gprovider *pp; const char *s; char *buf; off_t bsize; - int error, fd; - - s = gctl_get_ascii(req, "class"); - if (s == NULL) - abort(); - error = geom_gettree(&mesh); - if (error != 0) - errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); - classp = find_class(&mesh, s); - if (classp == NULL) { - geom_deletetree(&mesh); - errx(EXIT_FAILURE, "Class %s not found.", s); - } - s = gctl_get_ascii(req, "geom"); - if (s == NULL) - abort(); - gp = find_geom(classp, s); - if (gp == NULL) - errx(EXIT_FAILURE, "No such geom: %s.", s); + int fd; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); @@ -587,18 +581,63 @@ gpart_write_partcode(struct gctl_req *re close(fd); } else errx(EXIT_FAILURE, "invalid partition index"); +} - geom_deletetree(&mesh); +static void +gpart_write_partcode_vtoc8(struct ggeom *gp, int idx, void *code) +{ + char dsf[128]; + struct gprovider *pp; + const char *s; + int installed, fd; + + installed = 0; + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s = find_provcfg(pp, "index"); + if (s == NULL) + continue; + if (idx != 0 && atoi(s) != idx) + continue; + snprintf(dsf, sizeof(dsf), "/dev/%s", pp->lg_name); + if (pp->lg_sectorsize != sizeof(struct vtoc8)) + errx(EXIT_FAILURE, "%s: unexpected sector " + "size (%d)\n", dsf, pp->lg_sectorsize); + fd = open(dsf, O_WRONLY); + if (fd == -1) + err(EXIT_FAILURE, "%s", dsf); + if (lseek(fd, VTOC_BOOTSIZE, SEEK_SET) != VTOC_BOOTSIZE) + continue; + /* + * We ignore the first VTOC_BOOTSIZE bytes of boot code in + * order to avoid overwriting the label. + */ + if (lseek(fd, sizeof(struct vtoc8), SEEK_SET) != + sizeof(struct vtoc8)) + err(EXIT_FAILURE, "%s", dsf); + if (write(fd, (caddr_t)code + sizeof(struct vtoc8), + VTOC_BOOTSIZE - sizeof(struct vtoc8)) != VTOC_BOOTSIZE - + sizeof(struct vtoc8)) + err(EXIT_FAILURE, "%s", dsf); + installed++; + close(fd); + if (idx != 0 && atoi(s) == idx) + break; + } + if (installed == 0) + errx(EXIT_FAILURE, "%s: no partitions", gp->lg_name); } static void gpart_bootcode(struct gctl_req *req, unsigned int fl) { + struct gmesh mesh; + struct gclass *classp; + struct ggeom *gp; const char *s; char *sp; void *bootcode, *partcode; size_t bootsize, partsize; - int error, idx; + int error, idx, vtoc8; if (gctl_has_param(req, bootcode_param)) { s = gctl_get_ascii(req, bootcode_param); @@ -613,9 +652,31 @@ gpart_bootcode(struct gctl_req *req, uns bootsize = 0; } + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + error = geom_gettree(&mesh); + if (error != 0) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + classp = find_class(&mesh, s); + if (classp == NULL) { + geom_deletetree(&mesh); + errx(EXIT_FAILURE, "Class %s not found.", s); + } + s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); + gp = find_geom(classp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + s = find_geomcfg(gp, "scheme"); + vtoc8 = 0; + if (strcmp(s, "VTOC8") == 0) + vtoc8 = 1; + if (gctl_has_param(req, partcode_param)) { s = gctl_get_ascii(req, partcode_param); - partsize = bootsize * 1024; + partsize = vtoc8 != 0 ? VTOC_BOOTSIZE : bootsize * 1024; partcode = gpart_bootfile_read(s, &partsize); error = gctl_delete_param(req, partcode_param); if (error) @@ -639,16 +700,20 @@ gpart_bootcode(struct gctl_req *req, uns idx = 0; if (partcode != NULL) { - if (idx == 0) - errx(EXIT_FAILURE, "missing -i option"); - gpart_write_partcode(req, idx, partcode, partsize); - } else { + if (vtoc8 == 0) { + if (idx == 0) + errx(EXIT_FAILURE, "missing -i option"); + gpart_write_partcode(gp, idx, partcode, partsize); + } else + gpart_write_partcode_vtoc8(gp, idx, partcode); + } else if (bootcode == NULL) errx(EXIT_FAILURE, "no -b nor -p"); - } if (bootcode != NULL) gpart_issue(req, fl); + + geom_deletetree(&mesh); } static void Modified: stable/8/sys/sys/vtoc.h ============================================================================== --- stable/8/sys/sys/vtoc.h Fri Jun 11 22:01:58 2010 (r209076) +++ stable/8/sys/sys/vtoc.h Fri Jun 11 22:25:50 2010 (r209077) @@ -53,9 +53,10 @@ #define VTOC_TAG_FREEBSD_ZFS 0x0904 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ -#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ +#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ #define VTOC_ASCII_LEN 128 +#define VTOC_BOOTSIZE 8192 /* 16 sectors */ #define VTOC_MAGIC 0xdabe #define VTOC_RAW_PART 2 #define VTOC_SANITY 0x600ddeee From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 11 22:59: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 4BE751065674; Fri, 11 Jun 2010 22:59:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A47A8FC08; Fri, 11 Jun 2010 22:59: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 o5BMxmRE016025; Fri, 11 Jun 2010 22:59:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMxmqf016023; Fri, 11 Jun 2010 22:59:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112259.o5BMxmqf016023@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:59: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: r209081 - stable/8/sbin/geom/class/part 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, 11 Jun 2010 22:59:48 -0000 Author: marius Date: Fri Jun 11 22:59:47 2010 New Revision: 209081 URL: http://svn.freebsd.org/changeset/base/209081 Log: Revert part of r209077 which shouldn't have been MFC'ed, yet. This is a direct commit to stable/8. Approved by: re (kib) Modified: stable/8/sbin/geom/class/part/geom_part.c Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Fri Jun 11 22:53:41 2010 (r209080) +++ stable/8/sbin/geom/class/part/geom_part.c Fri Jun 11 22:59:47 2010 (r209081) @@ -72,7 +72,6 @@ static struct gprovider *find_provider(s unsigned long long); static const char *fmtsize(int64_t); static int gpart_autofill(struct gctl_req *); -static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); static void *gpart_bootfile_read(const char *, ssize_t *); static void gpart_issue(struct gctl_req *, unsigned int); From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 12 00:28: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 CC1431065674; Sat, 12 Jun 2010 00:28:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9E188FC08; Sat, 12 Jun 2010 00:28: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 o5C0Sfm4035624; Sat, 12 Jun 2010 00:28:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C0SfDa035622; Sat, 12 Jun 2010 00:28:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006120028.o5C0SfDa035622@svn.freebsd.org> From: Marius Strobl Date: Sat, 12 Jun 2010 00:28: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: r209083 - stable/8/sbin/geom/class/part 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, 12 Jun 2010 00:28:42 -0000 Author: marius Date: Sat Jun 12 00:28:41 2010 New Revision: 209083 URL: http://svn.freebsd.org/changeset/base/209083 Log: MFC: r208778 - Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well. - Add information regarding VTOC8 bootrstrap code and how it's handled with r208777 in place. - Document the mapping of partition types to VTOC8 tags. - Add examples for VTOC8 to the respective section. - Eliminated hard sentence breaks. Reviewed by: marcel (slightly buggy version) Approved by: re (bz) Modified: stable/8/sbin/geom/class/part/gpart.8 Directory Properties: stable/8/sbin/geom/class/part/ (props changed) Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Fri Jun 11 23:38:25 2010 (r209082) +++ stable/8/sbin/geom/class/part/gpart.8 Sat Jun 12 00:28:41 2010 (r209083) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 18, 2008 +.Dd June 3, 2010 .Dt GPART 8 .Os .Sh NAME @@ -53,7 +53,10 @@ found on PCs and used on many removable The GEOM_PART_PC98 option adds support for the MBR variant as used on NEC PC-98 computers. The GEOM_PART_VTOC8 option adds support for Sun's SMI VTOC8 label as -found on UltraSPARC-based computers. +found on computers based on +.Tn SPARC64 +and +.Tn UltraSPARC. .Pp Usage of the .Xr gpart 8 @@ -191,9 +194,15 @@ The .Fl p Ar partcode option specifies a file that contains the bootstrap code intended to be written to a partition. +For the VTOC8 scheme, it is a 8192 byte file of which the last 7680 bytes +are installed as bootstrap code. The partition is specified by the .Fl i Ar index option. +For the VTOC8 scheme, if the +.Fl i Ar index +option is omitted, the bootstrap code is written to all sufficiently large +partitions. The size of the file must be smaller than the size of the partition. .Pp Addition options include: @@ -362,20 +371,20 @@ A FreeBSD partition dedicated to bootstr The scheme-specific type is "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" for GPT. .It freebsd-swap A FreeBSD partition dedicated to swap space. -The scheme-specific types are "!FreeBSD-swap" for APM, and -"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-swap" for APM, +"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0901 for VTOC8. .It freebsd-ufs A FreeBSD partition that contains a UFS or UFS2 file system. -the scheme-specific types are "!FreeBSD-UFS" for APM, and -"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT. +the scheme-specific types are "!FreeBSD-UFS" for APM, +"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0902 for VTOC8. .It freebsd-vinum A FreeBSD partition that contains a Vinum volume. -The scheme-specific types are "!FreeBSD-Vinum" for APM, and -"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-Vinum" for APM, +"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0903 for VTOC8. .It freebsd-zfs A FreeBSD partition that contains a ZFS volume. -The scheme-specific types are "!FreeBSD-ZFS" for APM, and -"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-ZFS" for APM, +"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. .It mbr A partition that is sub-partitioned by a master boot record (MBR). This type is known as "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. @@ -435,10 +444,28 @@ future need (e.g. from a ZFS partition). .Pp Create a 512MB-sized .Pa freebsd-ufs -partition that would contain UFS where the system boot from. +partition that would contain UFS where the system boots from. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed +.Pp +Create VTOC8 scheme on +.Pa da0 . +.Bd -literal -offset indent +/sbin/gpart create -s VTOC8 da0 +.Ed +.Pp +Create a 512MB-sized +.Cm freebsd-ufs +partition that would contain UFS where the system boots from. +.Bd -literal -offset indent +/sbin/gpart add -b 0 -s 1048576 -t freebsd-ufs da0 +.Ed +.Pp +After having created all required partitions, embed bootstrap code into them. +.Bd -literal -offset indent +/sbin/gpart bootcode -p /boot/boot1 da0 +.Ed .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 12 02:00:15 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 6A88C1065676; Sat, 12 Jun 2010 02:00:15 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5981B8FC12; Sat, 12 Jun 2010 02:00:15 +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 o5C20FAw055922; Sat, 12 Jun 2010 02:00:15 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C20Fkk055920; Sat, 12 Jun 2010 02:00:15 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006120200.o5C20Fkk055920@svn.freebsd.org> From: Brian Somers Date: Sat, 12 Jun 2010 02:00:15 +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: r209086 - stable/8/bin/date 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, 12 Jun 2010 02:00:15 -0000 Author: brian Date: Sat Jun 12 02:00:15 2010 New Revision: 209086 URL: http://svn.freebsd.org/changeset/base/209086 Log: MFC r208795; additional date -v detail PR: 147354 Approved by: re (kib) Modified: stable/8/bin/date/date.1 Directory Properties: stable/8/bin/date/ (props changed) Modified: stable/8/bin/date/date.1 ============================================================================== --- stable/8/bin/date/date.1 Sat Jun 12 01:45:29 2010 (r209085) +++ stable/8/bin/date/date.1 Sat Jun 12 02:00:15 2010 (r209086) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 2, 2007 +.Dd June 3, 2010 .Dt DATE 1 .Os .Sh NAME @@ -219,6 +219,14 @@ When the date is adjusted to a specific the resulting timezone will be set so that the date matches the earlier of the two times. .Pp +It is not possible to adjust a date to an invalid absolute day, so using +the switches +.Fl v No 31d Fl v No 12m +will simply fail five months of the year. +It is therefore usual to set the month before setting the day; using +.Fl v No 12m Fl v No 31d +always works. +.Pp Adjusting the date by months is inherently ambiguous because a month is a unit of variable length depending on the current date. This kind of date adjustment is applied in the most intuitive way. @@ -339,9 +347,9 @@ will display the last day of February in .Pp .Dl "Tue Feb 29 03:18:00 GMT 2000" .Pp -So will do the command: +So will the command: .Pp -.Dl "date -v30d -v3m -v0y -v-1m" +.Dl "date -v3m -v30d -v0y -v-1m" .Pp because there is no such date as the 30th of February. .Pp From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 12 05:21:29 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 89F10106566B; Sat, 12 Jun 2010 05:21:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 790FB8FC0A; Sat, 12 Jun 2010 05:21:29 +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 o5C5LTip000433; Sat, 12 Jun 2010 05:21:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C5LTIt000431; Sat, 12 Jun 2010 05:21:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006120521.o5C5LTIt000431@svn.freebsd.org> From: Xin LI Date: Sat, 12 Jun 2010 05:21:29 +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: r209089 - stable/8/lib/liblzma 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, 12 Jun 2010 05:21:29 -0000 Author: delphij Date: Sat Jun 12 05:21:29 2010 New Revision: 209089 URL: http://svn.freebsd.org/changeset/base/209089 Log: MFC r209078: Detect bit endianness through machine/endian.h. This fixes xz on big-endian systems. Tested on: sparc64 (kindly provided by linimon), amd64 Approved by: re (kensmith) Modified: stable/8/lib/liblzma/config.h Directory Properties: stable/8/lib/liblzma/ (props changed) Modified: stable/8/lib/liblzma/config.h ============================================================================== --- stable/8/lib/liblzma/config.h Sat Jun 12 05:16:37 2010 (r209088) +++ stable/8/lib/liblzma/config.h Sat Jun 12 05:21:29 2010 (r209089) @@ -84,6 +84,12 @@ # define __EXTENSIONS__ 1 #endif #define VERSION "4.999.9beta" +#if defined(__FreeBSD__) +#include +#if _BYTE_ORDER == _BIG_ENDIAN +# define WORDS_BIGENDIAN 1 +#endif +#else #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 @@ -93,3 +99,4 @@ /* # undef WORDS_BIGENDIAN */ # endif #endif +#endif From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 12 05:22: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 7067C1065675; Sat, 12 Jun 2010 05:22:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDEA8FC13; Sat, 12 Jun 2010 05:22: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 o5C5MtVt000831; Sat, 12 Jun 2010 05:22:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C5Mtg4000820; Sat, 12 Jun 2010 05:22:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006120522.o5C5Mtg4000820@svn.freebsd.org> From: Xin LI Date: Sat, 12 Jun 2010 05:22: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: r209090 - stable/8/usr.bin/gzip 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, 12 Jun 2010 05:22:55 -0000 Author: delphij Date: Sat Jun 12 05:22:55 2010 New Revision: 209090 URL: http://svn.freebsd.org/changeset/base/209090 Log: MFC r208888,208889,209017: - make sure that initialize isb with fstat() on input file before using it. (bin/147275) - Fix grammar for st_nlink. - Style changes. PR: bin/147275 Approved by: re (kensmith) Modified: stable/8/usr.bin/gzip/gzip.c Directory Properties: stable/8/usr.bin/gzip/ (props changed) Modified: stable/8/usr.bin/gzip/gzip.c ============================================================================== --- stable/8/usr.bin/gzip/gzip.c Sat Jun 12 05:21:29 2010 (r209089) +++ stable/8/usr.bin/gzip/gzip.c Sat Jun 12 05:22:55 2010 (r209090) @@ -65,10 +65,6 @@ __RCSID("$FreeBSD$"); #include #include -#ifndef PRIdOFF -#define PRIdOFF PRId64 -#endif - /* what type of file are we dealing with */ enum filetype { FT_GZIP, @@ -1221,40 +1217,46 @@ file_compress(char *file, char *outfile, in = open(file, O_RDONLY); if (in == -1) { maybe_warn("can't open %s", file); - return -1; + return (-1); } +#ifndef SMALL + if (fstat(in, &isb) != 0) { + maybe_warn("couldn't stat: %s", file); + close(in); + return (-1); + } +#endif + if (cflag == 0) { #ifndef SMALL - if (fstat(in, &isb) == 0) { - if (isb.st_nlink > 1 && fflag == 0) { - maybe_warnx("%s has %d other link%s -- " - "skipping", file, isb.st_nlink - 1, - isb.st_nlink == 1 ? "" : "s"); - close(in); - return -1; - } + if (isb.st_nlink > 1 && fflag == 0) { + maybe_warnx("%s has %d other link%s -- skipping", + file, isb.st_nlink - 1, + (isb.st_nlink - 1) == 1 ? "" : "s"); + close(in); + return (-1); } - if (fflag == 0 && (suff = check_suffix(file, 0)) - && suff->zipped[0] != 0) { + if (fflag == 0 && (suff = check_suffix(file, 0)) && + suff->zipped[0] != 0) { maybe_warnx("%s already has %s suffix -- unchanged", - file, suff->zipped); + file, suff->zipped); close(in); - return -1; + return (-1); } #endif /* Add (usually) .gz to filename */ if ((size_t)snprintf(outfile, outsize, "%s%s", - file, suffixes[0].zipped) >= outsize) + file, suffixes[0].zipped) >= outsize) memcpy(outfile + outsize - suffixes[0].ziplen - 1, - suffixes[0].zipped, suffixes[0].ziplen + 1); + suffixes[0].zipped, suffixes[0].ziplen + 1); #ifndef SMALL if (check_outfile(outfile) == 0) { close(in); - return -1; + return (-1); } #endif } @@ -1264,7 +1266,7 @@ file_compress(char *file, char *outfile, if (out == -1) { maybe_warn("could not create output: %s", outfile); fclose(stdin); - return -1; + return (-1); } #ifndef SMALL remove_file = outfile; @@ -1284,7 +1286,7 @@ file_compress(char *file, char *outfile, * has the expected size. */ if (cflag != 0) - return insize == -1 ? -1 : size; + return (insize == -1 ? -1 : size); #ifndef SMALL if (fstat(out, &osb) != 0) { @@ -1293,9 +1295,8 @@ file_compress(char *file, char *outfile, } if (osb.st_size != size) { - maybe_warnx("output file: %s wrong size (%" PRIdOFF - " != %" PRIdOFF "), deleting", - outfile, osb.st_size, size); + maybe_warnx("output file: %s wrong size (%ju != %ju), deleting", + outfile, (uintmax_t)osb.st_size, (uintmax_t)size); goto bad_outfile; } @@ -1307,7 +1308,7 @@ file_compress(char *file, char *outfile, /* output is good, ok to delete input */ unlink_input(file, &isb); - return size; + return (size); #ifndef SMALL bad_outfile: @@ -1316,7 +1317,7 @@ file_compress(char *file, char *outfile, maybe_warnx("leaving original %s", file); unlink(outfile); - return size; + return (size); #endif } @@ -1564,9 +1565,8 @@ file_uncompress(char *file, char *outfil return -1; } if (osb.st_size != size) { - maybe_warnx("stat gave different size: %" PRIdOFF - " != %" PRIdOFF " (leaving original)", - size, osb.st_size); + maybe_warnx("stat gave different size: %ju != %ju (leaving original)", + (uintmax_t)size, (uintmax_t)osb.st_size); close(ofd); unlink(outfile); return -1;