From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 27 17:13:22 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A8B73F98; Sun, 27 Jan 2013 17:13:22 +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 8C974C02; Sun, 27 Jan 2013 17:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHDMps016225; Sun, 27 Jan 2013 17:13:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHDL7q016218; Sun, 27 Jan 2013 17:13:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271713.r0RHDL7q016218@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r245985 - stable/7/sys/dev/mpt X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:13:22 -0000 Author: marius Date: Sun Jan 27 17:13:21 2013 New Revision: 245985 URL: http://svnweb.freebsd.org/changeset/base/245985 Log: MFC: r241874 After r241858 (MFC'ed to stable/7 in r242287), remove the remainder of FreeBSD ~4 support from mpt(4). Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_debug.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt.c Sun Jan 27 17:13:21 2013 (r245985) @@ -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/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt.h Sun Jan 27 17:13:21 2013 (r245985) @@ -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/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:13:21 2013 (r245985) @@ -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 } /* @@ -3652,7 +3640,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; } @@ -4016,33 +4004,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/7/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt_debug.c Sun Jan 27 17:13:21 2013 (r245985) @@ -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/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:18 2013 (r245984) +++ stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:13:21 2013 (r245985) @@ -51,16 +51,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include -#if __FreeBSD_version < 500000 -#include -#define GIANT_REQUIRED -#endif -#include - #include #include #include @@ -119,11 +114,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); @@ -1536,15 +1527,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); @@ -1609,14 +1594,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 @@ -1660,7 +1639,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) { @@ -1885,4 +1863,3 @@ mpt_raid_sysctl_attach(struct mpt_softc &mpt->raid_nonopt_volumes, 0, "number of nonoptimal volumes"); } -#endif From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 27 17:16:08 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1E944468; Sun, 27 Jan 2013 17:16:08 +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 10A39C2E; Sun, 27 Jan 2013 17:16: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 r0RHG8kL016809; Sun, 27 Jan 2013 17:16:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHG7KT016806; Sun, 27 Jan 2013 17:16:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271716.r0RHG7KT016806@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r245988 - stable/7/sys/dev/mpt X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:16:08 -0000 Author: marius Date: Sun Jan 27 17:16:07 2013 New Revision: 245988 URL: http://svnweb.freebsd.org/changeset/base/245988 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/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Sun Jan 27 17:15:58 2013 (r245987) +++ stable/7/sys/dev/mpt/mpt.h Sun Jan 27 17:16:07 2013 (r245988) @@ -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/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:15:58 2013 (r245987) +++ stable/7/sys/dev/mpt/mpt_cam.c Sun Jan 27 17:16:07 2013 (r245988) @@ -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 { @@ -3315,15 +3277,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; @@ -3372,9 +3331,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 @@ -3388,7 +3345,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: @@ -3405,7 +3361,6 @@ mpt_action(struct cam_sim *sim, union cc ccb->ccb_h.status = CAM_REQ_INVALID; break; } - MPTLOCK_2_CAMLOCK(mpt); break; } @@ -3545,7 +3500,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) { @@ -3563,7 +3517,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; } @@ -3575,7 +3528,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: @@ -3752,14 +3704,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 { @@ -3789,7 +3739,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); @@ -3804,13 +3753,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: @@ -3854,18 +3800,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); @@ -4494,18 +4437,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; } @@ -4525,9 +4464,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; @@ -4601,7 +4538,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; @@ -4641,7 +4577,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]; @@ -4658,9 +4593,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) { @@ -4866,9 +4799,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"); @@ -5043,9 +4974,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 @@ -5315,9 +5244,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 @@ -5426,9 +5353,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; } /* @@ -5511,9 +5436,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/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:15:58 2013 (r245987) +++ stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:16:07 2013 (r245988) @@ -701,9 +701,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) { @@ -1680,19 +1678,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-7@FreeBSD.ORG Sun Jan 27 17:24:50 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E055D986; Sun, 27 Jan 2013 17:24:50 +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 BA7ACCFF; Sun, 27 Jan 2013 17:24:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0RHOobq020484; Sun, 27 Jan 2013 17:24:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0RHOokx020483; Sun, 27 Jan 2013 17:24:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301271724.r0RHOokx020483@svn.freebsd.org> From: Marius Strobl Date: Sun, 27 Jan 2013 17:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r245989 - stable/7/sys/dev/mpt X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 17:24:51 -0000 Author: marius Date: Sun Jan 27 17:24:50 2013 New Revision: 245989 URL: http://svnweb.freebsd.org/changeset/base/245989 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/7/sys/dev/mpt/mpt_raid.c Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:16:07 2013 (r245988) +++ stable/7/sys/dev/mpt/mpt_raid.c Sun Jan 27 17:24:50 2013 (r245989) @@ -726,9 +726,7 @@ mpt_raid_thread(void *arg) ccb->ccb_h.func_code = XPT_SCAN_BUS; ccb->ccb_h.cbfcnp = mpt_cam_rescan_callback; ccb->crcn.flags = CAM_FLAG_NONE; - MPTLOCK_2_CAMLOCK(mpt); xpt_action(ccb); - CAMLOCK_2_MPTLOCK(mpt); } } } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 31 21:53:56 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 324FDF79; Thu, 31 Jan 2013 21:53:56 +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 1583B3C8; Thu, 31 Jan 2013 21:53: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 r0VLrtLK040637; Thu, 31 Jan 2013 21:53:55 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0VLrtEg040634; Thu, 31 Jan 2013 21:53:55 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301312153.r0VLrtEg040634@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Jan 2013 21:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246163 - stable/7/sys/dev/ciss X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 21:53:56 -0000 Author: sbruno Date: Thu Jan 31 21:53:55 2013 New Revision: 246163 URL: http://svnweb.freebsd.org/changeset/base/246163 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/7/sys/dev/ciss/ciss.c stable/7/sys/dev/ciss/cissreg.h stable/7/sys/dev/ciss/cissvar.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/ciss/ciss.c ============================================================================== --- stable/7/sys/dev/ciss/ciss.c Thu Jan 31 21:50:44 2013 (r246162) +++ stable/7/sys/dev/ciss/ciss.c Thu Jan 31 21:53:55 2013 (r246163) @@ -990,13 +990,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); @@ -1019,6 +1027,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: @@ -1106,7 +1117,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", @@ -1140,7 +1151,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; @@ -1148,9 +1159,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; } @@ -1173,19 +1184,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; @@ -1227,7 +1239,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; @@ -1762,7 +1774,7 @@ ciss_free(struct ciss_softc *sc) 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) @@ -2688,9 +2700,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); @@ -3584,7 +3596,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; @@ -3595,7 +3607,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) @@ -3766,7 +3778,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; @@ -4020,7 +4032,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/7/sys/dev/ciss/cissreg.h ============================================================================== --- stable/7/sys/dev/ciss/cissreg.h Thu Jan 31 21:50:44 2013 (r246162) +++ stable/7/sys/dev/ciss/cissreg.h Thu Jan 31 21:53:55 2013 (r246163) @@ -424,6 +424,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/7/sys/dev/ciss/cissvar.h ============================================================================== --- stable/7/sys/dev/ciss/cissvar.h Thu Jan 31 21:50:44 2013 (r246162) +++ stable/7/sys/dev/ciss/cissvar.h Thu Jan 31 21:53:55 2013 (r246163) @@ -43,8 +43,11 @@ /* * 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 +#define CISS_MAX_LOGICAL 16 /* * Maximum number of physical devices we support. From owner-svn-src-stable-7@FreeBSD.ORG Sat Feb 2 23:22:31 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D9ADF10C; Sat, 2 Feb 2013 23:22:31 +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 AE70CAB0; Sat, 2 Feb 2013 23:22: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 r12NMV7r039222; Sat, 2 Feb 2013 23:22:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NMVZ9039221; Sat, 2 Feb 2013 23:22:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022322.r12NMVZ9039221@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246268 - stable/7/share/examples/etc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:22:31 -0000 Author: eadler Date: Sat Feb 2 23:22:31 2013 New Revision: 246268 URL: http://svnweb.freebsd.org/changeset/base/246268 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/7/share/examples/etc/make.conf Directory Properties: stable/7/share/examples/ (props changed) Modified: stable/7/share/examples/etc/make.conf ============================================================================== --- stable/7/share/examples/etc/make.conf Sat Feb 2 23:22:27 2013 (r246267) +++ stable/7/share/examples/etc/make.conf Sat Feb 2 23:22:31 2013 (r246268) @@ -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-7@FreeBSD.ORG Sat Feb 2 23:31:12 2013 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 279D3956; Sat, 2 Feb 2013 23:31:11 +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 28324AFE; Sat, 2 Feb 2013 23:31:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r12NVB6x042098; Sat, 2 Feb 2013 23:31:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r12NVBYN042097; Sat, 2 Feb 2013 23:31:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302022331.r12NVBYN042097@svn.freebsd.org> From: Eitan Adler Date: Sat, 2 Feb 2013 23:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246272 - stable/7/sbin/devd X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2013 23:31:12 -0000 Author: eadler Date: Sat Feb 2 23:31:10 2013 New Revision: 246272 URL: http://svnweb.freebsd.org/changeset/base/246272 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/7/sbin/devd/devd.cc Directory Properties: stable/7/sbin/devd/ (props changed) Modified: stable/7/sbin/devd/devd.cc ============================================================================== --- stable/7/sbin/devd/devd.cc Sat Feb 2 23:31:01 2013 (r246271) +++ stable/7/sbin/devd/devd.cc Sat Feb 2 23:31:10 2013 (r246272) @@ -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; @@ -360,7 +360,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); @@ -468,7 +468,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)); } @@ -626,7 +626,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; @@ -715,14 +715,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)); }