From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 16:49:14 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CFC6A646; Sun, 27 Jan 2013 16:49:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B67A6AD1; Sun, 27 Jan 2013 16:49:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RGnEp9007554; Sun, 27 Jan 2013 16:49:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RGnE38007552; Sun, 27 Jan 2013 16:49:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271649.r0RGnE38007552@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 16:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245982 - in stable/8/sys/sparc64: include sparc64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 16:49:14 -0000 Author: marius Date: Sun Jan 27 16:49:13 2013 New Revision: 245982 URL: http://svnweb.freebsd.org/changeset/base/245982 Log: MFC: 241780 - Give PIL_PREEMPT the lowest priority just above low/stray interrupts. The reason for this is that the SPARC v9 architecture allows nested interrupts of higher priority/level than that of the current interrupt to occur (and we can't just entirely bypass this model, also, at least for tick interrupts, this also wouldn't be wise). However, when a preemption interrupt interrupts another interrupt of lower priority, f.e. PIL_ITHREAD, and that one in turn is nested by a third interrupt, f.e. PIL_TICK, with SCHED_ULE the execution of interrupts higher than PIL_PREEMPT may be migrated to another CPU. In particular, tl1_ret(), which is responsible for restoring the state of the CPU prior to entry to the interrupt based on the (also migrated) trap frame, then is run on a CPU which actually didn't receive the interrupt in question, causing an inappropriate processor interrupt level to be "restored". In turn, this causes interrupts of the first level, i.e. PIL_ITHREAD in the above scenario, to be blocked on the target of the migration until the correct PIL happens to be restored again on that CPU again. Making PIL_PREEMPT the lowest real priority, this effectively prevents this scenario from happening, as preemption interrupts no longer can interrupt any other interrupt besides stray ones (which is no issue). Thanks to attilio@ and especially mav@ for helping me to understand this problem at the 201208DevSummit. - Give PIL_STOP (which is also used for IPI_STOP_HARD, given that there's no real equivalent to NMIs on SPARC v9) the highest possible priority just below the hardwired PIL_TICK, so it has a chance to interrupt more things. Modified: stable/8/sys/sparc64/include/intr_machdep.h stable/8/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/include/intr_machdep.h ============================================================================== --- stable/8/sys/sparc64/include/intr_machdep.h Sun Jan 27 16:49:11 2013 (r245981) +++ stable/8/sys/sparc64/include/intr_machdep.h Sun Jan 27 16:49:13 2013 (r245982) @@ -41,13 +41,13 @@ #define IV_SHIFT 6 #define PIL_LOW 1 /* stray interrupts */ -#define PIL_ITHREAD 2 /* interrupts that use ithreads */ -#define PIL_RENDEZVOUS 3 /* smp rendezvous ipi */ -#define PIL_AST 4 /* ast ipi */ -#define PIL_STOP 5 /* stop cpu ipi */ -#define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ -#define PIL_FILTER 12 /* filter interrupts */ -#define PIL_BRIDGE 13 /* bridge interrupts */ +#define PIL_PREEMPT 2 /* preempt idle thread CPU IPI */ +#define PIL_ITHREAD 3 /* interrupts that use ithreads */ +#define PIL_RENDEZVOUS 4 /* SMP rendezvous IPI */ +#define PIL_AST 5 /* asynchronous trap IPI */ +#define PIL_FILTER 11 /* filter interrupts */ +#define PIL_BRIDGE 12 /* bridge interrupts */ +#define PIL_STOP 13 /* stop CPU IPI */ #define PIL_TICK 14 /* tick interrupts */ #ifndef LOCORE Modified: stable/8/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/intr_machdep.c Sun Jan 27 16:49:11 2013 (r245981) +++ stable/8/sys/sparc64/sparc64/intr_machdep.c Sun Jan 27 16:49:13 2013 (r245982) @@ -92,14 +92,14 @@ static uint16_t intr_stray_count[IV_MAX] static const char *const pil_names[] = { "stray", "low", /* PIL_LOW */ + "preempt", /* PIL_PREEMPT */ "ithrd", /* PIL_ITHREAD */ "rndzvs", /* PIL_RENDEZVOUS */ "ast", /* PIL_AST */ - "stop", /* PIL_STOP */ - "preempt", /* PIL_PREEMPT */ "stray", "stray", "stray", "stray", "stray", "filter", /* PIL_FILTER */ "bridge", /* PIL_BRIDGE */ + "stop", /* PIL_STOP */ "tick", /* PIL_TICK */ }; From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 17:13:19 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5E90F8D; Sun, 27 Jan 2013 17:13:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 89381C01; Sun, 27 Jan 2013 17:13:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHDJdu016180; Sun, 27 Jan 2013 17:13:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHDIZg016167; Sun, 27 Jan 2013 17:13:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271713.r0RHDIZg016167@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245984 - stable/8/sys/dev/mpt X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 17:13:19 -0000 Author: marius Date: Sun Jan 27 17:13:18 2013 New Revision: 245984 URL: http://svnweb.freebsd.org/changeset/base/245984 Log: MFC: r241874 After r241858 (MFC'ed to stable/8 in r242285), remove the remainder of FreeBSD ~4 support from mpt(4). 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_debug.c stable/8/sys/dev/mpt/mpt_raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mpt/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt.c Sun Jan 27 17:13:18 2013 (r245984) @@ -286,10 +286,8 @@ mpt_modevent(module_t mod, int type, voi } case MOD_SHUTDOWN: break; -#if __FreeBSD_version >= 500000 case MOD_QUIESCE: break; -#endif case MOD_UNLOAD: error = pers->unload(pers); mpt_personalities[pers->id] = NULL; @@ -1471,15 +1469,9 @@ mpt_recv_handshake_reply(struct mpt_soft */ if ((reply_len >> 1) != hdr->MsgLength && (hdr->Function != MPI_FUNCTION_IOC_FACTS)){ -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "reply length does not match message length: " "got %x; expected %zx for function %x\n", hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#else - mpt_prt(mpt, "reply length does not match message length: " - "got %x; expected %x for function %x\n", - hdr->MsgLength << 2, reply_len << 1, hdr->Function); -#endif } /* Get rest of the reply; but don't overflow the provided buffer */ @@ -2155,7 +2147,6 @@ mpt_disable_ints(struct mpt_softc *mpt) static void mpt_sysctl_attach(struct mpt_softc *mpt) { -#if __FreeBSD_version >= 500000 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); @@ -2170,7 +2161,6 @@ mpt_sysctl_attach(struct mpt_softc *mpt) "failure_id", CTLFLAG_RW, &mpt->failure_id, -1, "Next Target to Fail"); #endif -#endif } int Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt.h Sun Jan 27 17:13:18 2013 (r245984) @@ -100,52 +100,34 @@ #define _MPT_H_ /********************************* OS Includes ********************************/ -#include #include #include +#include +#include #include #include -#if __FreeBSD_version < 500000 #include -#include -#include -#include -#else #include -#include -#include #include +#include #include -#include -#endif #include -#include -#include +#include +#include +#include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#include -#endif - #ifdef __sparc64__ #include #include #endif -#include - -#if __FreeBSD_version < 500000 -#include -#include -#else #include #include -#endif -#include #include "opt_ddb.h" /**************************** Register Definitions ****************************/ @@ -241,7 +223,6 @@ int mpt_modevent(module_t, int, void *); #if __FreeBSD_version < 600000 #define bus_get_dma_tag(x) NULL #endif -#if __FreeBSD_version >= 501102 #define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ lowaddr, highaddr, filter, filterarg, \ maxsize, nsegments, maxsegsz, flags, \ @@ -251,17 +232,6 @@ int mpt_modevent(module_t, int, void *); maxsize, nsegments, maxsegsz, flags, \ busdma_lock_mutex, &(mpt)->mpt_lock, \ dma_tagp) -#else -#define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) \ - bus_dma_tag_create(parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) -#endif - struct mpt_map_info { struct mpt_softc *mpt; int error; @@ -291,14 +261,9 @@ void mpt_map_rquest(void *, bus_dma_segm kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kproc_exit(status) -#elif __FreeBSD_version > 500005 -#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpt_kthread_exit(status) \ - kthread_exit(status) #else #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, fmtstr, arg) + kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) #define mpt_kthread_exit(status) \ kthread_exit(status) #endif @@ -599,13 +564,8 @@ struct mptsas_portinfo { struct mpt_softc { device_t dev; -#if __FreeBSD_version < 500000 - uint32_t mpt_islocked; - int mpt_splsaved; -#else struct mtx mpt_lock; int mpt_locksetup; -#endif uint32_t mpt_pers_mask; uint32_t : 7, @@ -676,7 +636,6 @@ struct mpt_softc { #define mpt_fcport_speed cfg.fc._port_speed } fc; } cfg; -#if __FreeBSD_version >= 500000 /* * Device config information stored up for sysctl to access */ @@ -689,7 +648,6 @@ struct mpt_softc { char wwpn[19]; } fc; } scinfo; -#endif /* Controller Info for RAID information */ CONFIG_PAGE_IOC_2 * ioc_page2; @@ -830,74 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if __FreeBSD_version < 500000 -#define MPT_IFLAGS INTR_TYPE_CAM -#define MPT_LOCK(mpt) mpt_lockspl(mpt) -#define MPT_UNLOCK(mpt) mpt_unlockspl(mpt) -#define MPT_OWNED(mpt) mpt->mpt_islocked -#define MPT_LOCK_ASSERT(mpt) -#define MPTLOCK_2_CAMLOCK MPT_UNLOCK -#define CAMLOCK_2_MPTLOCK MPT_LOCK -#define MPT_LOCK_SETUP(mpt) -#define MPT_LOCK_DESTROY(mpt) - -static __inline void mpt_lockspl(struct mpt_softc *mpt); -static __inline void mpt_unlockspl(struct mpt_softc *mpt); - -static __inline void -mpt_lockspl(struct mpt_softc *mpt) -{ - int s; - - s = splcam(); - if (mpt->mpt_islocked++ == 0) { - mpt->mpt_splsaved = s; - } else { - splx(s); - panic("Recursed lock with mask: 0x%x", s); - } -} - -static __inline void -mpt_unlockspl(struct mpt_softc *mpt) -{ - if (mpt->mpt_islocked) { - if (--mpt->mpt_islocked == 0) { - splx(mpt->mpt_splsaved); - } - } else - panic("Negative lock count"); -} - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *ident, int priority, - const char *wmesg, int timo) -{ - int saved_cnt; - int saved_spl; - int error; - - KASSERT(mpt->mpt_islocked <= 1, ("Invalid lock count on tsleep")); - saved_cnt = mpt->mpt_islocked; - saved_spl = mpt->mpt_splsaved; - mpt->mpt_islocked = 0; - error = tsleep(ident, priority, wmesg, timo); - KASSERT(mpt->mpt_islocked == 0, ("Invalid lock count on wakeup")); - mpt->mpt_islocked = saved_cnt; - mpt->mpt_splsaved = saved_spl; - return (error); -} - -#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) -#define mpt_callout_drain(mpt, c) \ - callout_stop(c) - -#else #if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ @@ -957,7 +847,6 @@ mpt_sleep(struct mpt_softc *mpt, void *i return (r); } #endif -#endif /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); @@ -1098,7 +987,6 @@ enum { MPT_PRT_NONE=100 }; -#if __FreeBSD_version > 500000 #define mpt_lprt(mpt, level, ...) \ do { \ if (level <= (mpt)->verbose) \ @@ -1112,14 +1000,7 @@ do { \ mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #endif -#else -void mpt_lprt(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#if 0 -void mpt_lprtc(struct mpt_softc *, int, const char *, ...) - __printflike(3, 4); -#endif -#endif + void mpt_prt(struct mpt_softc *, const char *, ...) __printflike(2, 3); void mpt_prtc(struct mpt_softc *, const char *, ...) Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:18 2013 (r245984) @@ -105,11 +105,10 @@ __FBSDID("$FreeBSD$"); #include "dev/mpt/mpilib/mpi_targ.h" #include "dev/mpt/mpilib/mpi_fc.h" #include "dev/mpt/mpilib/mpi_sas.h" -#if __FreeBSD_version >= 500000 -#include -#endif + #include #include +#include #if __FreeBSD_version >= 700025 #ifndef CAM_NEW_TRAN_CODE @@ -125,7 +124,6 @@ mpt_get_spi_settings(struct mpt_softc *, static void mpt_setwidth(struct mpt_softc *, int, int); static void mpt_setsync(struct mpt_softc *, int, int, int); static int mpt_update_spi_config(struct mpt_softc *, int); -static void mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended); static mpt_reply_handler_t mpt_scsi_reply_handler; static mpt_reply_handler_t mpt_scsi_tmf_reply_handler; @@ -416,6 +414,8 @@ cleanup: static int mpt_read_config_info_fc(struct mpt_softc *mpt) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; char *topology = NULL; int rv; @@ -473,33 +473,27 @@ mpt_read_config_info_fc(struct mpt_softc mpt->mpt_fcport_page0.WWPN.High, mpt->mpt_fcport_page0.WWPN.Low, mpt->mpt_fcport_speed); -#if __FreeBSD_version >= 500000 MPT_UNLOCK(mpt); - { - struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); - struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); + ctx = device_get_sysctl_ctx(mpt->dev); + tree = device_get_sysctl_tree(mpt->dev); - snprintf(mpt->scinfo.fc.wwnn, - sizeof (mpt->scinfo.fc.wwnn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWNN.High, - mpt->mpt_fcport_page0.WWNN.Low); - - snprintf(mpt->scinfo.fc.wwpn, - sizeof (mpt->scinfo.fc.wwpn), "0x%08x%08x", - mpt->mpt_fcport_page0.WWPN.High, - mpt->mpt_fcport_page0.WWPN.Low); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, - "World Wide Node Name"); - - SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, - "World Wide Port Name"); + snprintf(mpt->scinfo.fc.wwnn, sizeof (mpt->scinfo.fc.wwnn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWNN.High, + mpt->mpt_fcport_page0.WWNN.Low); + + snprintf(mpt->scinfo.fc.wwpn, sizeof (mpt->scinfo.fc.wwpn), + "0x%08x%08x", mpt->mpt_fcport_page0.WWPN.High, + mpt->mpt_fcport_page0.WWPN.Low); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, + "World Wide Node Name"); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, + "World Wide Port Name"); - } MPT_LOCK(mpt); -#endif return (0); } @@ -1246,9 +1240,6 @@ 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, @@ -1260,9 +1251,6 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } -#if __FreeBSD_version < 500000 - MPT_UNLOCK(mpt); -#endif } /* @@ -3653,7 +3641,7 @@ mpt_action(struct cam_sim *sim, union cc mpt_set_ccb_status(ccb, CAM_REQ_INVALID); break; } - mpt_calc_geometry(ccg, /*extended*/1); + cam_calc_geometry(ccg, /* extended */ 1); KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); break; } @@ -4015,33 +4003,6 @@ mpt_update_spi_config(struct mpt_softc * return (0); } -static void -mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended) -{ -#if __FreeBSD_version >= 500000 - cam_calc_geometry(ccg, extended); -#else - uint32_t size_mb; - uint32_t secs_per_cylinder; - - if (ccg->block_size == 0) { - ccg->ccb_h.status = CAM_REQ_INVALID; - return; - } - size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size); - if (size_mb > 1024 && extended) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccg->ccb_h.status = CAM_REQ_CMP; -#endif -} - /****************************** Timeout Recovery ******************************/ static int mpt_spawn_recovery_thread(struct mpt_softc *mpt) Modified: stable/8/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:18 2013 (r245984) @@ -518,6 +518,7 @@ mpt_print_reply(void *vmsg) static void mpt_print_request_hdr(MSG_REQUEST_HEADER *req) { + printf("%s @ %p\n", mpt_ioc_function(req->Function), req); printf("\tChain Offset 0x%02x\n", req->ChainOffset); printf("\tMsgFlags 0x%02x\n", req->MsgFlags); @@ -841,13 +842,8 @@ mpt_dump_request(struct mpt_softc *mpt, uint32_t *pReq = req->req_vbuf; int o; -#if __FreeBSD_version >= 500000 mpt_prt(mpt, "Send Request %d (%jx):", req->index, (uintmax_t) req->req_pbuf); -#else - mpt_prt(mpt, "Send Request %d (%llx):", - req->index, (unsigned long long) req->req_pbuf); -#endif for (o = 0; o < mpt->ioc_facts.RequestFrameSize; o++) { if ((o & 0x7) == 0) { mpt_prtc(mpt, "\n"); @@ -858,33 +854,6 @@ mpt_dump_request(struct mpt_softc *mpt, mpt_prtc(mpt, "\n"); } -#if __FreeBSD_version < 500000 -void -mpt_lprt(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - printf("%s: ", device_get_nameunit(mpt->dev)); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} - -#if 0 -void -mpt_lprtc(struct mpt_softc *mpt, int level, const char *fmt, ...) -{ - va_list ap; - if (level <= mpt->verbose) { - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - } -} -#endif -#endif - void mpt_prt(struct mpt_softc *mpt, const char *fmt, ...) { Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:11 2013 (r245983) +++ stable/8/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:18 2013 (r245984) @@ -51,15 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#if __FreeBSD_version < 500000 -#include -#define GIANT_REQUIRED -#endif -#include - #include #include #include @@ -118,11 +113,7 @@ static void mpt_enable_vol(struct mpt_so static void mpt_verify_mwce(struct mpt_softc *, struct mpt_raid_volume *); static void mpt_adjust_queue_depth(struct mpt_softc *, struct mpt_raid_volume *, struct cam_path *); -#if __FreeBSD_version < 500000 -#define mpt_raid_sysctl_attach(x) do { } while (0) -#else static void mpt_raid_sysctl_attach(struct mpt_softc *); -#endif static const char *mpt_vol_type(struct mpt_raid_volume *vol); static const char *mpt_vol_state(struct mpt_raid_volume *vol); @@ -1520,15 +1511,9 @@ mpt_refresh_raid_data(struct mpt_softc * mpt_vol_prt(mpt, mpt_vol, "%s Priority Re-Sync\n", prio ? "High" : "Low"); } -#if __FreeBSD_version >= 500000 mpt_vol_prt(mpt, mpt_vol, "%ju of %ju " "blocks remaining\n", (uintmax_t)left, (uintmax_t)total); -#else - mpt_vol_prt(mpt, mpt_vol, "%llu of %llu " - "blocks remaining\n", (uint64_t)left, - (uint64_t)total); -#endif /* Periodically report on sync progress. */ mpt_schedule_raid_refresh(mpt); @@ -1593,14 +1578,8 @@ 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 } static void @@ -1644,7 +1623,6 @@ mpt_raid_free_mem(struct mpt_softc *mpt) mpt->raid_max_disks = 0; } -#if __FreeBSD_version >= 500000 static int mpt_raid_set_vol_resync_rate(struct mpt_softc *mpt, u_int rate) { @@ -1869,4 +1847,3 @@ mpt_raid_sysctl_attach(struct mpt_softc &mpt->raid_nonopt_volumes, 0, "number of nonoptimal volumes"); } -#endif From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 17:15:59 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 583EF357; Sun, 27 Jan 2013 17:15:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48583C2C; Sun, 27 Jan 2013 17:15:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHFxqg016737; Sun, 27 Jan 2013 17:15:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHFwSd016730; Sun, 27 Jan 2013 17:15:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271715.r0RHFwSd016730@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245987 - stable/8/sys/dev/mpt X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 17:15:59 -0000 Author: marius Date: Sun Jan 27 17:15:58 2013 New Revision: 245987 URL: http://svnweb.freebsd.org/changeset/base/245987 Log: MFC: r241875 Remove support for using Giant for locking within mpt(4). Finer grained locking has been working fine for ~5.5 years by now. Modified: stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mpt/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Sun Jan 27 17:15:56 2013 (r245986) +++ stable/8/sys/dev/mpt/mpt.h Sun Jan 27 17:15:58 2013 (r245987) @@ -788,7 +788,6 @@ mpt_assign_serno(struct mpt_softc *mpt, } /***************************** Locking Primitives *****************************/ -#if 1 #define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE #define MPT_LOCK_SETUP(mpt) \ mtx_init(&mpt->mpt_lock, "mpt", NULL, MTX_DEF); \ @@ -803,8 +802,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define MPT_UNLOCK(mpt) mtx_unlock(&(mpt)->mpt_lock) #define MPT_OWNED(mpt) mtx_owned(&(mpt)->mpt_lock) #define MPT_LOCK_ASSERT(mpt) mtx_assert(&(mpt)->mpt_lock, MA_OWNED) -#define MPTLOCK_2_CAMLOCK(mpt) -#define CAMLOCK_2_MPTLOCK(mpt) #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ @@ -816,38 +813,6 @@ mpt_assign_serno(struct mpt_softc *mpt, #define mpt_callout_drain(mpt, c) \ callout_drain(c) -#else - -#define MPT_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY -#define MPT_LOCK_SETUP(mpt) do { } while (0) -#define MPT_LOCK_DESTROY(mpt) do { } while (0) -#define MPT_LOCK_ASSERT(mpt) mtx_assert(&Giant, MA_OWNED) -#define MPT_LOCK(mpt) mtx_lock(&Giant) -#define MPT_UNLOCK(mpt) mtx_unlock(&Giant) -#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); - -static __inline int -mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) -{ - int r; - r = tsleep(i, p, w, t); - return (r); -} -#endif - /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_read(struct mpt_softc *, int); Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:15:56 2013 (r245986) +++ stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:15:58 2013 (r245987) @@ -1347,9 +1347,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1583,9 +1581,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -1633,9 +1629,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1667,9 +1661,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -1758,9 +1750,7 @@ bad: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -1978,9 +1968,7 @@ bad: if (seg < nseg && nxt_off >= MPT_REQUEST_AREA) { request_t *nrq; - CAMLOCK_2_MPTLOCK(mpt); nrq = mpt_get_request(mpt, FALSE); - MPTLOCK_2_CAMLOCK(mpt); if (nrq == NULL) { error = ENOMEM; @@ -2028,9 +2016,7 @@ out: ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); return; } @@ -2062,9 +2048,7 @@ out: tgt->state = TGT_STATE_MOVING_DATA; #endif } - CAMLOCK_2_MPTLOCK(mpt); mpt_send_cmd(mpt, req); - MPTLOCK_2_CAMLOCK(mpt); } static void @@ -2083,7 +2067,6 @@ mpt_start(struct cam_sim *sim, union ccb mpt = ccb->ccb_h.ccb_mpt_ptr; raid_passthru = (sim == mpt->phydisk_sim); - CAMLOCK_2_MPTLOCK(mpt); if ((req = mpt_get_request(mpt, FALSE)) == NULL) { if (mpt->outofbeer == 0) { mpt->outofbeer = 1; @@ -2092,14 +2075,12 @@ mpt_start(struct cam_sim *sim, union ccb } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); return; } #ifdef INVARIANTS mpt_req_not_spcl(mpt, req, "mpt_start", __LINE__); #endif - MPTLOCK_2_CAMLOCK(mpt); if (sizeof (bus_addr_t) > 4) { cb = mpt_execute_req_a64; @@ -2121,15 +2102,12 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->Function = MPI_FUNCTION_SCSI_IO_REQUEST; if (raid_passthru) { mpt_req->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH; - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); mpt_req->Bus = 0; /* we never set bus here */ } else { tgt = ccb->ccb_h.target_id; @@ -2424,7 +2402,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { pathid = cam_sim_path(mpt->sim); } - MPTLOCK_2_CAMLOCK(mpt); /* * Allocate a CCB, create a wildcard path for this bus, * and schedule a rescan. @@ -2432,19 +2409,16 @@ mpt_cam_event(struct mpt_softc *mpt, req ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } #else @@ -2541,13 +2515,11 @@ mpt_cam_event(struct mpt_softc *mpt, req } else { sim = mpt->sim; } - MPTLOCK_2_CAMLOCK(mpt); for (lun_id = 0; lun_id < MPT_MAX_LUNS; lun_id++) { if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), pqf->TargetID, lun_id) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create a path to send " "XPT_REL_SIMQ"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); @@ -2561,7 +2533,6 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_free_path(tmppath); } - CAMLOCK_2_MPTLOCK(mpt); break; } case MPI_EVENT_IR_RESYNC_UPDATE: @@ -2583,39 +2554,32 @@ mpt_cam_event(struct mpt_softc *mpt, req sim = mpt->sim; switch(psdsc->ReasonCode) { case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: - MPTLOCK_2_CAMLOCK(mpt); ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { mpt_prt(mpt, "unable to alloc CCB for rescan\n"); - CAMLOCK_2_MPTLOCK(mpt); break; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); break; } xpt_rescan(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: - MPTLOCK_2_CAMLOCK(mpt); if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create path for async event"); - CAMLOCK_2_MPTLOCK(mpt); break; } xpt_async(AC_LOST_DEVICE, tmppath, NULL); xpt_free_path(tmppath); - CAMLOCK_2_MPTLOCK(mpt); break; case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET: case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL: @@ -2735,9 +2699,7 @@ mpt_scsi_reply_handler(struct mpt_softc req, req->serno); } KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); if ((req->state & REQ_STATE_TIMEDOUT) == 0) { TAILQ_REMOVE(&mpt->request_pending_list, req, links); } else { @@ -3316,15 +3278,12 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.func_code != XPT_PATH_INQ && ccb->ccb_h.func_code != XPT_RESET_BUS && ccb->ccb_h.func_code != XPT_RESET_DEV) { - CAMLOCK_2_MPTLOCK(mpt); if (mpt_map_physdisk(mpt, ccb, &tgt) != 0) { - MPTLOCK_2_CAMLOCK(mpt); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb); return; } - MPTLOCK_2_CAMLOCK(mpt); } ccb->ccb_h.ccb_mpt_ptr = mpt; @@ -3373,9 +3332,7 @@ mpt_action(struct cam_sim *sim, union cc } else { xpt_print(ccb->ccb_h.path, "reset device\n"); } - CAMLOCK_2_MPTLOCK(mpt); (void) mpt_bus_reset(mpt, tgt, lun, FALSE); - MPTLOCK_2_CAMLOCK(mpt); /* * mpt_bus_reset is always successful in that it @@ -3389,7 +3346,6 @@ mpt_action(struct cam_sim *sim, union cc case XPT_ABORT: { union ccb *accb = ccb->cab.abort_ccb; - CAMLOCK_2_MPTLOCK(mpt); switch (accb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: case XPT_IMMED_NOTIFY: @@ -3406,7 +3362,6 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.status = CAM_REQ_INVALID; break; } - MPTLOCK_2_CAMLOCK(mpt); break; } @@ -3546,7 +3501,6 @@ mpt_action(struct cam_sim *sim, union cc period >>= MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD; } #endif - CAMLOCK_2_MPTLOCK(mpt); if (dval & DP_DISC_ENABLE) { mpt->mpt_disc_enable |= (1 << tgt); } else if (dval & DP_DISC_DISABL) { @@ -3564,7 +3518,6 @@ mpt_action(struct cam_sim *sim, union cc mpt_setsync(mpt, tgt, period, offset); } if (dval == 0) { - MPTLOCK_2_CAMLOCK(mpt); mpt_set_ccb_status(ccb, CAM_REQ_CMP); break; } @@ -3576,7 +3529,6 @@ mpt_action(struct cam_sim *sim, union cc } else { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } - MPTLOCK_2_CAMLOCK(mpt); break; } case XPT_GET_TRAN_SETTINGS: @@ -3751,14 +3703,12 @@ mpt_action(struct cam_sim *sim, union cc { int result; - CAMLOCK_2_MPTLOCK(mpt); if (ccb->cel.enable) result = mpt_enable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); else result = mpt_disable_lun(mpt, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); - MPTLOCK_2_CAMLOCK(mpt); if (result == 0) { mpt_set_ccb_status(ccb, CAM_REQ_CMP); } else { @@ -3788,7 +3738,6 @@ mpt_action(struct cam_sim *sim, union cc } else { trtp = &mpt->trt[lun]; } - CAMLOCK_2_MPTLOCK(mpt); if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { mpt_lprt(mpt, MPT_PRT_DEBUG1, "Put FREE ATIO %p lun %d\n", ccb, lun); @@ -3803,13 +3752,10 @@ mpt_action(struct cam_sim *sim, union cc mpt_lprt(mpt, MPT_PRT_ALWAYS, "Got Notify ACK\n"); } mpt_set_ccb_status(ccb, CAM_REQ_INPROG); - MPTLOCK_2_CAMLOCK(mpt); return; } case XPT_CONT_TARGET_IO: - CAMLOCK_2_MPTLOCK(mpt); mpt_target_start_io(mpt, ccb); - MPTLOCK_2_CAMLOCK(mpt); return; default: @@ -3853,18 +3799,15 @@ mpt_get_spi_settings(struct mpt_softc *m CONFIG_PAGE_SCSI_DEVICE_0 tmp; dval = 0; - CAMLOCK_2_MPTLOCK(mpt); tmp = mpt->mpt_dev_page0[tgt]; rv = mpt_read_cur_cfg_page(mpt, tgt, &tmp.Header, sizeof(tmp), FALSE, 5000); if (rv) { - MPTLOCK_2_CAMLOCK(mpt); mpt_prt(mpt, "can't get tgt %d config page 0\n", tgt); return (rv); } mpt2host_config_page_scsi_device_0(&tmp); - MPTLOCK_2_CAMLOCK(mpt); mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_get_spi_settings[%d]: current NP %x Info %x\n", tgt, tmp.NegotiatedParameters, tmp.Information); @@ -4493,18 +4436,14 @@ mpt_target_start_io(struct mpt_softc *mp xpt_freeze_simq(mpt->sim, 1); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; tgt->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; default: mpt_prt(mpt, "ccb %p flags 0x%x tag 0x%08x had bad request " "starting I/O\n", ccb, csio->ccb_h.flags, csio->tag_id); mpt_tgt_dump_req_state(mpt, cmd_req); mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } @@ -4524,9 +4463,7 @@ mpt_target_start_io(struct mpt_softc *mp } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } ccb->ccb_h.status = CAM_SIM_QUEUED | CAM_REQ_INPROG; @@ -4600,7 +4537,6 @@ mpt_target_start_io(struct mpt_softc *mp "nxtstate=%d\n", csio, csio->tag_id, csio->dxfer_len, tgt->resid, ccb->ccb_h.flags, req, req->serno, tgt->state); - MPTLOCK_2_CAMLOCK(mpt); if ((ccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) { if ((ccb->ccb_h.flags & CAM_DATA_PHYS) == 0) { int error; @@ -4640,7 +4576,6 @@ mpt_target_start_io(struct mpt_softc *mp (*cb)(req, sgs, csio->sglist_cnt, 0); } } - CAMLOCK_2_MPTLOCK(mpt); } else { uint8_t *sp = NULL, sense[MPT_SENSE_SIZE]; @@ -4657,9 +4592,7 @@ mpt_target_start_io(struct mpt_softc *mp ccb->ccb_h.status, tgt->resid, tgt->bytes_xfered); mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); return; } if (ccb->ccb_h.flags & CAM_SEND_SENSE) { @@ -4865,9 +4798,7 @@ mpt_scsi_tgt_status(struct mpt_softc *mp if (ccb) { ccb->ccb_h.status &= ~CAM_SIM_QUEUED; mpt_set_ccb_status(ccb, CAM_REQUEUE_REQ); - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } else { mpt_prt(mpt, "could not allocate status request- dropping\n"); @@ -5042,9 +4973,7 @@ mpt_scsi_tgt_tsk_mgmt(struct mpt_softc * } tgt->ccb = (union ccb *) inot; inot->ccb_h.status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN; - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)inot); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5314,9 +5243,7 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, itag, atiop->tag_id, tgt->reply_desc, tgt->resid); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done((union ccb *)atiop); - CAMLOCK_2_MPTLOCK(mpt); } static void @@ -5425,9 +5352,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); break; } /* @@ -5510,9 +5435,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt->outofbeer = 0; mpt_lprt(mpt, MPT_PRT_DEBUG, "THAWQ\n"); } - MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); - CAMLOCK_2_MPTLOCK(mpt); } break; } Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:15:56 2013 (r245986) +++ stable/8/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:15:58 2013 (r245987) @@ -692,9 +692,7 @@ mpt_raid_thread(void *arg) */ if (firstrun) { firstrun = 0; - MPTLOCK_2_CAMLOCK(mpt); xpt_release_simq(mpt->phydisk_sim, TRUE); - CAMLOCK_2_MPTLOCK(mpt); } if (mpt->raid_rescan != 0) { @@ -1664,19 +1662,16 @@ mpt_raid_set_vol_queue_depth(struct mpt_ mpt->raid_rescan = 0; - MPTLOCK_2_CAMLOCK(mpt); error = xpt_create_path(&path, xpt_periph, cam_sim_path(mpt->sim), mpt_vol->config_page->VolumeID, /*lun*/0); if (error != CAM_REQ_CMP) { - CAMLOCK_2_MPTLOCK(mpt); mpt_vol_prt(mpt, mpt_vol, "Unable to allocate path!\n"); continue; } mpt_adjust_queue_depth(mpt, mpt_vol, path); xpt_free_path(path); - CAMLOCK_2_MPTLOCK(mpt); } MPT_UNLOCK(mpt); return (0); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 17:33:29 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22554D31; Sun, 27 Jan 2013 17:33:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C2DFFD51; Sun, 27 Jan 2013 17:33:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHXSeo023269; Sun, 27 Jan 2013 17:33:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHXSf1023268; Sun, 27 Jan 2013 17:33:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271733.r0RHXSf1023268@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245991 - stable/8/sys/boot/sparc64/boot1 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 17:33:29 -0000 Author: marius Date: Sun Jan 27 17:33:28 2013 New Revision: 245991 URL: http://svnweb.freebsd.org/changeset/base/245991 Log: MFC: r244307 Restore pre-r234898 (MFC'ed to stable/9 in r236077) printing of boot loader and path. Modified: stable/8/sys/boot/sparc64/boot1/boot1.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- stable/8/sys/boot/sparc64/boot1/boot1.c Sun Jan 27 17:33:22 2013 (r245990) +++ stable/8/sys/boot/sparc64/boot1/boot1.c Sun Jan 27 17:33:28 2013 (r245991) @@ -340,11 +340,11 @@ main(int ac, char **av) } #ifdef ZFSBOOT - printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", + printf(" \n>> FreeBSD/sparc64 ZFS boot block\n Boot path: %s\n", bootpath); #else - printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" - " Boot loader: %s\n", "", bootpath, path); + printf(" \n>> FreeBSD/sparc64 boot block\n Boot path: %s\n" + " Boot loader: %s\n", bootpath, path); #endif if (mount(bootpath) == -1) From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 17:41:30 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 353442C5; Sun, 27 Jan 2013 17:41:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27043DB8; Sun, 27 Jan 2013 17:41:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHfUVP026003; Sun, 27 Jan 2013 17:41:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHfUlr026002; Sun, 27 Jan 2013 17:41:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271741.r0RHfUlr026002@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245994 - stable/8/usr.sbin/daemon X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 17:41:30 -0000 Author: marius Date: Sun Jan 27 17:41:29 2013 New Revision: 245994 URL: http://svnweb.freebsd.org/changeset/base/245994 Log: MFC: r244986 Remove bogus '-' from getopt(3) string hit when porting daemon(8) to GNU/Linux *duck*. Modified: stable/8/usr.sbin/daemon/daemon.c Directory Properties: stable/8/usr.sbin/daemon/ (props changed) Modified: stable/8/usr.sbin/daemon/daemon.c ============================================================================== --- stable/8/usr.sbin/daemon/daemon.c Sun Jan 27 17:41:26 2013 (r245993) +++ stable/8/usr.sbin/daemon/daemon.c Sun Jan 27 17:41:29 2013 (r245994) @@ -62,7 +62,7 @@ main(int argc, char *argv[]) nochdir = noclose = 1; restart = 0; pidfile = user = NULL; - while ((ch = getopt(argc, argv, "-cfp:ru:")) != -1) { + while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 22:50:40 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 567D0FD; Sun, 27 Jan 2013 22:50:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 314A8A5A; Sun, 27 Jan 2013 22:50:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RMoeYb018250; Sun, 27 Jan 2013 22:50:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RMoeQk018249; Sun, 27 Jan 2013 22:50:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272250.r0RMoeQk018249@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 22:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246004 - stable/8/sys/i386/xen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 22:50:40 -0000 Author: marius Date: Sun Jan 27 22:50:39 2013 New Revision: 246004 URL: http://svnweb.freebsd.org/changeset/base/246004 Log: MFC: r244987 Fix !INVARIANTS && !SMP build. Modified: stable/8/sys/i386/xen/xen_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/i386/ (props changed) Modified: stable/8/sys/i386/xen/xen_machdep.c ============================================================================== --- stable/8/sys/i386/xen/xen_machdep.c Sun Jan 27 22:50:36 2013 (r246003) +++ stable/8/sys/i386/xen/xen_machdep.c Sun Jan 27 22:50:39 2013 (r246004) @@ -215,7 +215,9 @@ static mmu_update_t xpq_queue[MAX_VIRT_C #else static mmu_update_t xpq_queue[XPQUEUE_SIZE]; +#ifdef INVARIANTS static struct mmu_log xpq_queue_log[XPQUEUE_SIZE]; +#endif static int xpq_idx = 0; #define XPQ_QUEUE_LOG xpq_queue_log From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 23:00:02 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B8EB6C9; Sun, 27 Jan 2013 23:00:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1E6BAC0; Sun, 27 Jan 2013 23:00:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN01qb019674; Sun, 27 Jan 2013 23:00:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN01hd019673; Sun, 27 Jan 2013 23:00:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272300.r0RN01hd019673@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246006 - stable/8/sys/dev/xen/control X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 23:00:02 -0000 Author: marius Date: Sun Jan 27 23:00:01 2013 New Revision: 246006 URL: http://svnweb.freebsd.org/changeset/base/246006 Log: MFC: r244990 (partial) - Replace incorrect function names in printf(9) strings with __func__. - Make xctrl_shutdown_reasons table const. - Use nitems() rather than rolling an own version. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. Modified: stable/8/sys/dev/xen/control/control.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/xen/ (props changed) Modified: stable/8/sys/dev/xen/control/control.c ============================================================================== --- stable/8/sys/dev/xen/control/control.c Sun Jan 27 22:59:59 2013 (r246005) +++ stable/8/sys/dev/xen/control/control.c Sun Jan 27 23:00:01 2013 (r246006) @@ -125,7 +125,6 @@ __FBSDID("$FreeBSD$"); #include #endif - #include #include @@ -145,8 +144,6 @@ __FBSDID("$FreeBSD$"); #include -#define NUM_ELEMENTS(x) (sizeof(x) / sizeof(*(x))) - /*--------------------------- Forward Declarations --------------------------*/ /** Function signature for shutdown event handlers. */ typedef void (xctrl_shutdown_handler_t)(void); @@ -165,7 +162,7 @@ struct xctrl_shutdown_reason { }; /** Lookup table for shutdown event name to handler. */ -static struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { +static const struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { { "poweroff", xctrl_poweroff }, { "reboot", xctrl_reboot }, { "suspend", xctrl_suspend }, @@ -205,6 +202,7 @@ xctrl_suspend() #ifdef SMP cpumask_t map; + /* * Bind us to CPU 0 and stop any other VCPUs. */ @@ -225,7 +223,7 @@ xctrl_suspend() mtx_lock(&Giant); if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); #ifdef SMP if (map) restart_cpus(map); @@ -337,9 +335,9 @@ xctrl_suspend() * drivers need this. */ mtx_lock(&Giant); - if (DEVICE_SUSPEND(root_bus)) { + if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); return; } mtx_unlock(&Giant); @@ -390,8 +388,8 @@ xctrl_halt() static void xctrl_on_watch_event(struct xs_watch *watch, const char **vec, unsigned int len) { - struct xctrl_shutdown_reason *reason; - struct xctrl_shutdown_reason *last_reason; + const struct xctrl_shutdown_reason *reason; + const struct xctrl_shutdown_reason *last_reason; char *result; int error; int result_len; @@ -402,7 +400,7 @@ xctrl_on_watch_event(struct xs_watch *wa return; reason = xctrl_shutdown_reasons; - last_reason = reason + NUM_ELEMENTS(xctrl_shutdown_reasons); + last_reason = reason + nitems(xctrl_shutdown_reasons); while (reason < last_reason) { if (!strcmp(result, reason->name)) { @@ -505,10 +503,10 @@ static device_method_t xctrl_methods[] = DEVMETHOD(device_attach, xctrl_attach), DEVMETHOD(device_detach, xctrl_detach), - { 0, 0 } + DEVMETHOD_END }; DEFINE_CLASS_0(xctrl, xctrl_driver, xctrl_methods, sizeof(struct xctrl_softc)); devclass_t xctrl_devclass; -DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, 0, 0); +DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, NULL, NULL); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 23:02:36 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 82B62A70; Sun, 27 Jan 2013 23:02:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74A4CAEA; Sun, 27 Jan 2013 23:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN2aaE021786; Sun, 27 Jan 2013 23:02:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN2a34021785; Sun, 27 Jan 2013 23:02:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272302.r0RN2a34021785@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246008 - stable/8/sys/dev/xen/netfront X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 23:02:36 -0000 Author: marius Date: Sun Jan 27 23:02:35 2013 New Revision: 246008 URL: http://svnweb.freebsd.org/changeset/base/246008 Log: MFC: r244991 - Replace partially incorrect function names in panic(9) strings with __func__ and add some missing ones. - Remove a stale comment. - Remove unused NUM_ELEMENTS macro. - Remove extra empty lines. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. Modified: stable/8/sys/dev/xen/netfront/netfront.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/xen/ (props changed) Modified: stable/8/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/8/sys/dev/xen/netfront/netfront.c Sun Jan 27 23:02:33 2013 (r246007) +++ stable/8/sys/dev/xen/netfront/netfront.c Sun Jan 27 23:02:35 2013 (r246008) @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); @@ -206,8 +205,6 @@ struct xn_chain_data { struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; }; -#define NUM_ELEMENTS(x) (sizeof(x)/sizeof(*x)) - struct net_device_stats { u_long rx_packets; /* total packets received */ @@ -242,7 +239,6 @@ struct net_device_stats }; struct netfront_info { - struct ifnet *xn_ifp; #if __FreeBSD_version >= 700000 struct lro_ctrl xn_lro; @@ -327,12 +323,6 @@ struct netfront_rx_info { /* Access macros for acquiring freeing slots in xn_free_{tx,rx}_idxs[]. */ - - -/* - * Access macros for acquiring freeing slots in tx_skbs[]. - */ - static inline void add_id_to_freelist(struct mbuf **list, uintptr_t id) { @@ -515,7 +505,6 @@ netfront_resume(device_t dev) return (0); } - /* Common code used when first setting up, and when resuming. */ static int talk_to_backend(device_t dev, struct netfront_info *info) @@ -603,7 +592,6 @@ talk_to_backend(device_t dev, struct net return err; } - static int setup_device(device_t dev, struct netfront_info *info) { @@ -788,7 +776,7 @@ netif_release_tx_bufs(struct netfront_in add_id_to_freelist(np->tx_mbufs, i); 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"); + panic("%s: tx_chain_cnt must be >= 0", __func__); } m_free(m); } @@ -940,7 +928,6 @@ refill: reservation.domid = DOMID_SELF; if (!xen_feature(XENFEAT_auto_translated_physmap)) { - /* After all PTEs have been zapped, flush the TLB. */ sc->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] = UVMF_TLB_FLUSH|UVMF_ALL; @@ -952,15 +939,11 @@ refill: /* Zap PTEs and give away pages in one big multicall. */ (void)HYPERVISOR_multicall(sc->rx_mcl, i+1); - /* Check return status of HYPERVISOR_dom_mem_op(). */ - if (unlikely(sc->rx_mcl[i].result != i)) - panic("Unable to reduce memory reservation\n"); - } else { - if (HYPERVISOR_memory_op( - XENMEM_decrease_reservation, &reservation) - != i) - panic("Unable to reduce memory " - "reservation\n"); + if (unlikely(sc->rx_mcl[i].result != i || + HYPERVISOR_memory_op(XENMEM_decrease_reservation, + &reservation) != i)) + panic("%s: unable to reduce memory " + "reservation\n", __func__); } } else { wmb(); @@ -1163,8 +1146,8 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - panic("grant id %u still in use by the backend", - id); + panic("%s: grant id %u still in use by the " + "backend", __func__, id); } gnttab_end_foreign_access_ref( np->grant_tx_ref[id]); @@ -1204,7 +1187,6 @@ xn_txeof(struct netfront_info *np) netif_wake_queue(dev); #endif } - } static void @@ -1234,7 +1216,6 @@ xn_intr(void *xsc) xn_start(ifp); } - static void xennet_move_rx_slot(struct netfront_info *np, struct mbuf *m, grant_ref_t ref) @@ -1313,17 +1294,15 @@ xennet_get_responses(struct netfront_inf m0 = m = m_prev = xennet_get_rx_mbuf(np, *cons); - if (rx->flags & NETRXF_extra_info) { err = xennet_get_extras(np, extras, rp, cons); } - if (m0 != NULL) { m0->m_pkthdr.len = 0; m0->m_next = NULL; } - + for (;;) { u_long mfn; @@ -1462,10 +1441,8 @@ xn_tick_locked(struct netfront_info *sc) callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); /* XXX placeholder for printing debug information */ - } - static void xn_tick(void *xsc) { @@ -1475,7 +1452,6 @@ xn_tick(void *xsc) XN_RX_LOCK(sc); xn_tick_locked(sc); XN_RX_UNLOCK(sc); - } /** @@ -1589,10 +1565,12 @@ xn_assemble_tx_request(struct netfront_i tx = RING_GET_REQUEST(&sc->tx, sc->tx.req_prod_pvt); id = get_id_from_freelist(sc->tx_mbufs); if (id == 0) - panic("xn_start_locked: was allocated the freelist head!\n"); + panic("%s: was allocated the freelist head!\n", + __func__); sc->xn_cdata.xn_tx_chain_cnt++; if (sc->xn_cdata.xn_tx_chain_cnt > NET_TX_RING_SIZE) - panic("xn_start_locked: tx_chain_cnt must be <= NET_TX_RING_SIZE\n"); + panic("%s: tx_chain_cnt must be <= NET_TX_RING_SIZE\n", + __func__); sc->tx_mbufs[id] = m; tx->id = id; ref = gnttab_claim_grant_reference(&sc->gref_tx_head); @@ -1704,7 +1682,6 @@ xn_start_locked(struct ifnet *ifp) } } - static void xn_start(struct ifnet *ifp) { @@ -1738,10 +1715,8 @@ xn_ifinit_locked(struct netfront_info *s if_link_state_change(ifp, LINK_STATE_UP); callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); - } - static void xn_ifinit(void *xsc) { @@ -1750,10 +1725,8 @@ xn_ifinit(void *xsc) XN_LOCK(sc); xn_ifinit_locked(sc); XN_UNLOCK(sc); - } - static int xn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { @@ -2250,7 +2223,7 @@ static device_method_t netfront_methods[ /* Xenbus interface */ DEVMETHOD(xenbus_otherend_changed, netfront_backend_changed), - { 0, 0 } + DEVMETHOD_END }; static driver_t netfront_driver = { @@ -2260,4 +2233,5 @@ static driver_t netfront_driver = { }; devclass_t netfront_devclass; -DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, 0, 0); +DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, NULL, + NULL); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 23:05:28 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9E4C2E61; Sun, 27 Jan 2013 23:05:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 444BAB0B; Sun, 27 Jan 2013 23:05:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN5Sw5022384; Sun, 27 Jan 2013 23:05:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN5SHI022383; Sun, 27 Jan 2013 23:05:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272305.r0RN5SHI022383@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246010 - in stable/8/sys/dev/xen: evtchn xenpci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 23:05:28 -0000 Author: marius Date: Sun Jan 27 23:05:27 2013 New Revision: 246010 URL: http://svnweb.freebsd.org/changeset/base/246010 Log: MFC: r244993 Remove files not connected to the build. It's confusing enough that we still have two not quite the same evtchn.c left over. Deleted: stable/8/sys/dev/xen/evtchn/ stable/8/sys/dev/xen/xenpci/machine_reboot.c Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/xen/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 23:08:56 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 867ABEB; Sun, 27 Jan 2013 23:08:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 70484B26; Sun, 27 Jan 2013 23:08:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RN8u8F023036; Sun, 27 Jan 2013 23:08:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RN8uDM023035; Sun, 27 Jan 2013 23:08:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272308.r0RN8uDM023035@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246012 - stable/8/sys/sparc64/sparc64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 23:08:56 -0000 Author: marius Date: Sun Jan 27 23:08:55 2013 New Revision: 246012 URL: http://svnweb.freebsd.org/changeset/base/246012 Log: MFC: r245017 Revert bogus part of r241740 (MFC'ed to stable/8 in r241879). Reported by: Michael Moll Modified: stable/8/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/8/sys/sparc64/sparc64/interrupt.S Sun Jan 27 23:08:51 2013 (r246011) +++ stable/8/sys/sparc64/sparc64/interrupt.S Sun Jan 27 23:08:55 2013 (r246012) @@ -83,13 +83,13 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,a,pt %g3, 1f - srlx %g3, 60, %g6 + brnz,pt %g3, 1f /* * NB: Zeus CPUs set some undocumented bits in the first data word. */ - jmpl %g4, %g0 and %g3, IV_MAX - 1, %g3 + jmpl %g4, %g0 + nop /* NOTREACHED */ /* @@ -98,7 +98,8 @@ ENTRY(intr_vector) * 4 bits of the 1st data word specify a priority, and the 2nd and * 3rd a function and argument. */ -1: brnz,a,pn %g6, 2f +1: srlx %g3, 60, %g6 + brnz,a,pn %g6, 2f clr %g3 /* From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 27 23:21:52 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9982A624; Sun, 27 Jan 2013 23:21:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A113BD6; Sun, 27 Jan 2013 23:21:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RNLqpJ028203; Sun, 27 Jan 2013 23:21:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RNLqKG028201; Sun, 27 Jan 2013 23:21:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301272321.r0RNLqKG028201@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 23:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246015 - in stable/8/sys/sparc64: include sparc64 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 27 Jan 2013 23:21:52 -0000 Author: marius Date: Sun Jan 27 23:21:51 2013 New Revision: 246015 URL: http://svnweb.freebsd.org/changeset/base/246015 Log: MFC: r245850 Revert the part of r239864 (MFC'ed to stable/8 in r241690) which removed obtaining the SMP mutex around reading registers from other CPUs. As it turns out, the hardware doesn't really like concurrent IPI'ing causing adverse effects. Also the thought deadlock when using this spin lock here and the targeted CPU(s) are also holding or in case of nested locks can't actually happen. This is due to the fact that on sparc64, spinlock_enter() only raises the PIL but doesn't disable interrupts completely. Thus direct cross calls as used for the register reading (and all other MD IPI needs) still will be executed by the targeted CPU(s) in that case. Modified: stable/8/sys/sparc64/include/smp.h stable/8/sys/sparc64/sparc64/tick.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Sun Jan 27 23:21:47 2013 (r246014) +++ stable/8/sys/sparc64/include/smp.h Sun Jan 27 23:21:51 2013 (r246015) @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -195,6 +196,7 @@ ipi_rd(u_int cpu, void *func, u_long *va return (NULL); sched_pin(); ira = &ipi_rd_args; + mtx_lock_spin(&smp_ipi_mtx); ira->ira_mask = 1 << cpu; ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); @@ -282,18 +284,6 @@ ipi_wait(void *cookie) } } -static __inline void -ipi_wait_unlocked(void *cookie) -{ - volatile cpumask_t *mask; - - if ((mask = cookie) != NULL) { - while (*mask != 0) - ; - sched_unpin(); - } -} - #endif /* _MACHINE_PMAP_H_ && _SYS_MUTEX_H_ */ #endif /* !LOCORE */ @@ -352,12 +342,6 @@ ipi_wait(void *cookie __unused) } static __inline void -ipi_wait_unlocked(void *cookie __unused) -{ - -} - -static __inline void tl_ipi_cheetah_dcache_page_inval(void) { Modified: stable/8/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tick.c Sun Jan 27 23:21:47 2013 (r246014) +++ stable/8/sys/sparc64/sparc64/tick.c Sun Jan 27 23:21:51 2013 (r246015) @@ -314,7 +314,7 @@ stick_get_timecount_mp(struct timecounte if (curcpu == 0) stick = rdstick(); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_stick_rd, &stick)); + ipi_wait(ipi_rd(0, tl_ipi_stick_rd, &stick)); sched_unpin(); return (stick); } @@ -328,7 +328,7 @@ tick_get_timecount_mp(struct timecounter if (curcpu == 0) tick = rd(tick); else - ipi_wait_unlocked(ipi_rd(0, tl_ipi_tick_rd, &tick)); + ipi_wait(ipi_rd(0, tl_ipi_tick_rd, &tick)); sched_unpin(); return (tick); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 28 00:31:56 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C89A434; Mon, 28 Jan 2013 00:31:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1099DE39; Mon, 28 Jan 2013 00:31:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S0Vtxd048981; Mon, 28 Jan 2013 00:31:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S0Vt4U048980; Mon, 28 Jan 2013 00:31:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301280031.r0S0Vt4U048980@svn.freebsd.org> From: Marius Strobl Date: Mon, 28 Jan 2013 00: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 Subject: svn commit: r246019 - stable/8/sys/dev/cas X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Jan 2013 00:31:56 -0000 Author: marius Date: Mon Jan 28 00:31:55 2013 New Revision: 246019 URL: http://svnweb.freebsd.org/changeset/base/246019 Log: MFC: r245923 - Check the return value of taskqueue_start_threads(). - At least the Saturn chips of 501-6738 cards need a delay after freezing the external GMII pins before the internal PHY is accessible again. So wait a bit after (un)freezing these. Also don't touch the other bits of that configuration register. [1] - Take advantage of nitems(). Reported and tested by: Paul Keusemann [1] Modified: stable/8/sys/dev/cas/if_cas.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cas/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Mon Jan 28 00:31:32 2013 (r246018) +++ stable/8/sys/dev/cas/if_cas.c Mon Jan 28 00:31:55 2013 (r246019) @@ -214,8 +214,12 @@ cas_attach(struct cas_softc *sc) error = ENXIO; goto fail_ifnet; } - taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + error = taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->sc_dev)); + if (error != 0) { + device_printf(sc->sc_dev, "could not start threads\n"); + goto fail_taskq; + } /* Make sure the chip is stopped. */ cas_reset(sc); @@ -339,10 +343,13 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* Enable/unfreeze the GMII pins of Saturn. */ if (sc->sc_variant == CAS_SATURN) { - CAS_WRITE_4(sc, CAS_SATURN_PCFG, 0); + CAS_WRITE_4(sc, CAS_SATURN_PCFG, + CAS_READ_4(sc, CAS_SATURN_PCFG) & + ~CAS_SATURN_PCFG_FSI); CAS_BARRIER(sc, CAS_SATURN_PCFG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(10000); } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, @@ -359,10 +366,12 @@ cas_attach(struct cas_softc *sc) /* Freeze the GMII pins of Saturn for saving power. */ if (sc->sc_variant == CAS_SATURN) { CAS_WRITE_4(sc, CAS_SATURN_PCFG, + CAS_READ_4(sc, CAS_SATURN_PCFG) | CAS_SATURN_PCFG_FSI); CAS_BARRIER(sc, CAS_SATURN_PCFG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(10000); } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, @@ -2871,7 +2880,7 @@ cas_pci_attach(device_t dev) goto fail; } i = 0; - if (lma > 1 && pci_get_slot(dev) < sizeof(enaddr) / sizeof(*enaddr)) + if (lma > 1 && pci_get_slot(dev) < nitems(enaddr)) i = pci_get_slot(dev); memcpy(sc->sc_enaddr, enaddr[i], ETHER_ADDR_LEN); @@ -2880,7 +2889,7 @@ cas_pci_attach(device_t dev) goto fail; } i = 0; - if (phy > 1 && pci_get_slot(dev) < sizeof(pcs) / sizeof(*pcs)) + if (phy > 1 && pci_get_slot(dev) < nitems(pcs)) i = pci_get_slot(dev); if (pcs[i] != 0) sc->sc_flags |= CAS_SERDES; From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 28 07:28:54 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0D4BC9AA; Mon, 28 Jan 2013 07:28:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4BFFE33; Mon, 28 Jan 2013 07:28:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0S7Srra072643; Mon, 28 Jan 2013 07:28:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0S7Sr1C072641; Mon, 28 Jan 2013 07:28:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301280728.r0S7Sr1C072641@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 28 Jan 2013 07:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246023 - in stable/8/sys/dev/usb: . quirk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Jan 2013 07:28:54 -0000 Author: hselasky Date: Mon Jan 28 07:28:52 2013 New Revision: 246023 URL: http://svnweb.freebsd.org/changeset/base/246023 Log: MFC r245725: Add new quirk and correct old one. PR: usb/175454 MFC after: 1 week Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 07:26:45 2013 (r246022) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Mon Jan 28 07:28:52 2013 (r246023) @@ -299,7 +299,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(ONSPEC, READER, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(ONSPEC, UCF100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY | UQ_MSC_NO_GETMAXLUN), + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(ONSPEC2, IMAGEMATE_SDDR55, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(PANASONIC, KXL840AN, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, @@ -335,6 +335,8 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(SANDISK, SDDR31, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), + USB_QUIRK(SANDISK, IMAGEMATE_SDDR289, 0x0000, 0xffff, + UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(SCANLOGIC, SL11R, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), USB_QUIRK(SHUTTLE, EUSB, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Jan 28 07:26:45 2013 (r246022) +++ stable/8/sys/dev/usb/usbdevs Mon Jan 28 07:28:52 2013 (r246023) @@ -3559,6 +3559,7 @@ product SANDISK SDDR75 0x0810 ImageMate product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB +product SANDISK IMAGEMATE_SDDR289 0xb6ba ImageMate SDDR-289 /* Sanwa Electric Instrument Co., Ltd. products */ product SANWA KB_USB2 0x0701 KB-USB2 multimeter cable From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 29 17:22:54 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9DCB97BA; Tue, 29 Jan 2013 17:22:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E756A42; Tue, 29 Jan 2013 17:22:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THMsXN084601; Tue, 29 Jan 2013 17:22:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THMsXk084600; Tue, 29 Jan 2013 17:22:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291722.r0THMsXk084600@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246077 - stable/8/sys/geom/mirror X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Jan 2013 17:22:54 -0000 Author: mav Date: Tue Jan 29 17:22:53 2013 New Revision: 246077 URL: http://svnweb.freebsd.org/changeset/base/246077 Log: MFC r245443: Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM MIRROR to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. PR: kern/113957 Modified: stable/8/sys/geom/mirror/g_mirror.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.c Tue Jan 29 17:20:49 2013 (r246076) +++ stable/8/sys/geom/mirror/g_mirror.c Tue Jan 29 17:22:53 2013 (r246077) @@ -78,7 +78,8 @@ SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, G_MIRROR_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_mirror_pre_sync = NULL; +static eventhandler_tag g_mirror_post_sync = NULL; +static int g_mirror_shutdown = 0; static int g_mirror_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -807,7 +808,7 @@ g_mirror_idle(struct g_mirror_softc *sc, return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_mirror_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_mirror_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -2807,7 +2808,7 @@ g_mirror_access(struct g_provider *pp, i error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_mirror_idle(sc, dcw); if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3213,7 +3214,7 @@ g_mirror_dumpconf(struct sbuf *sb, const } static void -g_mirror_shutdown_pre_sync(void *arg, int howto) +g_mirror_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3223,6 +3224,7 @@ g_mirror_shutdown_pre_sync(void *arg, in mp = arg; DROP_GIANT(); g_topology_lock(); + g_mirror_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3231,6 +3233,7 @@ g_mirror_shutdown_pre_sync(void *arg, in continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_mirror_idle(sc, -1); g_cancel_event(sc); error = g_mirror_destroy(sc, G_MIRROR_DESTROY_DELAYED); if (error != 0) @@ -3245,9 +3248,9 @@ static void g_mirror_init(struct g_class *mp) { - g_mirror_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_mirror_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_mirror_pre_sync == NULL) + g_mirror_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_mirror_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_mirror_post_sync == NULL) G_MIRROR_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3255,8 +3258,8 @@ static void g_mirror_fini(struct g_class *mp) { - if (g_mirror_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_mirror_pre_sync); + if (g_mirror_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_mirror_post_sync); } DECLARE_GEOM_CLASS(g_mirror_class, g_mirror); From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 29 17:37:02 2013 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4824BC92; Tue, 29 Jan 2013 17:37:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A915CAEE; Tue, 29 Jan 2013 17:36:57 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA16210; Tue, 29 Jan 2013 19:36:50 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <510808B2.2090305@FreeBSD.org> Date: Tue, 29 Jan 2013 19:36:50 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130113 Thunderbird/17.0.2 MIME-Version: 1.0 To: Alexander Motin Subject: Re: svn commit: r246077 - stable/8/sys/geom/mirror References: <201301291722.r0THMsXk084600@svn.freebsd.org> In-Reply-To: <201301291722.r0THMsXk084600@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Jan 2013 17:37:02 -0000 on 29/01/2013 19:22 Alexander Motin said the following: > ZFS tends to not close devices on shutdown BTW, I have a patch for this. It makes the code a little bit uglier, so I am not sure if we'd want it. Anyone is interested? :) -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 29 17:47:08 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1EBE63DD; Tue, 29 Jan 2013 17:47:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 10896C19; Tue, 29 Jan 2013 17:47:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THl7cF091162; Tue, 29 Jan 2013 17:47:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THl7Mu091161; Tue, 29 Jan 2013 17:47:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291747.r0THl7Mu091161@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246080 - stable/8/sys/geom/raid3 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Jan 2013 17:47:08 -0000 Author: mav Date: Tue Jan 29 17:47:07 2013 New Revision: 246080 URL: http://svnweb.freebsd.org/changeset/base/246080 Log: MFC r245444: Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID3 to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. Modified: stable/8/sys/geom/raid3/g_raid3.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/8/sys/geom/raid3/g_raid3.c Tue Jan 29 17:45:05 2013 (r246079) +++ stable/8/sys/geom/raid3/g_raid3.c Tue Jan 29 17:47:07 2013 (r246080) @@ -101,7 +101,8 @@ SYSCTL_UINT(_kern_geom_raid3_stat, OID_A G_RAID3_DEBUG(4, "%s: Woken up %p.", __func__, (ident)); \ } while (0) -static eventhandler_tag g_raid3_pre_sync = NULL; +static eventhandler_tag g_raid3_post_sync = NULL; +static int g_raid3_shutdown = 0; static int g_raid3_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -873,7 +874,7 @@ g_raid3_idle(struct g_raid3_softc *sc, i return (0); if (acw > 0 || (acw == -1 && sc->sc_provider->acw > 0)) { timeout = g_raid3_idletime - (time_uptime - sc->sc_last_write); - if (timeout > 0) + if (!g_raid3_shutdown && timeout > 0) return (timeout); } sc->sc_idle = 1; @@ -3095,7 +3096,7 @@ g_raid3_access(struct g_provider *pp, in error = ENXIO; goto end; } - if (dcw == 0 && !sc->sc_idle) + if (dcw == 0) g_raid3_idle(sc, dcw); if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROYING) != 0) { if (acr > 0 || acw > 0 || ace > 0) { @@ -3536,7 +3537,7 @@ g_raid3_dumpconf(struct sbuf *sb, const } static void -g_raid3_shutdown_pre_sync(void *arg, int howto) +g_raid3_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; @@ -3546,6 +3547,7 @@ g_raid3_shutdown_pre_sync(void *arg, int mp = arg; DROP_GIANT(); g_topology_lock(); + g_raid3_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; @@ -3554,6 +3556,7 @@ g_raid3_shutdown_pre_sync(void *arg, int continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + g_raid3_idle(sc, -1); g_cancel_event(sc); error = g_raid3_destroy(sc, G_RAID3_DESTROY_DELAYED); if (error != 0) @@ -3568,9 +3571,9 @@ static void g_raid3_init(struct g_class *mp) { - g_raid3_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_raid3_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_raid3_pre_sync == NULL) + g_raid3_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_raid3_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_raid3_post_sync == NULL) G_RAID3_DEBUG(0, "Warning! Cannot register shutdown event."); } @@ -3578,8 +3581,8 @@ static void g_raid3_fini(struct g_class *mp) { - if (g_raid3_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid3_pre_sync); + if (g_raid3_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid3_post_sync); } DECLARE_GEOM_CLASS(g_raid3_class, g_raid3); From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 29 17:54:27 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B71DC87E; Tue, 29 Jan 2013 17:54:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A41D7CE4; Tue, 29 Jan 2013 17:54:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0THsRJG093901; Tue, 29 Jan 2013 17:54:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0THsRU8093898; Tue, 29 Jan 2013 17:54:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301291754.r0THsRU8093898@svn.freebsd.org> From: Alexander Motin Date: Tue, 29 Jan 2013 17:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246082 - in stable/8: sbin/geom/class/raid3 sys/geom/raid3 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Jan 2013 17:54:27 -0000 Author: mav Date: Tue Jan 29 17:54:26 2013 New Revision: 246082 URL: http://svnweb.freebsd.org/changeset/base/246082 Log: MFC r245456: Allow to insert new component to geom_raid3 without specifying number. PR: kern/160562 Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c stable/8/sbin/geom/class/raid3/graid3.8 stable/8/sys/geom/raid3/g_raid3_ctl.c Directory Properties: stable/8/sbin/geom/class/raid3/ (props changed) stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- stable/8/sbin/geom/class/raid3/geom_raid3.c Tue Jan 29 17:51:12 2013 (r246081) +++ stable/8/sbin/geom/class/raid3/geom_raid3.c Tue Jan 29 17:54:26 2013 (r246082) @@ -76,7 +76,7 @@ struct g_command class_commands[] = { { "insert", G_FLAG_VERBOSE, NULL, { { 'h', "hardcode", NULL, G_TYPE_BOOL }, - { 'n', "number", NULL, G_TYPE_NUMBER }, + { 'n', "number", G_VAL_OPTIONAL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, NULL, "[-hv] <-n number> name prov" Modified: stable/8/sbin/geom/class/raid3/graid3.8 ============================================================================== --- stable/8/sbin/geom/class/raid3/graid3.8 Tue Jan 29 17:51:12 2013 (r246081) +++ stable/8/sbin/geom/class/raid3/graid3.8 Tue Jan 29 17:54:26 2013 (r246082) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd January 15, 2012 .Dt GRAID3 8 .Os .Sh NAME @@ -52,7 +52,7 @@ .Nm .Cm insert .Op Fl hv -.Fl n Ar number +.Op Fl n Ar number .Ar name .Ar prov .Nm @@ -164,6 +164,8 @@ Add the given component to the existing removed previously with the .Cm remove command or if one component is missing and will not be connected again. +If no number is given, new component will be added instead of first missed +component. .Pp Additional options include: .Bl -tag -width ".Fl h" Modified: stable/8/sys/geom/raid3/g_raid3_ctl.c ============================================================================== --- stable/8/sys/geom/raid3/g_raid3_ctl.c Tue Jan 29 17:51:12 2013 (r246081) +++ stable/8/sys/geom/raid3/g_raid3_ctl.c Tue Jan 29 17:54:26 2013 (r246082) @@ -404,7 +404,7 @@ g_raid3_ctl_insert(struct gctl_req *req, u_char *sector; off_t compsize; intmax_t *no; - int *hardcode, *nargs, error; + int *hardcode, *nargs, error, autono; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -425,11 +425,10 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No 'arg%u' argument.", 1); return; } - no = gctl_get_paraml(req, "number", sizeof(*no)); - if (no == NULL) { - gctl_error(req, "No '%s' argument.", "no"); - return; - } + if (gctl_get_param(req, "number", NULL) != NULL) + no = gctl_get_paraml(req, "number", sizeof(*no)); + else + no = NULL; if (strncmp(name, "/dev/", 5) == 0) name += 5; g_topology_lock(); @@ -465,16 +464,30 @@ g_raid3_ctl_insert(struct gctl_req *req, gctl_error(req, "No such device: %s.", name); goto end; } - if (*no >= sc->sc_ndisks) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Invalid component number."); - goto end; - } - disk = &sc->sc_disks[*no]; - if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { - sx_xunlock(&sc->sc_lock); - gctl_error(req, "Component %jd is already connected.", *no); - goto end; + if (no != NULL) { + if (*no < 0 || *no >= sc->sc_ndisks) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Invalid component number."); + goto end; + } + disk = &sc->sc_disks[*no]; + if (disk->d_state != G_RAID3_DISK_STATE_NODISK) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Component %jd is already connected.", + *no); + goto end; + } + } else { + disk = NULL; + for (autono = 0; autono < sc->sc_ndisks && disk == NULL; autono++) + if (sc->sc_disks[autono].d_state == + G_RAID3_DISK_STATE_NODISK) + disk = &sc->sc_disks[autono]; + if (disk == NULL) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "No disconnected components."); + goto end; + } } if (((sc->sc_sectorsize / (sc->sc_ndisks - 1)) % pp->sectorsize) != 0) { sx_xunlock(&sc->sc_lock); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 20:32:12 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C15F3C8; Thu, 31 Jan 2013 20:32:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D712F99; Thu, 31 Jan 2013 20:32:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKWCBE016212; Thu, 31 Jan 2013 20:32:12 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKWBSC016209; Thu, 31 Jan 2013 20:32:11 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301312032.r0VKWBSC016209@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Jan 2013 20:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246155 - stable/8/sys/dev/ciss X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 20:32:12 -0000 Author: sbruno Date: Thu Jan 31 20:32:11 2013 New Revision: 246155 URL: http://svnweb.freebsd.org/changeset/base/246155 Log: MFC r245459 Satisfy the intent of kern/151564: [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 107 Submitter wanted to increase the number of logical disks supported by ciss(4) by simply raising the CISS_MAX_LOGICAL value even higher. Instead, consult the documentation for the raid controller (OPENCISS) and poke the controller bits to ask it for how many logical/physical disks it can handle. Revert svn R242089 that raised CISS_MAX_LOGICAL to 64 for all controllers. For older controllers that don't support this mechanism, fallback to the old value of 16 logical disks. Tested on P420, P410, P400 and 6i model ciss(4) controllers. This should will be MFC'd back to stable/9 stable/8 and stable/7 after the MFC period. Modified: stable/8/sys/dev/ciss/ciss.c stable/8/sys/dev/ciss/cissreg.h stable/8/sys/dev/ciss/cissvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ciss/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Thu Jan 31 20:17:02 2013 (r246154) +++ stable/8/sys/dev/ciss/ciss.c Thu Jan 31 20:32:11 2013 (r246155) @@ -1202,13 +1202,21 @@ ciss_identify_adapter(struct ciss_softc /* XXX only really required for old 5300 adapters? */ sc->ciss_flags |= CISS_FLAG_BMIC_ABORT; + /* + * Earlier controller specs do not contain these config + * entries, so assume that a 0 means its old and assign + * these values to the defaults that were established + * when this driver was developed for them + */ + if (sc->ciss_cfg->max_logical_supported == 0) + sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL; + if (sc->ciss_cfg->max_physical_supported == 0) + sc->ciss_cfg->max_physical_supported = CISS_MAX_PHYSICAL; /* print information */ if (bootverbose) { -#if 0 /* XXX proxy volumes??? */ ciss_printf(sc, " %d logical drive%s configured\n", sc->ciss_id->configured_logical_drives, (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); -#endif ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_bus_count); @@ -1231,6 +1239,9 @@ ciss_identify_adapter(struct ciss_softc "\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); + ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); + ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); + ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); } out: @@ -1318,7 +1329,7 @@ ciss_report_luns(struct ciss_softc *sc, break; case CISS_CMD_STATUS_DATA_OVERRUN: ciss_printf(sc, "WARNING: more units than driver limit (%d)\n", - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); break; default: ciss_printf(sc, "error detecting logical drive configuration (%s)\n", @@ -1352,7 +1363,7 @@ ciss_init_logical(struct ciss_softc *sc) debug_called(1); cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1360,9 +1371,9 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives > sc->ciss_cfg->max_logical_supported)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", - ndrives, CISS_MAX_LOGICAL); + ndrives, sc->ciss_cfg->max_logical_supported); error = ENXIO; goto out; } @@ -1385,19 +1396,20 @@ ciss_init_logical(struct ciss_softc *sc) for (i = 0; i <= sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = - malloc(CISS_MAX_LOGICAL * sizeof(struct ciss_ldrive), + malloc(sc->ciss_cfg->max_logical_supported * + sizeof(struct ciss_ldrive), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); if (sc->ciss_logical[i] == NULL) { error = ENXIO; goto out; } - for (j = 0; j < CISS_MAX_LOGICAL; j++) + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) sc->ciss_logical[i][j].cl_status = CISS_LD_NONEXISTENT; } - for (i = 0; i < CISS_MAX_LOGICAL; i++) { + for (i = 0; i < sc->ciss_cfg->max_logical_supported; i++) { if (i < ndrives) { struct ciss_ldrive *ld; int bus, target; @@ -1439,7 +1451,7 @@ ciss_init_physical(struct ciss_softc *sc target = 0; cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { error = ENXIO; goto out; @@ -1982,7 +1994,7 @@ ciss_free(struct ciss_softc *sc) bus_dma_tag_destroy(sc->ciss_parent_dmat); if (sc->ciss_logical) { for (i = 0; i <= sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { if (sc->ciss_logical[i][j].cl_ldrive) free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS); if (sc->ciss_logical[i][j].cl_lstatus) @@ -2965,9 +2977,9 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ cpi->target_sprt = 0; cpi->hba_misc = 0; - cpi->max_target = CISS_MAX_LOGICAL; + cpi->max_target = sc->ciss_cfg->max_logical_supported; cpi->max_lun = 0; /* 'logical drive' channel only */ - cpi->initiator_id = CISS_MAX_LOGICAL; + cpi->initiator_id = sc->ciss_cfg->max_logical_supported; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "msmith@freebsd.org", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); @@ -3874,7 +3886,7 @@ ciss_notify_rescan_logical(struct ciss_s * drive address. */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS, - CISS_MAX_LOGICAL); + sc->ciss_cfg->max_logical_supported); if (cll == NULL) return; @@ -3885,7 +3897,7 @@ ciss_notify_rescan_logical(struct ciss_s * firmware. */ for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ld = &sc->ciss_logical[i][j]; if (ld->cl_update == 0) @@ -4054,7 +4066,7 @@ ciss_notify_hotplug(struct ciss_softc *s * Rescan the physical lun list for new items */ cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, - CISS_MAX_PHYSICAL); + sc->ciss_cfg->max_physical_supported); if (cll == NULL) { ciss_printf(sc, "Warning, cannot get physical lun list\n"); break; @@ -4302,7 +4314,7 @@ ciss_print_adapter(struct ciss_softc *sc "\20\1notify_ok\2control_open\3aborting\4running\21fake_synch\22bmic_abort\n"); for (i = 0; i < sc->ciss_max_logical_bus; i++) { - for (j = 0; j < CISS_MAX_LOGICAL; j++) { + for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { ciss_printf(sc, "LOGICAL DRIVE %d: ", i); ciss_print_ldrive(sc, &sc->ciss_logical[i][j]); } Modified: stable/8/sys/dev/ciss/cissreg.h ============================================================================== --- stable/8/sys/dev/ciss/cissreg.h Thu Jan 31 20:17:02 2013 (r246154) +++ stable/8/sys/dev/ciss/cissreg.h Thu Jan 31 20:32:11 2013 (r246155) @@ -425,6 +425,15 @@ struct ciss_config_table #define CISS_DRIVER_DAUGHTER_ATTACHED (1<<8) #define CISS_DRIVER_SCSI_PREFETCH (1<<9) u_int32_t max_sg_length; /* 31 in older firmware */ +/* + * these fields appear in OpenCISS Spec 1.06 + * http://cciss.sourceforge.net/#docs + */ + u_int32_t max_logical_supported; + u_int32_t max_physical_supported; + u_int32_t max_physical_per_logical; + u_int32_t max_perfomant_mode_cmds; + u_int32_t max_block_fetch_count; } __packed; /* Modified: stable/8/sys/dev/ciss/cissvar.h ============================================================================== --- stable/8/sys/dev/ciss/cissvar.h Thu Jan 31 20:17:02 2013 (r246154) +++ stable/8/sys/dev/ciss/cissvar.h Thu Jan 31 20:32:11 2013 (r246155) @@ -45,6 +45,9 @@ typedef STAILQ_HEAD(, ciss_request) cr_q /* * Maximum number of logical drives we support. + * If the controller does not indicate a maximum + * value. This is a compatibiliy value to support + * older ciss controllers (e.g. model 6i) */ #define CISS_MAX_LOGICAL 15 From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 20:48:57 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 17C73810; Thu, 31 Jan 2013 20:48:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F193BB5; Thu, 31 Jan 2013 20:48:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VKmuRY020035; Thu, 31 Jan 2013 20:48:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VKmuxH020034; Thu, 31 Jan 2013 20:48:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312048.r0VKmuxH020034@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 20:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246157 - stable/8/sys/dev/ahci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 20:48:57 -0000 Author: mav Date: Thu Jan 31 20:48:56 2013 New Revision: 246157 URL: http://svnweb.freebsd.org/changeset/base/246157 Log: MFC r245875: Disable MSI interrupts for SB600 chipset. According to the report they are not functional. PR: kern/174880, kern/174985, kern/175002 Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Jan 31 20:47:35 2013 (r246156) +++ stable/8/sys/dev/ahci/ahci.c Thu Jan 31 20:48:56 2013 (r246157) @@ -120,8 +120,9 @@ static struct { #define AHCI_Q_NOAA 512 #define AHCI_Q_NOCOUNT 1024 #define AHCI_Q_ALTSIG 2048 +#define AHCI_Q_NOMSI 4096 } ahci_ids[] = { - {0x43801002, 0x00, "ATI IXP600", 0}, + {0x43801002, 0x00, "ATI IXP600", AHCI_Q_NOMSI}, {0x43901002, 0x00, "ATI IXP700", 0}, {0x43911002, 0x00, "ATI IXP700", 0}, {0x43921002, 0x00, "ATI IXP700", 0}, @@ -641,6 +642,8 @@ ahci_setup_interrupt(device_t dev) int i, msi = 1; /* Process hints. */ + if (ctlr->quirks & AHCI_Q_NOMSI) + msi = 0; resource_int_value(device_get_name(dev), device_get_unit(dev), "msi", &msi); if (msi < 0) From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 21:26:03 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 31251735; Thu, 31 Jan 2013 21:26:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F451278; Thu, 31 Jan 2013 21:26:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VLQ2Tx032256; Thu, 31 Jan 2013 21:26:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VLQ2Fu032255; Thu, 31 Jan 2013 21:26:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312126.r0VLQ2Fu032255@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 21:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246161 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 21:26:03 -0000 Author: mav Date: Thu Jan 31 21:26:02 2013 New Revision: 246161 URL: http://svnweb.freebsd.org/changeset/base/246161 Log: MFC r245519: Recalculate volume size only for real CONCATs. For SINGLE trust volume size given by metadata, as it should be correct and in some cases can be smaller then subdisk size. Modified: stable/8/sys/geom/raid/tr_concat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/tr_concat.c ============================================================================== --- stable/8/sys/geom/raid/tr_concat.c Thu Jan 31 21:24:38 2013 (r246160) +++ stable/8/sys/geom/raid/tr_concat.c Thu Jan 31 21:26:02 2013 (r246161) @@ -124,7 +124,8 @@ g_raid_tr_update_state_concat(struct g_r * Some metadata modules may not know CONCAT volume * mediasize until all disks connected. Recalculate. */ - if (G_RAID_VOLUME_S_ALIVE(s) && + if (vol->v_raid_level == G_RAID_VOLUME_RL_CONCAT && + G_RAID_VOLUME_S_ALIVE(s) && !G_RAID_VOLUME_S_ALIVE(vol->v_state)) { size = 0; for (i = 0; i < vol->v_disks_count; i++) { From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 22:07:32 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9EE84514; Thu, 31 Jan 2013 22:07:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 84A256A6; Thu, 31 Jan 2013 22:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VM7WvB044386; Thu, 31 Jan 2013 22:07:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VM7Wt4044384; Thu, 31 Jan 2013 22:07:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312207.r0VM7Wt4044384@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246165 - in stable/8: sbin/geom/class/raid sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 22:07:32 -0000 Author: mav Date: Thu Jan 31 22:07:31 2013 New Revision: 246165 URL: http://svnweb.freebsd.org/changeset/base/246165 Log: MFC r245522, r245533: For Promise/AMD metadata add support for disks with capacity above 2TiB and for volumes with sector size above 512 bytes. Modified: stable/8/sbin/geom/class/raid/graid.8 stable/8/sys/geom/raid/md_promise.c Directory Properties: stable/8/sbin/geom/class/raid/ (props changed) stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Thu Jan 31 22:05:18 2013 (r246164) +++ stable/8/sbin/geom/class/raid/graid.8 Thu Jan 31 22:07:31 2013 (r246165) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2012 +.Dd January 16, 2013 .Dt GRAID 8 .Os .Sh NAME @@ -274,7 +274,6 @@ complete it there. Do not run GEOM RAID class on migrating volumes under pain of possible data corruption! .Sh 2TiB BARRIERS -Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. .Sh SYSCTL VARIABLES The following Modified: stable/8/sys/geom/raid/md_promise.c ============================================================================== --- stable/8/sys/geom/raid/md_promise.c Thu Jan 31 22:05:18 2013 (r246164) +++ stable/8/sys/geom/raid/md_promise.c Thu Jan 31 22:07:31 2013 (r246165) @@ -84,7 +84,7 @@ struct promise_raid_conf { struct promise_raid_disk disk; /* This subdisk info. */ uint32_t disk_offset; /* Subdisk offset. */ uint32_t disk_sectors; /* Subdisk size */ - uint32_t rebuild_lba; /* Rebuild position. */ + uint32_t disk_rebuild; /* Rebuild position. */ uint16_t generation; /* Generation number. */ uint8_t status; /* Volume status. */ #define PROMISE_S_VALID 0x01 @@ -123,7 +123,18 @@ struct promise_raid_conf { uint32_t magic_4; uint32_t magic_5; uint32_t total_sectors_high; - uint32_t filler3[324]; + uint8_t magic_6; + uint8_t sector_size; + uint16_t magic_7; + uint32_t magic_8[31]; + uint32_t backup_time; + uint16_t magic_9; + uint32_t disk_offset_high; + uint32_t disk_sectors_high; + uint32_t disk_rebuild_high; + uint16_t magic_10; + uint32_t magic_11[3]; + uint32_t filler3[284]; uint32_t checksum; } __packed; @@ -191,7 +202,7 @@ g_raid_md_promise_print(struct promise_r meta->disk.device, meta->disk.id); printf("disk_offset %u\n", meta->disk_offset); printf("disk_sectors %u\n", meta->disk_sectors); - printf("rebuild_lba %u\n", meta->rebuild_lba); + printf("disk_rebuild %u\n", meta->disk_rebuild); printf("generation %u\n", meta->generation); printf("status 0x%02x\n", meta->status); printf("type %u\n", meta->type); @@ -217,6 +228,11 @@ g_raid_md_promise_print(struct promise_r printf("magic_4 0x%08x\n", meta->magic_4); printf("magic_5 0x%08x\n", meta->magic_5); printf("total_sectors_high 0x%08x\n", meta->total_sectors_high); + printf("sector_size %u\n", meta->sector_size); + printf("backup_time %d\n", meta->backup_time); + printf("disk_offset_high 0x%08x\n", meta->disk_offset_high); + printf("disk_sectors_high 0x%08x\n", meta->disk_sectors_high); + printf("disk_rebuild_high 0x%08x\n", meta->disk_rebuild_high); printf("=================================================\n"); } @@ -244,9 +260,9 @@ promise_meta_find_disk(struct promise_ra static int promise_meta_unused_range(struct promise_raid_conf **metaarr, int nsd, - uint32_t sectors, uint32_t *off, uint32_t *size) + off_t sectors, off_t *off, off_t *size) { - uint32_t coff, csize; + off_t coff, csize, tmp; int i, j; sectors -= 131072; @@ -257,10 +273,10 @@ promise_meta_unused_range(struct promise i = 0; while (1) { for (j = 0; j < nsd; j++) { - if (metaarr[j]->disk_offset >= coff) { - csize = MIN(csize, - metaarr[j]->disk_offset - coff); - } + tmp = ((off_t)metaarr[j]->disk_offset_high << 32) + + metaarr[j]->disk_offset; + if (tmp >= coff) + csize = MIN(csize, tmp - coff); } if (csize > *size) { *off = coff; @@ -268,7 +284,10 @@ promise_meta_unused_range(struct promise } if (i >= nsd) break; - coff = metaarr[i]->disk_offset + metaarr[i]->disk_sectors; + coff = ((off_t)metaarr[i]->disk_offset_high << 32) + + metaarr[i]->disk_offset + + ((off_t)metaarr[i]->disk_sectors_high << 32) + + metaarr[i]->disk_sectors; csize = sectors - coff; i++; }; @@ -369,6 +388,26 @@ next: return (subdisks); } + /* Remove filler garbage from fields used in newer metadata. */ + if (meta->disk_offset_high == 0x8b8c8d8e && + meta->disk_sectors_high == 0x8788898a && + meta->disk_rebuild_high == 0x83848586) { + meta->disk_offset_high = 0; + meta->disk_sectors_high = 0; + if (meta->disk_rebuild == UINT32_MAX) + meta->disk_rebuild_high = UINT32_MAX; + else + meta->disk_rebuild_high = 0; + if (meta->total_sectors_high == 0x15161718) { + meta->total_sectors_high = 0; + meta->backup_time = 0; + if (meta->rebuild_lba64 == 0x2122232425262728) + meta->rebuild_lba64 = UINT64_MAX; + } + } + if (meta->sector_size < 1 || meta->sector_size > 8) + meta->sector_size = 1; + /* Save this part and look for next. */ *metaarr = meta; metaarr++; @@ -386,8 +425,9 @@ promise_meta_write(struct g_consumer *cp struct g_provider *pp; struct promise_raid_conf *meta; char *buf; + off_t off, size; int error, i, subdisk, fake; - uint32_t checksum, *ptr, off, size; + uint32_t checksum, *ptr; pp = cp->provider; subdisk = 0; @@ -409,9 +449,12 @@ next: meta->disk.flags = PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_offset = off; - meta->disk_sectors = size; - meta->rebuild_lba = UINT32_MAX; + meta->disk_offset_high = off >> 32; + meta->disk_offset = (uint32_t)off; + meta->disk_sectors_high = size >> 32; + meta->disk_sectors = (uint32_t)size; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; fake = 1; } if (meta != NULL) { @@ -464,6 +507,7 @@ static int promise_meta_write_spare(struct g_consumer *cp) { struct promise_raid_conf *meta; + off_t tmp; int error; meta = malloc(sizeof(*meta), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -473,9 +517,11 @@ promise_meta_write_spare(struct g_consum meta->disk.flags = PROMISE_F_SPARE | PROMISE_F_ONLINE | PROMISE_F_VALID; meta->disk.number = 0xff; arc4rand(&meta->disk.id, sizeof(meta->disk.id), 0); - meta->disk_sectors = cp->provider->mediasize / cp->provider->sectorsize; - meta->disk_sectors -= 131072; - meta->rebuild_lba = UINT32_MAX; + tmp = cp->provider->mediasize / cp->provider->sectorsize - 131072; + meta->disk_sectors_high = tmp >> 32; + meta->disk_sectors = (uint32_t)tmp; + meta->disk_rebuild_high = UINT32_MAX; + meta->disk_rebuild = UINT32_MAX; error = promise_meta_write(cp, &meta, 1); free(meta, M_MD_PROMISE); return (error); @@ -617,9 +663,8 @@ g_raid_md_promise_start_disk(struct g_ra struct g_raid_md_promise_perdisk *pd; struct g_raid_md_promise_pervolume *pv; struct promise_raid_conf *meta; - off_t size; + off_t eoff, esize, size; int disk_pos, md_disk_pos, i, resurrection = 0; - uint32_t eoff, esize; sc = disk->d_softc; pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; @@ -729,8 +774,10 @@ nofit: sd->sd_offset = (off_t)eoff * 512; sd->sd_size = (off_t)esize * 512; } else { - sd->sd_offset = (off_t)pd->pd_meta[sdn]->disk_offset * 512; - sd->sd_size = (off_t)pd->pd_meta[sdn]->disk_sectors * 512; + sd->sd_offset = (((off_t)pd->pd_meta[sdn]->disk_offset_high + << 32) + pd->pd_meta[sdn]->disk_offset) * 512; + sd->sd_size = (((off_t)pd->pd_meta[sdn]->disk_sectors_high + << 32) + pd->pd_meta[sdn]->disk_sectors) * 512; } if (resurrection) { @@ -749,7 +796,8 @@ nofit: sd->sd_rebuild_pos = 0; else { sd->sd_rebuild_pos = - (off_t)pd->pd_meta[sdn]->rebuild_lba * 512; + (((off_t)pd->pd_meta[sdn]->disk_rebuild_high << 32) + + pd->pd_meta[sdn]->disk_rebuild) * 512; } } else if (!(meta->disks[md_disk_pos].flags & PROMISE_F_ONLINE)) { /* Rebuilding disk. */ @@ -875,13 +923,15 @@ g_raid_md_promise_start(struct g_raid_vo vol->v_disks_count = meta->total_disks; vol->v_mediasize = (off_t)meta->total_sectors * 512; //ZZZ if (meta->total_sectors_high < 256) /* If value looks sane. */ - vol->v_mediasize |= + vol->v_mediasize += ((off_t)meta->total_sectors_high << 32) * 512; //ZZZ - vol->v_sectorsize = 512; //ZZZ + vol->v_sectorsize = 512 * meta->sector_size; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; - sd->sd_offset = (off_t)meta->disk_offset * 512; //ZZZ - sd->sd_size = (off_t)meta->disk_sectors * 512; //ZZZ + sd->sd_offset = (((off_t)meta->disk_offset_high << 32) + + meta->disk_offset) * 512; + sd->sd_size = (((off_t)meta->disk_sectors_high << 32) + + meta->disk_sectors) * 512; } g_raid_start_volume(vol); @@ -1213,9 +1263,8 @@ g_raid_md_ctl_promise(struct g_raid_md_o const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; - off_t size, sectorsize, strip; + off_t esize, offs[PROMISE_MAX_DISKS], size, sectorsize, strip; intmax_t *sizearg, *striparg; - uint32_t offs[PROMISE_MAX_DISKS], esize; int numdisks, i, len, level, qual; int error; @@ -1323,13 +1372,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - error = -8; - break; - } - g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ @@ -1394,10 +1436,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o gctl_error(req, "Size too small."); return (-13); } - if (size > 0xffffffffllu * sectorsize) { - gctl_error(req, "Size too big."); - return (-14); - } /* We have all we need, create things: volume, ... */ pv = malloc(sizeof(*pv), M_MD_PROMISE, M_WAITOK | M_ZERO); @@ -1629,14 +1667,6 @@ g_raid_md_ctl_promise(struct g_raid_md_o pp = cp->provider; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - g_raid_kill_consumer(sc, cp); - error = -8; - break; - } - pd = malloc(sizeof(*pd), M_MD_PROMISE, M_WAITOK | M_ZERO); disk = g_raid_create_disk(sc); @@ -1733,9 +1763,9 @@ g_raid_md_write_promise(struct g_raid_md vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) meta->array_width /= 2; meta->array_number = vol->v_global_id; - meta->total_sectors = vol->v_mediasize / vol->v_sectorsize; - meta->total_sectors_high = - (vol->v_mediasize / vol->v_sectorsize) >> 32; + meta->total_sectors = vol->v_mediasize / 512; + meta->total_sectors_high = (vol->v_mediasize / 512) >> 32; + meta->sector_size = vol->v_sectorsize / 512; meta->cylinders = meta->total_sectors / (255 * 63) - 1; meta->heads = 254; meta->sectors = 63; @@ -1828,15 +1858,24 @@ g_raid_md_write_promise(struct g_raid_md pd->pd_meta[j] = promise_meta_copy(meta); pd->pd_meta[j]->disk = meta->disks[pos]; pd->pd_meta[j]->disk.number = pos; + pd->pd_meta[j]->disk_offset_high = + (sd->sd_offset / 512) >> 32; pd->pd_meta[j]->disk_offset = sd->sd_offset / 512; + pd->pd_meta[j]->disk_sectors_high = + (sd->sd_size / 512) >> 32; pd->pd_meta[j]->disk_sectors = sd->sd_size / 512; if (sd->sd_state == G_RAID_SUBDISK_S_REBUILD) { - pd->pd_meta[j]->rebuild_lba = + pd->pd_meta[j]->disk_rebuild_high = + (sd->sd_rebuild_pos / 512) >> 32; + pd->pd_meta[j]->disk_rebuild = sd->sd_rebuild_pos / 512; - } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) - pd->pd_meta[j]->rebuild_lba = 0; - else - pd->pd_meta[j]->rebuild_lba = UINT32_MAX; + } else if (sd->sd_state < G_RAID_SUBDISK_S_REBUILD) { + pd->pd_meta[j]->disk_rebuild_high = 0; + pd->pd_meta[j]->disk_rebuild = 0; + } else { + pd->pd_meta[j]->disk_rebuild_high = UINT32_MAX; + pd->pd_meta[j]->disk_rebuild = UINT32_MAX; + } pd->pd_updated = 1; } } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 22:13:37 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 693C8CB3; Thu, 31 Jan 2013 22:13:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A9A76FD; Thu, 31 Jan 2013 22:13:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMDbYL047243; Thu, 31 Jan 2013 22:13:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMDaWM047237; Thu, 31 Jan 2013 22:13:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312213.r0VMDaWM047237@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246170 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 22:13:37 -0000 Author: mav Date: Thu Jan 31 22:13:36 2013 New Revision: 246170 URL: http://svnweb.freebsd.org/changeset/base/246170 Log: MFC r245326: Add basic support for Intel Rapid Recover Technology (Intel RRT). It is alike to RAID1, but with dedicating master and recovery disks and providing manual control over synchronization. It allows to use recovery disk as snapshot of the master disk from the time of the last sync. This implementation is not functionaly complete comparing to Windows, but it is better then silent conversion to RAID1 on first boot. Modified: stable/8/sys/geom/raid/g_raid.c stable/8/sys/geom/raid/g_raid.h stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu Jan 31 22:12:48 2013 (r246169) +++ stable/8/sys/geom/raid/g_raid.c Thu Jan 31 22:13:36 2013 (r246170) @@ -162,6 +162,8 @@ g_raid_disk_state2str(int state) return ("NONE"); case G_RAID_DISK_S_OFFLINE: return ("OFFLINE"); + case G_RAID_DISK_S_DISABLED: + return ("DISABLED"); case G_RAID_DISK_S_FAILED: return ("FAILED"); case G_RAID_DISK_S_STALE_FAILED: @@ -532,7 +534,9 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; - if (disk->d_state == G_RAID_DISK_S_FAILED || + if (disk->d_state == G_RAID_DISK_S_DISABLED) { + ; + } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; } else { Modified: stable/8/sys/geom/raid/g_raid.h ============================================================================== --- stable/8/sys/geom/raid/g_raid.h Thu Jan 31 22:12:48 2013 (r246169) +++ stable/8/sys/geom/raid/g_raid.h Thu Jan 31 22:13:36 2013 (r246170) @@ -140,11 +140,12 @@ struct g_raid_event { }; #define G_RAID_DISK_S_NONE 0x00 /* State is unknown. */ #define G_RAID_DISK_S_OFFLINE 0x01 /* Missing disk placeholder. */ -#define G_RAID_DISK_S_FAILED 0x02 /* Failed. */ -#define G_RAID_DISK_S_STALE_FAILED 0x03 /* Old failed. */ -#define G_RAID_DISK_S_SPARE 0x04 /* Hot-spare. */ -#define G_RAID_DISK_S_STALE 0x05 /* Old disk, unused now. */ -#define G_RAID_DISK_S_ACTIVE 0x06 /* Operational. */ +#define G_RAID_DISK_S_DISABLED 0x02 /* Disabled. */ +#define G_RAID_DISK_S_FAILED 0x03 /* Failed. */ +#define G_RAID_DISK_S_STALE_FAILED 0x04 /* Old failed. */ +#define G_RAID_DISK_S_SPARE 0x05 /* Hot-spare. */ +#define G_RAID_DISK_S_STALE 0x06 /* Old disk, unused now. */ +#define G_RAID_DISK_S_ACTIVE 0x07 /* Operational. */ #define G_RAID_DISK_E_DISCONNECTED 0x01 Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:12:48 2013 (r246169) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:13:36 2013 (r246170) @@ -98,6 +98,8 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; +#define INTEL_SNGST_NEEDS_UPDATE 1 +#define INTEL_SNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -130,6 +132,7 @@ struct intel_raid_disk { #define INTEL_F_ASSIGNED 0x02 #define INTEL_F_FAILED 0x04 #define INTEL_F_ONLINE 0x08 +#define INTEL_F_DISABLED 0x80 uint32_t owner_cfg_num; uint32_t sectors_hi; uint32_t filler[3]; @@ -187,6 +190,13 @@ struct g_raid_md_intel_perdisk { struct intel_raid_disk pd_disk_meta; }; +struct g_raid_md_intel_pervolume { + int pv_volume_pos; + int pv_cng; + int pv_cng_man_sync; + int pv_cng_master_disk; +}; + struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; @@ -206,6 +216,7 @@ static g_raid_md_ctl_t g_raid_md_ctl_int static g_raid_md_write_t g_raid_md_write_intel; static g_raid_md_fail_disk_t g_raid_md_fail_disk_intel; static g_raid_md_free_disk_t g_raid_md_free_disk_intel; +static g_raid_md_free_volume_t g_raid_md_free_volume_intel; static g_raid_md_free_t g_raid_md_free_intel; static kobj_method_t g_raid_md_intel_methods[] = { @@ -216,6 +227,7 @@ static kobj_method_t g_raid_md_intel_met KOBJMETHOD(g_raid_md_write, g_raid_md_write_intel), KOBJMETHOD(g_raid_md_fail_disk, g_raid_md_fail_disk_intel), KOBJMETHOD(g_raid_md_free_disk, g_raid_md_free_disk_intel), + KOBJMETHOD(g_raid_md_free_volume, g_raid_md_free_volume_intel), KOBJMETHOD(g_raid_md_free, g_raid_md_free_intel), { 0, 0 } }; @@ -369,8 +381,15 @@ g_raid_md_intel_print(struct intel_raid_ printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state %u\n", mvol->state); + printf(" state 0x%08x\n", mvol->state); printf(" reserved %u\n", mvol->reserved); + printf(" migr_priority %u\n", mvol->migr_priority); + printf(" num_sub_vols %u\n", mvol->num_sub_vols); + printf(" tid %u\n", mvol->tid); + printf(" cng_master_disk %u\n", mvol->cng_master_disk); + printf(" cache_policy %u\n", mvol->cache_policy); + printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); @@ -699,9 +718,11 @@ static struct g_raid_volume * g_raid_md_intel_get_volume(struct g_raid_softc *sc, int id) { struct g_raid_volume *mvol; + struct g_raid_md_intel_pervolume *pv; TAILQ_FOREACH(mvol, &sc->sc_volumes, v_next) { - if ((intptr_t)(mvol->v_md_data) == id) + pv = mvol->v_md_data; + if (pv->pv_volume_pos == id) break; } return (mvol); @@ -715,6 +736,7 @@ g_raid_md_intel_start_disk(struct g_raid struct g_raid_disk *olddisk, *tmpdisk; struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd, *oldpd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -732,6 +754,11 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); + /* Disabled disk is useless for us. */ + if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + return (0); + } /* Failed stale disk is useless for us. */ if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); @@ -826,6 +853,8 @@ nofit: /* Welcome the new disk. */ if (resurrection) g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); + else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -833,8 +862,8 @@ nofit: else g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { - mvol = intel_get_volume(meta, - (uintptr_t)(sd->sd_volume->v_md_data)); + pv = sd->sd_volume->v_md_data; + mvol = intel_get_volume(meta, pv->pv_volume_pos); mmap0 = intel_get_map(mvol, 0); if (mvol->migr_state) mmap1 = intel_get_map(mvol, 1); @@ -845,12 +874,17 @@ nofit: /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); + } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + /* Disabled disk, useless. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NONE); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); } else if (mvol->migr_state == 0) { - if (mmap0->status == INTEL_S_UNINITIALIZED) { + if (mmap0->status == INTEL_S_UNINITIALIZED && + (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Freshly created uninitialized volume. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_UNINITIALIZED); @@ -858,7 +892,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -885,7 +920,8 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -1014,6 +1050,7 @@ g_raid_md_intel_start(struct g_raid_soft { struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -1032,7 +1069,13 @@ g_raid_md_intel_start(struct g_raid_soft mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); vol = g_raid_create_volume(sc, mvol->name, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; + pv->pv_cng_man_sync = (mvol->state & INTEL_ST_CLONE_MAN_SYNC) != 0; + if (mvol->cng_master_disk < mmap->total_disks) + pv->pv_cng_master_disk = mvol->cng_master_disk; + vol->v_md_data = pv; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_NONE; if (mmap->type == INTEL_T_RAID0) vol->v_raid_level = G_RAID_VOLUME_RL_RAID0; @@ -1450,6 +1493,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct g_consumer *cp; struct g_provider *pp; @@ -1621,7 +1665,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ mdi->mdio_started = 1; vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)0; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = 0; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -1814,7 +1860,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -2105,6 +2153,7 @@ g_raid_md_write_intel(struct g_raid_md_o struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -2133,7 +2182,11 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_ONLINE | INTEL_F_ASSIGNED; } else if (disk->d_state == G_RAID_DISK_S_FAILED) { - pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED; + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED; + } else if (disk->d_state == G_RAID_DISK_S_DISABLED) { + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { @@ -2165,12 +2218,13 @@ g_raid_md_write_intel(struct g_raid_md_o vi = 0; version = INTEL_VERSION_1000; TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + pv = vol->v_md_data; if (vol->v_stopping) continue; mvol = intel_get_volume(meta, vi); /* New metadata may have different volumes order. */ - vol->v_md_data = (void *)(intptr_t)vi; + pv->pv_volume_pos = vi; for (sdi = 0; sdi < vol->v_disks_count; sdi++) { sd = &vol->v_subdisks[sdi]; @@ -2192,8 +2246,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (meta->attributes & INTEL_ATTR_2TB) cv = INTEL_VERSION_1300; -// else if (dev->status == DEV_CLONE_N_GO) -// cv = INTEL_VERSION_1206; + else if (pv->pv_cng) + cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) @@ -2211,6 +2265,17 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + if (pv->pv_cng) { + mvol->state |= INTEL_ST_CLONE_N_GO; + if (pv->pv_cng_man_sync) + mvol->state |= INTEL_ST_CLONE_MAN_SYNC; + mvol->cng_master_disk = pv->pv_cng_master_disk; + if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == + G_RAID_SUBDISK_S_NONE) + mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) + mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + } /* Check for any recovery in progress. */ state = G_RAID_SUBDISK_S_ACTIVE; @@ -2403,6 +2468,18 @@ g_raid_md_free_disk_intel(struct g_raid_ } static int +g_raid_md_free_volume_intel(struct g_raid_md_object *md, + struct g_raid_volume *vol) +{ + struct g_raid_md_intel_pervolume *pv; + + pv = (struct g_raid_md_intel_pervolume *)vol->v_md_data; + free(pv, M_MD_INTEL); + vol->v_md_data = NULL; + return (0); +} + +static int g_raid_md_free_intel(struct g_raid_md_object *md) { struct g_raid_md_intel_object *mdi; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 22:16:52 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E4B5534E; Thu, 31 Jan 2013 22:16:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C88F3751; Thu, 31 Jan 2013 22:16:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMGq7j047924; Thu, 31 Jan 2013 22:16:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMGqMO047923; Thu, 31 Jan 2013 22:16:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312216.r0VMGqMO047923@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246174 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 22:16:53 -0000 Author: mav Date: Thu Jan 31 22:16:52 2013 New Revision: 246174 URL: http://svnweb.freebsd.org/changeset/base/246174 Log: MFC r245338: Implement migration from single disk to RAID1/IRRT for Intel metadata. Windows driver uses such migration when it creates new arrays. While GEOM RAID has no mechanism to implement migration in general case, this specifc case still can be handled easily via degraded RAID1 creation followed by regular rebuild. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:15:47 2013 (r246173) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:16:52 2013 (r246174) @@ -171,8 +171,13 @@ struct intel_raid_conf { uint8_t total_disks; uint8_t total_volumes; - uint8_t dummy_2[2]; - uint32_t filler_0[39]; + uint8_t error_log_pos; + uint8_t dummy_2[1]; + uint32_t cache_size; + uint32_t orig_family_num; + uint32_t pwr_cycle_count; + uint32_t bbm_log_size; + uint32_t filler_0[35]; struct intel_raid_disk disk[1]; /* total_disks entries. */ /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; @@ -366,9 +371,12 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_size 0x%08x\n", meta->config_size); printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); + printf("error_log_size %d\n", meta->error_log_size); printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); + printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("bbm_log_size %u\n", meta->bbm_log_size); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); for (i = 0; i < meta->total_disks; i++ ) { printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, @@ -451,7 +459,7 @@ intel_meta_read(struct g_consumer *cp) struct g_provider *pp; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; - struct intel_raid_map *mmap; + struct intel_raid_map *mmap, *mmap1; char *buf; int error, i, j, k, left, size; uint32_t checksum, *ptr; @@ -544,6 +552,8 @@ badsize: } } + g_raid_md_intel_print(meta); + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -566,16 +576,39 @@ badsize: /* Validate migration types. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); + /* Deny unknown migration types. */ if (mvol->migr_state && mvol->migr_type != INTEL_MT_INIT && mvol->migr_type != INTEL_MT_REBUILD && mvol->migr_type != INTEL_MT_VERIFY && + mvol->migr_type != INTEL_MT_GEN_MIGR && mvol->migr_type != INTEL_MT_REPAIR) { G_RAID_DEBUG(1, "Intel metadata has unsupported" " migration type %d", mvol->migr_type); free(meta, M_MD_INTEL); return (NULL); } + /* Deny general migrations except SINGLE->RAID1. */ + if (mvol->migr_state && + mvol->migr_type == INTEL_MT_GEN_MIGR) { + mmap = intel_get_map(mvol, 0); + mmap1 = intel_get_map(mvol, 1); + if (mmap1->total_disks != 1 || + mmap->type != INTEL_T_RAID1 || + mmap->total_disks != 2 || + mmap->offset != mmap1->offset || + mmap->disk_sectors != mmap1->disk_sectors || + mmap->total_domains != mmap->total_disks || + mmap->offset_hi != mmap1->offset_hi || + mmap->disk_sectors_hi != mmap1->disk_sectors_hi || + (mmap->disk_idx[0] != mmap1->disk_idx[0] && + mmap->disk_idx[0] != mmap1->disk_idx[1])) { + G_RAID_DEBUG(1, "Intel metadata has unsupported" + " variant of general migration"); + free(meta, M_MD_INTEL); + return (NULL); + } + } } return (meta); @@ -957,6 +990,16 @@ nofit: g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); } + } else if (mvol->migr_type == INTEL_MT_GEN_MIGR) { + if ((mmap1->disk_idx[0] & INTEL_DI_IDX) != disk_pos) { + /* Freshly inserted disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); + } else { + /* Up to date disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_ACTIVE); + } } g_raid_event_send(sd, G_RAID_SUBDISK_E_NEW, G_RAID_EVENT_SUBDISK); @@ -1337,8 +1380,6 @@ g_raid_md_taste_intel(struct g_raid_md_o goto fail1; } - /* Metadata valid. Print it. */ - g_raid_md_intel_print(meta); G_RAID_DEBUG(1, "Intel disk position %d", disk_pos); spare = meta->disk[disk_pos].flags & INTEL_F_SPARE; @@ -2370,7 +2411,8 @@ g_raid_md_write_intel(struct g_raid_md_o mmap1->disk_idx[sdi] |= INTEL_DI_RBLD; } if ((sd->sd_state == G_RAID_SUBDISK_S_NONE || - sd->sd_state == G_RAID_SUBDISK_S_FAILED) && + sd->sd_state == G_RAID_SUBDISK_S_FAILED || + sd->sd_state == G_RAID_SUBDISK_S_REBUILD) && mmap0->failed_disk_num == 0xff) { mmap0->failed_disk_num = sdi; if (mvol->migr_state) From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 22:19:40 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B562D6F0; Thu, 31 Jan 2013 22:19:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F07C78A; Thu, 31 Jan 2013 22:19:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMJeri048739; Thu, 31 Jan 2013 22:19:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMJe6P048738; Thu, 31 Jan 2013 22:19:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312219.r0VMJe6P048738@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246176 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 22:19:40 -0000 Author: mav Date: Thu Jan 31 22:19:39 2013 New Revision: 246176 URL: http://svnweb.freebsd.org/changeset/base/246176 Log: MFC r245341: Windows handles INIT and VERIFY as array-wide and it doesn't specify which disks should be rebuilt. Our rebuild code is same time disk-centric. To handle this situation properly check all disks for RBLD flags, and if no disk specified try rebuild/resync all of them except newly inserted. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:18:40 2013 (r246175) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:19:39 2013 (r246176) @@ -774,7 +774,7 @@ g_raid_md_intel_start_disk(struct g_raid struct intel_raid_conf *meta; struct intel_raid_vol *mvol; struct intel_raid_map *mmap0, *mmap1; - int disk_pos, resurrection = 0; + int disk_pos, resurrection = 0, migr_global, i; sc = disk->d_softc; md = sc->sc_md; @@ -903,6 +903,13 @@ nofit: else mmap1 = mmap0; + migr_global = 1; + for (i = 0; i < mmap0->total_disks; i++) { + if ((mmap0->disk_idx[i] & INTEL_DI_RBLD) == 0 && + (mmap1->disk_idx[i] & INTEL_DI_RBLD) != 0) + migr_global = 0; + } + if (resurrection) { /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, @@ -953,6 +960,11 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } + } else if (mvol->migr_type == INTEL_MT_INIT && + migr_global) { + /* Freshly created uninitialized volume. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_UNINITIALIZED); } else if (mvol->dirty && (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ @@ -969,7 +981,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) { + } else if ((mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) || + migr_global) { /* Resyncing disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_RESYNC); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 22:22:23 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 65E6AB77; Thu, 31 Jan 2013 22:22:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 490D57BA; Thu, 31 Jan 2013 22:22:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMMNui050868; Thu, 31 Jan 2013 22:22:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMMM3Q050866; Thu, 31 Jan 2013 22:22:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312222.r0VMMM3Q050866@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22: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 Subject: svn commit: r246179 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 22:22:23 -0000 Author: mav Date: Thu Jan 31 22:22:22 2013 New Revision: 246179 URL: http://svnweb.freebsd.org/changeset/base/246179 Log: MFC r245363: Improve support for disabled disks. If disabled disk disconnected and then reconnected back, leave it as disabled. If new disk inserted instead of disabled, rebuild it and leave as enabled. Modified: stable/8/sys/geom/raid/g_raid.c stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu Jan 31 22:21:39 2013 (r246178) +++ stable/8/sys/geom/raid/g_raid.c Thu Jan 31 22:22:22 2013 (r246179) @@ -535,7 +535,7 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; if (disk->d_state == G_RAID_DISK_S_DISABLED) { - ; + s = G_STATE_ACTIVE; /* XXX */ } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:21:39 2013 (r246178) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:22:22 2013 (r246179) @@ -787,13 +787,9 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); - /* Disabled disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { - g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); - return (0); - } /* Failed stale disk is useless for us. */ - if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { + if ((pd->pd_disk_meta.flags & INTEL_F_FAILED) && + !(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); return (0); } @@ -884,10 +880,11 @@ nofit: } /* Welcome the new disk. */ - if (resurrection) - g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); - else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + else if (resurrection) + g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -910,14 +907,15 @@ nofit: migr_global = 0; } - if (resurrection) { - /* Stale disk, almost same as new. */ - g_raid_change_subdisk_state(sd, - G_RAID_SUBDISK_S_NEW); - } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + if ((meta->disk[disk_pos].flags & INTEL_F_DISABLED) && + !(pd->pd_disk_meta.flags & INTEL_F_SPARE)) { /* Disabled disk, useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); + } else if (resurrection) { + /* Stale disk, almost same as new. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, @@ -1021,7 +1019,8 @@ nofit: /* Update status of our need for spare. */ if (mdi->mdio_started) { mdi->mdio_incomplete = - (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < + (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); } @@ -1053,7 +1052,8 @@ g_raid_md_intel_refill(struct g_raid_sof update = 0; do { /* Make sure we miss anything. */ - na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE); + na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED); if (na == meta->total_disks) break; @@ -1065,7 +1065,8 @@ g_raid_md_intel_refill(struct g_raid_sof TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state == G_RAID_DISK_S_STALE) { update += g_raid_md_intel_start_disk(disk); - if (disk->d_state == G_RAID_DISK_S_ACTIVE) + if (disk->d_state == G_RAID_DISK_S_ACTIVE || + disk->d_state == G_RAID_DISK_S_DISABLED) break; } } @@ -1089,8 +1090,8 @@ g_raid_md_intel_refill(struct g_raid_sof } /* Update status of our need for spare. */ - mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) < - meta->total_disks); + mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) + + g_raid_ndisks(sc, G_RAID_DISK_S_DISABLED) < meta->total_disks); /* Request retaste hoping to find spare. */ if (mdi->mdio_incomplete) { @@ -2242,7 +2243,8 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { - pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; + if (!(pd->pd_disk_meta.flags & INTEL_F_DISABLED)) + pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { pd->pd_disk_meta.id = 0xffffffff; len = strlen(pd->pd_disk_meta.serial); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 22:24:47 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C441C7C; Thu, 31 Jan 2013 22:24:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6C7E7E6; Thu, 31 Jan 2013 22:24:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMOlQo051449; Thu, 31 Jan 2013 22:24:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMOlGi051448; Thu, 31 Jan 2013 22:24:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312224.r0VMOlGi051448@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246181 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 22:24:47 -0000 Author: mav Date: Thu Jan 31 22:24:46 2013 New Revision: 246181 URL: http://svnweb.freebsd.org/changeset/base/246181 Log: MFC r245398: - Add checks for Intel metadata version and attributes. Ignore disks with unsupported metadata types like Intel Smart Response to not corrupt them. - Improve setting of these things during metadata writing to protect from incapable BIOS'es and other implementations. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:24:05 2013 (r246180) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:24:46 2013 (r246181) @@ -165,6 +165,11 @@ struct intel_raid_conf { #define INTEL_ATTR_RAID1E 0x00000008 #define INTEL_ATTR_RAID5 0x00000010 #define INTEL_ATTR_RAIDCNG 0x00000020 +#define INTEL_ATTR_EXT_STRIP 0x00000040 +#define INTEL_ATTR_NVM_CACHE 0x02000000 +#define INTEL_ATTR_2TB_DISK 0x04000000 +#define INTEL_ATTR_BBM 0x08000000 +#define INTEL_ATTR_NVM_CACHE2 0x10000000 #define INTEL_ATTR_2TB 0x20000000 #define INTEL_ATTR_PM 0x40000000 #define INTEL_ATTR_CHECKSUM 0x80000000 @@ -182,6 +187,11 @@ struct intel_raid_conf { /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; +#define INTEL_ATTR_SUPPORTED ( INTEL_ATTR_RAID0 | INTEL_ATTR_RAID1 | \ + INTEL_ATTR_RAID10 | INTEL_ATTR_RAID1E | INTEL_ATTR_RAID5 | \ + INTEL_ATTR_RAIDCNG | INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | \ + INTEL_ATTR_2TB | INTEL_ATTR_PM | INTEL_ATTR_CHECKSUM ) + #define INTEL_MAX_MD_SIZE(ndisks) \ (sizeof(struct intel_raid_conf) + \ sizeof(struct intel_raid_disk) * (ndisks - 1) + \ @@ -554,6 +564,21 @@ badsize: g_raid_md_intel_print(meta); + if (strncmp(meta->version, INTEL_VERSION_1300, 6) > 0) { + G_RAID_DEBUG(1, "Intel unsupported version: '%.6s'", + meta->version); + free(meta, M_MD_INTEL); + return (NULL); + } + + if (strncmp(meta->version, INTEL_VERSION_1300, 6) >= 0 && + (meta->attributes & ~INTEL_ATTR_SUPPORTED) != 0) { + G_RAID_DEBUG(1, "Intel unsupported attributes: 0x%08x", + meta->attributes & ~INTEL_ATTR_SUPPORTED); + free(meta, M_MD_INTEL); + return (NULL); + } + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -2268,6 +2293,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (pd->pd_disk_pos < 0) continue; meta->disk[pd->pd_disk_pos] = pd->pd_disk_meta; + if (pd->pd_disk_meta.sectors_hi != 0) + meta->attributes |= INTEL_ATTR_2TB_DISK; } /* Fill volumes and maps. */ @@ -2297,12 +2324,16 @@ g_raid_md_write_intel(struct g_raid_md_o meta->attributes |= INTEL_ATTR_RAID1; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) meta->attributes |= INTEL_ATTR_RAID5; - else + else if ((vol->v_disks_count & 1) == 0) meta->attributes |= INTEL_ATTR_RAID10; + else + meta->attributes |= INTEL_ATTR_RAID1E; + if (pv->pv_cng) + meta->attributes |= INTEL_ATTR_RAIDCNG; + if (vol->v_strip_size > 131072) + meta->attributes |= INTEL_ATTR_EXT_STRIP; - if (meta->attributes & INTEL_ATTR_2TB) - cv = INTEL_VERSION_1300; - else if (pv->pv_cng) + if (pv->pv_cng) cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; @@ -2310,8 +2341,6 @@ g_raid_md_write_intel(struct g_raid_md_o cv = INTEL_VERSION_1202; else if (vol->v_disks_count > 2) cv = INTEL_VERSION_1201; - else if (vi > 0) - cv = INTEL_VERSION_1200; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1) cv = INTEL_VERSION_1100; else @@ -2321,6 +2350,8 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + mvol->state = (INTEL_ST_READ_COALESCING | + INTEL_ST_WRITE_COALESCING); if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) @@ -2437,7 +2468,10 @@ g_raid_md_write_intel(struct g_raid_md_o vi++; } meta->total_volumes = vi; - if (strcmp(version, INTEL_VERSION_1300) != 0) + if (vi > 1 || meta->attributes & + (INTEL_ATTR_EXT_STRIP | INTEL_ATTR_2TB_DISK | INTEL_ATTR_2TB)) + version = INTEL_VERSION_1300; + if (strcmp(version, INTEL_VERSION_1300) < 0) meta->attributes &= INTEL_ATTR_CHECKSUM; memcpy(&meta->version[0], version, sizeof(INTEL_VERSION_1000) - 1); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 22:27:31 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D496F4E2; Thu, 31 Jan 2013 22:27:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6836835; Thu, 31 Jan 2013 22:27:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMRVa8051921; Thu, 31 Jan 2013 22:27:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMRVc0051920; Thu, 31 Jan 2013 22:27:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312227.r0VMRVc0051920@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246183 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 22:27:31 -0000 Author: mav Date: Thu Jan 31 22:27:31 2013 New Revision: 246183 URL: http://svnweb.freebsd.org/changeset/base/246183 Log: MFC r245400: Windows driver writes relative volume IDs to metadata field. Use that value as a hint for raid/rX device number to make it persistent across reboots. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:26:48 2013 (r246182) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:27:31 2013 (r246183) @@ -1150,7 +1150,7 @@ g_raid_md_intel_start(struct g_raid_soft for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); - vol = g_raid_create_volume(sc, mvol->name, -1); + vol = g_raid_create_volume(sc, mvol->name, mvol->tid - 1); pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); pv->pv_volume_pos = i; pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; @@ -2352,6 +2352,7 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->total_sectors = vol->v_mediasize / sectorsize; mvol->state = (INTEL_ST_READ_COALESCING | INTEL_ST_WRITE_COALESCING); + mvol->tid = vol->v_global_id + 1; if (pv->pv_cng) { mvol->state |= INTEL_ST_CLONE_N_GO; if (pv->pv_cng_man_sync) From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 31 22:31:25 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9B0D895; Thu, 31 Jan 2013 22:31:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9CA0286E; Thu, 31 Jan 2013 22:31:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0VMVP9V054126; Thu, 31 Jan 2013 22:31:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VMVPne054124; Thu, 31 Jan 2013 22:31:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301312231.r0VMVPne054124@svn.freebsd.org> From: Alexander Motin Date: Thu, 31 Jan 2013 22:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246185 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Jan 2013 22:31:25 -0000 Author: mav Date: Thu Jan 31 22:31:25 2013 New Revision: 246185 URL: http://svnweb.freebsd.org/changeset/base/246185 Log: MFC r245423, r245425, r245433: - Print some more metadata fields. - Small cosmetic tuning of the IRRT status constants. - Keep value of orig_config_id metadata field. Windows driver writes there previous value of config_id when it is changed in some cases. I guess it may be used do avoid some split-brain conditions. Modified: stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:30:23 2013 (r246184) +++ stable/8/sys/geom/raid/md_intel.c Thu Jan 31 22:31:25 2013 (r246185) @@ -98,8 +98,9 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; -#define INTEL_SNGST_NEEDS_UPDATE 1 -#define INTEL_SNGST_MASTER_MISSING 2 +#define INTEL_CNGST_UPDATED 0 +#define INTEL_CNGST_NEEDS_UPDATE 1 +#define INTEL_CNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -179,7 +180,7 @@ struct intel_raid_conf { uint8_t error_log_pos; uint8_t dummy_2[1]; uint32_t cache_size; - uint32_t orig_family_num; + uint32_t orig_config_id; uint32_t pwr_cycle_count; uint32_t bbm_log_size; uint32_t filler_0[35]; @@ -215,6 +216,7 @@ struct g_raid_md_intel_pervolume { struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; + uint32_t mdio_orig_config_id; uint32_t mdio_generation; struct intel_raid_conf *mdio_meta; struct callout mdio_start_co; /* STARTING state timer. */ @@ -385,14 +387,17 @@ g_raid_md_intel_print(struct intel_raid_ printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); - printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("error_log_pos %u\n", meta->error_log_pos); + printf("cache_size %u\n", meta->cache_size); + printf("orig_config_id 0x%08x\n", meta->orig_config_id); + printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); - printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); + printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, - meta->disk[i].sectors_hi, - meta->disk[i].id, meta->disk[i].flags); + meta->disk[i].sectors_hi, meta->disk[i].id, + meta->disk[i].flags, meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -414,6 +419,9 @@ g_raid_md_intel_print(struct intel_raid_ printf(" migr_state %u\n", mvol->migr_state); printf(" migr_type %u\n", mvol->migr_type); printf(" dirty %u\n", mvol->dirty); + printf(" fs_state %u\n", mvol->fs_state); + printf(" verify_errors %u\n", mvol->verify_errors); + printf(" bad_blocks %u\n", mvol->bad_blocks); for (j = 0; j < (mvol->migr_state ? 2 : 1); j++) { printf(" *** Map %d ***\n", j); @@ -710,7 +718,7 @@ intel_meta_write_spare(struct g_consumer memcpy(&meta->version[0], INTEL_VERSION_1000, sizeof(INTEL_VERSION_1000) - 1); meta->config_size = INTEL_MAX_MD_SIZE(1); - meta->config_id = arc4random(); + meta->config_id = meta->orig_config_id = arc4random(); meta->generation = 1; meta->total_disks = 1; meta->disk[0] = *d; @@ -1311,7 +1319,7 @@ g_raid_md_create_intel(struct g_raid_md_ char name[16]; mdi = (struct g_raid_md_intel_object *)md; - mdi->mdio_config_id = arc4random(); + mdi->mdio_config_id = mdi->mdio_orig_config_id = arc4random(); mdi->mdio_generation = 0; snprintf(name, sizeof(name), "Intel-%08x", mdi->mdio_config_id); sc = g_raid_create_node(mp, name, md); @@ -1456,6 +1464,7 @@ search: } else { /* Not found matching node -- create one. */ result = G_RAID_MD_TASTE_NEW; mdi->mdio_config_id = meta->config_id; + mdi->mdio_orig_config_id = meta->orig_config_id; snprintf(name, sizeof(name), "Intel-%08x", meta->config_id); sc = g_raid_create_node(mp, name, md); md->mdo_softc = sc; @@ -2285,6 +2294,7 @@ g_raid_md_write_intel(struct g_raid_md_o memcpy(&meta->intel_id[0], INTEL_MAGIC, sizeof(INTEL_MAGIC) - 1); meta->config_size = INTEL_MAX_MD_SIZE(numdisks); meta->config_id = mdi->mdio_config_id; + meta->orig_config_id = mdi->mdio_orig_config_id; meta->generation = mdi->mdio_generation; meta->attributes = INTEL_ATTR_CHECKSUM; meta->total_disks = numdisks; @@ -2360,9 +2370,11 @@ g_raid_md_write_intel(struct g_raid_md_o mvol->cng_master_disk = pv->pv_cng_master_disk; if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == G_RAID_SUBDISK_S_NONE) - mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + mvol->cng_state = INTEL_CNGST_MASTER_MISSING; else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) - mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + mvol->cng_state = INTEL_CNGST_NEEDS_UPDATE; + else + mvol->cng_state = INTEL_CNGST_UPDATED; } /* Check for any recovery in progress. */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 1 07:38:27 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 54A693E9; Fri, 1 Feb 2013 07:38:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4776682; Fri, 1 Feb 2013 07:38:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r117cR79017415; Fri, 1 Feb 2013 07:38:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r117cR4b017414; Fri, 1 Feb 2013 07:38:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302010738.r117cR4b017414@svn.freebsd.org> From: Xin LI Date: Fri, 1 Feb 2013 07:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246198 - stable/8/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Feb 2013 07:38:27 -0000 Author: delphij Date: Fri Feb 1 07:38:26 2013 New Revision: 246198 URL: http://svnweb.freebsd.org/changeset/base/246198 Log: MFC r244568: - Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to store path longer than this. - Fix an unreached case of check against sizeof buf, which in turn leads to an off-by-one nul byte write on the stack. The original condition can never be satisfied because the passed boundary is the maximum value that can be returned, so code was harmless. Modified: stable/8/lib/libc/gen/check_utility_compat.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/check_utility_compat.c ============================================================================== --- stable/8/lib/libc/gen/check_utility_compat.c Fri Feb 1 07:36:22 2013 (r246197) +++ stable/8/lib/libc/gen/check_utility_compat.c Fri Feb 1 07:38:26 2013 (r246198) @@ -35,32 +35,28 @@ __FBSDID("$FreeBSD$"); * are threaded, so I'm not concerned about cancellation points or other * niceties. */ +#include + #include #include #include #include -#ifndef LINE_MAX -#define LINE_MAX _POSIX2_LINE_MAX -#endif - #define _PATH_UTIL_COMPAT "/etc/compat-FreeBSD-4-util" #define _ENV_UTIL_COMPAT "_COMPAT_FreeBSD_4" int check_utility_compat(const char *utility) { - char buf[LINE_MAX]; + char buf[PATH_MAX]; char *p, *bp; int len; if ((p = getenv(_ENV_UTIL_COMPAT)) != NULL) { strlcpy(buf, p, sizeof buf); } else { - if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof buf)) < 0) + if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof(buf) - 1)) < 0) return 0; - if (len > sizeof buf) - len = sizeof buf; buf[len] = '\0'; } if (buf[0] == '\0') From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 1 15:48:30 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55F5D509; Fri, 1 Feb 2013 15:48:30 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E30DE7A; Fri, 1 Feb 2013 15:48:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11FmUjk068443; Fri, 1 Feb 2013 15:48:30 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11FmUZh068442; Fri, 1 Feb 2013 15:48:30 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302011548.r11FmUZh068442@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 1 Feb 2013 15:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246211 - stable/8 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Feb 2013 15:48:30 -0000 Author: pluknet Date: Fri Feb 1 15:48:29 2013 New Revision: 246211 URL: http://svnweb.freebsd.org/changeset/base/246211 Log: MFC r200596 (by imp): Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN}, which disables doing a make obj. Use it when you know it will work only. KERNFAST now implies NO_KERNELOBJ, since you don't need to keep doing obj when doing incremental kernel builds. Approved by: imp Modified: stable/8/Makefile.inc1 (contents, props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Fri Feb 1 15:32:20 2013 (r246210) +++ stable/8/Makefile.inc1 Fri Feb 1 15:48:29 2013 (r246211) @@ -5,10 +5,11 @@ # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir # -DNO_CLEAN do not clean at all # -DNO_SHARE do not go into share subdir -# -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELDEPEND +# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel +# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects @@ -694,6 +695,7 @@ distrib-dirs distribution: NO_KERNELCLEAN= t NO_KERNELCONFIG= t NO_KERNELDEPEND= t +NO_KERNELOBJ= t # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah .if !defined(KERNCONF) && ${KERNFAST} != "1" KERNCONF=${KERNFAST} @@ -763,11 +765,13 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} .endif +.if !defined(NO_KERNELOBJ) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.2: rebuilding the object tree" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj +.endif @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.3: build tools" From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 2 01:11:13 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0207CB51; Sat, 2 Feb 2013 01:11:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8F128DB; Sat, 2 Feb 2013 01:11:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r121BCkA039185; Sat, 2 Feb 2013 01:11:12 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r121BCgY039184; Sat, 2 Feb 2013 01:11:12 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201302020111.r121BCgY039184@svn.freebsd.org> From: Glen Barber Date: Sat, 2 Feb 2013 01:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246225 - stable/8/share/man/man7 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 02 Feb 2013 01:11:13 -0000 Author: gjb (doc,ports committer) Date: Sat Feb 2 01:11:12 2013 New Revision: 246225 URL: http://svnweb.freebsd.org/changeset/base/246225 Log: MFC r246153, r246154: r246153: - Update svn port directory in release(7). r246154: - Force commit to mark MFC for r246153. Modified: stable/8/share/man/man7/release.7 Directory Properties: stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/release.7 ============================================================================== --- stable/8/share/man/man7/release.7 Sat Feb 2 01:11:02 2013 (r246224) +++ stable/8/share/man/man7/release.7 Sat Feb 2 01:11:12 2013 (r246225) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2009 +.Dd January 31, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -507,7 +507,7 @@ make release CHROOTDIR=/local3/release B .Xr install 1 , .Xr make 1 , .Xr patch 1 , -.Xr svn 1 Pq Pa ports/devel/subversion-freebsd , +.Xr svn 1 Pq Pa ports/devel/subversion , .Xr uname 1 , .Xr md 4 , .Xr make.conf 5 , From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 2 11:20:37 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C78C71C; Sat, 2 Feb 2013 11:20:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4EDABAE6; Sat, 2 Feb 2013 11:20:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12BKbMB020114; Sat, 2 Feb 2013 11:20:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12BKbGX020113; Sat, 2 Feb 2013 11:20:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302021120.r12BKbGX020113@svn.freebsd.org> From: Andriy Gapon Date: Sat, 2 Feb 2013 11:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246239 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 02 Feb 2013 11:20:37 -0000 Author: avg Date: Sat Feb 2 11:20:36 2013 New Revision: 246239 URL: http://svnweb.freebsd.org/changeset/base/246239 Log: MFC r245945: spa_generate_rootconf: add support for old vdev labels Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 2 11:04:04 2013 (r246238) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Feb 2 11:20:36 2013 (r246239) @@ -3775,9 +3775,8 @@ spa_generate_rootconf(const char *name) /* * Multi-vdev root pool configuration discovery is not supported yet. */ - nchildren = 0; - VERIFY(nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, - &nchildren) == 0); + nchildren = 1; + nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); holes = NULL; nvlist_lookup_uint64_array(best_cfg, ZPOOL_CONFIG_HOLE_ARRAY, &holes, &nholes); From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 2 23:11:17 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6E468CC3; Sat, 2 Feb 2013 23:11:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 558B0A65; Sat, 2 Feb 2013 23:11:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NBHmM036078; Sat, 2 Feb 2013 23:11:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NBHPk036077; Sat, 2 Feb 2013 23:11:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022311.r12NBHPk036077@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246265 - stable/8/bin/cp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 02 Feb 2013 23:11:17 -0000 Author: eadler Date: Sat Feb 2 23:11:16 2013 New Revision: 246265 URL: http://svnweb.freebsd.org/changeset/base/246265 Log: MFC r245535: Remove useless variable 'Pflag': -P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables. Approved by: cperciva (mentor, implicit) Modified: stable/8/bin/cp/cp.c Directory Properties: stable/8/bin/cp/ (props changed) Modified: stable/8/bin/cp/cp.c ============================================================================== --- stable/8/bin/cp/cp.c Sat Feb 2 23:01:54 2013 (r246264) +++ stable/8/bin/cp/cp.c Sat Feb 2 23:11:16 2013 (r246265) @@ -98,30 +98,28 @@ main(int argc, char *argv[]) { struct stat to_stat, tmp_stat; enum op type; - int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash; + int Hflag, Lflag, ch, fts_options, r, have_trailing_slash; char *target; fts_options = FTS_NOCHDIR | FTS_PHYSICAL; - Hflag = Lflag = Pflag = 0; + Hflag = Lflag = 0; while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1) switch (ch) { case 'H': Hflag = 1; - Lflag = Pflag = 0; + Lflag = 0; break; case 'L': Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'P': - Pflag = 1; Hflag = Lflag = 0; break; case 'R': Rflag = 1; break; case 'a': - Pflag = 1; pflag = 1; Rflag = 1; Hflag = Lflag = 0; @@ -146,7 +144,7 @@ main(int argc, char *argv[]) break; case 'r': rflag = Lflag = 1; - Hflag = Pflag = 0; + Hflag = 0; break; case 'v': vflag = 1; From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 2 23:22:41 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9859A327; Sat, 2 Feb 2013 23:22:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 150DBAB3; Sat, 2 Feb 2013 23:22:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NMdEV039311; Sat, 2 Feb 2013 23:22:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NMdiw039310; Sat, 2 Feb 2013 23:22:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022322.r12NMdiw039310@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246269 - stable/8/share/examples/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 02 Feb 2013 23:22:41 -0000 Author: eadler Date: Sat Feb 2 23:22:39 2013 New Revision: 246269 URL: http://svnweb.freebsd.org/changeset/base/246269 Log: MFC r244122: Remove 'dangerous' instructions from the example make.conf. Clarify when and why these might be used and that this isn't a supported configuration. PR: docs/144488 Approved by: cperciva (mentor, implicit) Modified: stable/8/share/examples/etc/make.conf Directory Properties: stable/8/share/examples/ (props changed) Modified: stable/8/share/examples/etc/make.conf ============================================================================== --- stable/8/share/examples/etc/make.conf Sat Feb 2 23:22:31 2013 (r246268) +++ stable/8/share/examples/etc/make.conf Sat Feb 2 23:22:39 2013 (r246269) @@ -52,21 +52,20 @@ # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing" +# nonstandard optimization settings # before submitting bug reports without patches to the developers. # -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports. -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so -# explicitly turn it off when using compiling with the -O2 optimization level. -# -#CFLAGS= -O2 -fno-strict-aliasing -pipe -# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" # alone will remove the often needed contents of CFLAGS from CXXFLAGS. # -#CXXFLAGS+= -fconserve-space +# Additional compiler flags can be specified that extend or override +# default ones. However, neither the base system nor ports are guaranteed +# to build and function without problems with non-default settings. +# +# CFLAGS+= -msse3 +# CXXFLAGS+= -msse3 # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 2 23:31:02 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5792A6F6; Sat, 2 Feb 2013 23:31:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B0A7AF9; Sat, 2 Feb 2013 23:31:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NV2Tk042036; Sat, 2 Feb 2013 23:31:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NV2AU042035; Sat, 2 Feb 2013 23:31:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022331.r12NV2AU042035@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246271 - stable/8/sbin/devd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 02 Feb 2013 23:31:02 -0000 Author: eadler Date: Sat Feb 2 23:31:01 2013 New Revision: 246271 URL: http://svnweb.freebsd.org/changeset/base/246271 Log: MFC r243931: Avoid the creation of a temporary object by using the prefix operator for non-primitive types. Approved by: cperciva (mentor, implicit) Modified: stable/8/sbin/devd/devd.cc Directory Properties: stable/8/sbin/devd/ (props changed) Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Sat Feb 2 23:30:58 2013 (r246270) +++ stable/8/sbin/devd/devd.cc Sat Feb 2 23:31:01 2013 (r246271) @@ -96,7 +96,7 @@ delete_and_clear(vector &v) { typename vector::const_iterator i; - for (i = v.begin(); i != v.end(); i++) + for (i = v.begin(); i != v.end(); ++i) delete *i; v.clear(); } @@ -124,7 +124,7 @@ event_proc::matches(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_match(c)) return (false); return (true); @@ -135,7 +135,7 @@ event_proc::run(config &c) { vector::const_iterator i; - for (i = _epsvec.begin(); i != _epsvec.end(); i++) + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_action(c)) return (false); return (true); @@ -208,7 +208,7 @@ media::media(config &, const char *var, { -1, "unknown" }, { 0, NULL }, }; - for (int i = 0; media_types[i].ifmt_string != NULL; i++) + for (int i = 0; media_types[i].ifmt_string != NULL; ++i) if (strcasecmp(type, media_types[i].ifmt_string) == 0) { _type = media_types[i].ifmt_word; break; @@ -361,7 +361,7 @@ config::parse(void) vector::const_iterator i; parse_one_file(configfile); - for (i = _dir_list.begin(); i != _dir_list.end(); i++) + for (i = _dir_list.begin(); i != _dir_list.end(); ++i) parse_files_in_dir((*i).c_str()); sort_vector(_attach_list); sort_vector(_detach_list); @@ -469,7 +469,7 @@ config::get_variable(const string &var) { vector::reverse_iterator i; - for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); i++) { + for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); ++i) { if ((*i)->is_set(var)) return ((*i)->get_variable(var)); } @@ -627,7 +627,7 @@ config::find_and_execute(char type) } if (Dflag) fprintf(stderr, "Processing %s event\n", s); - for (i = l->begin(); i != l->end(); i++) { + for (i = l->begin(); i != l->end(); ++i) { if ((*i)->matches(*this)) { (*i)->run(*this); break; @@ -716,14 +716,14 @@ notify_clients(const char *data, int len list bad; list::const_iterator i; - for (i = clients.begin(); i != clients.end(); i++) { + for (i = clients.begin(); i != clients.end(); ++i) { if (write(*i, data, len) <= 0) { bad.push_back(*i); close(*i); } } - for (i = bad.begin(); i != bad.end(); i++) + for (i = bad.begin(); i != bad.end(); ++i) clients.erase(find(clients.begin(), clients.end(), *i)); }