From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 5 11:07:07 2011 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61B88106566C for ; Mon, 5 Dec 2011 11:07:07 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 464EE8FC1B for ; Mon, 5 Dec 2011 11:07:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pB5B77jY081298 for ; Mon, 5 Dec 2011 11:07:07 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pB5B76EH081296 for freebsd-scsi@FreeBSD.org; Mon, 5 Dec 2011 11:07:06 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 5 Dec 2011 11:07:06 GMT Message-Id: <201112051107.pB5B76EH081296@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-scsi@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-scsi@FreeBSD.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 11:07:07 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/162256 scsi [mpt] QUEUE FULL EVENT and 'mpt_cam_event: 0x0' o kern/161809 scsi [cam] [patch] set kern.cam.boot_delay via build option o kern/159412 scsi [ciss] 7.3 RELEASE: ciss0 ADAPTER HEARTBEAT FAILED err o kern/157770 scsi [iscsi] [panic] iscsi_initiator panic o kern/154432 scsi [xpt] run_interrupt_driven_hooks: still waiting after o kern/153514 scsi [cam] [panic] CAM related panic o kern/153361 scsi [ciss] Smart Array 5300 boot/detect drive problem o kern/152250 scsi [ciss] [patch] Kernel panic when hw.ciss.expose_hidden o kern/151564 scsi [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 10 o docs/151336 scsi Missing documentation of scsi_ and ata_ functions in c s kern/149927 scsi [cam] hard drive not stopped before removing power dur o kern/148083 scsi [aac] Strange device reporting o kern/147704 scsi [mpt] sys/dev/mpt: new chip revision, partially unsupp o kern/146287 scsi [ciss] ciss(4) cannot see more than one SmartArray con o kern/145768 scsi [mpt] can't perform I/O on SAS based SAN disk in freeb o kern/144648 scsi [aac] Strange values of speed and bus width in dmesg o kern/144301 scsi [ciss] [hang] HP proliant server locks when using ciss o kern/142351 scsi [mpt] LSILogic driver performance problems o kern/141934 scsi [cam] [patch] add support for SEAGATE DAT Scopion 130 o kern/134488 scsi [mpt] MPT SCSI driver probes max. 8 LUNs per device o kern/132250 scsi [ciss] ciss driver does not support more then 15 drive o kern/132206 scsi [mpt] system panics on boot when mirroring and 2nd dri o kern/130621 scsi [mpt] tranfer rate is inscrutable slow when use lsi213 o kern/129602 scsi [ahd] ahd(4) gets confused and wedges SCSI bus o kern/128452 scsi [sa] [panic] Accessing SCSI tape drive randomly crashe o kern/128245 scsi [scsi] "inquiry data fails comparison at DV1 step" [re o kern/127927 scsi [isp] isp(4) target driver crashes kernel when set up o kern/127717 scsi [ata] [patch] [request] - support write cache toggling o kern/123674 scsi [ahc] ahc driver dumping o kern/123520 scsi [ahd] unable to boot from net while using ahd o sparc/121676 scsi [iscsi] iscontrol do not connect iscsi-target on sparc o kern/120487 scsi [sg] scsi_sg incompatible with scanners o kern/120247 scsi [mpt] FreeBSD 6.3 and LSI Logic 1030 = only 3.300MB/s o kern/114597 scsi [sym] System hangs at SCSI bus reset with dual HBAs o kern/110847 scsi [ahd] Tyan U320 onboard problem with more than 3 disks o kern/99954 scsi [ahc] reading from DVD failes on 6.x [regression] o kern/92798 scsi [ahc] SCSI problem with timeouts o kern/90282 scsi [sym] SCSI bus resets cause loss of ch device o kern/76178 scsi [ahd] Problem with ahd and large SCSI Raid system o kern/74627 scsi [ahc] [hang] Adaptec 2940U2W Can't boot 5.3 s kern/61165 scsi [panic] kernel page fault after calling cam_send_ccb o kern/60641 scsi [sym] Sporadic SCSI bus resets with 53C810 under load o kern/60598 scsi wire down of scsi devices conflicts with config s kern/57398 scsi [mly] Current fails to install on mly(4) based RAID di o bin/57088 scsi [cam] [patch] for a possible fd leak in libcam.c o kern/52638 scsi [panic] SCSI U320 on SMP server won't run faster than o kern/44587 scsi dev/dpt/dpt.h is missing defines required for DPT_HAND o kern/39388 scsi ncr/sym drivers fail with 53c810 and more than 256MB m o kern/35234 scsi World access to /dev/pass? (for scanner) requires acce 49 problems total. From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 5 18:58:00 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FB09106566B for ; Mon, 5 Dec 2011 18:58:00 +0000 (UTC) (envelope-from Mark.Martinec+freebsd@ijs.si) Received: from mail.ijs.si (mail.ijs.si [IPv6:2001:1470:ff80::25]) by mx1.freebsd.org (Postfix) with ESMTP id DECD18FC22 for ; Mon, 5 Dec 2011 18:57:59 +0000 (UTC) Received: from amavis-proxy-ori.ijs.si (localhost [IPv6:::1]) by mail.ijs.si (Postfix) with ESMTP id 3SxwMW24bXzGMf7 for ; Mon, 5 Dec 2011 19:57:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ijs.si; h= message-id:content-transfer-encoding:content-type:content-type :mime-version:user-agent:date:date:subject:subject:organization :from:from:received:received:received:vbr-info; s=jakla2; t= 1323111477; x=1325703478; bh=756TLXtS1zOEgE8/QMpLidsS9ABM4Ek0woY FDUhN0kY=; b=InCUYglVOZFZU3s8K51WMJWPE0ynvkAo54w9sVziRnsNcMVeqh6 gpxSss/bOH75wPXRz8LjSVRXIHjiAcmNbLPUM8UU99KZl6A4CthKMvxK9MA6m9lo 37KdbFF7/BYICcGUEV7ww0Rh36xT4oGLN8k6Ikg6SKkHEGLtZl92jkfA= VBR-Info: md=ijs.si; mc=all; mv=dwl.spamhaus.org; X-Virus-Scanned: amavisd-new at ijs.si Received: from mail.ijs.si ([127.0.0.1]) by amavis-proxy-ori.ijs.si (mail.ijs.si [127.0.0.1]) (amavisd-new, port 10012) with ESMTP id sWjXcrdGwJ-M for ; Mon, 5 Dec 2011 19:57:57 +0100 (CET) Received: from rozamunda.ijs.si (unknown [IPv6:2001:1470:ff80:0:225:90ff:fe11:b090]) by mail.ijs.si (Postfix) with ESMTP for ; Mon, 5 Dec 2011 19:57:57 +0100 (CET) Received: from neli.ijs.si (neli.ijs.si [193.2.4.95]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rozamunda.ijs.si (Postfix) with ESMTPSA id EB0B9211670 for ; Mon, 5 Dec 2011 19:57:57 +0100 (CET) From: Mark Martinec Organization: J. Stefan Institute To: freebsd-scsi@freebsd.org Date: Mon, 5 Dec 2011 19:57:57 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.0-PRERELEASE; KDE/4.7.3; amd64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201112051957.57677.Mark.Martinec+freebsd@ijs.si> Subject: iSCSI initiator: iscontrol cannot be stopped or killed X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 18:58:00 -0000 Initially reported to freebsd-current, but was suggested to repost here: Problem: the iscontrol process starts normally and establishes a session and brings up a device, but it cannot be stopped. It does not react to a HUP signal, and neither to KILL. The /dev/da0 device is operational and the remote disk remains normally accessible, regardless of how I try to (unsuccessfully) shutdown the iscontrol process. The ps reports the state of the process as "Ds", mwchan "ffp", not doing anything. A ktrace does not show any reaction to a received signal. A machine restart seems to be necessary to break the iSCSI session. Using FreeBSD 9.0-rc2, amd64, also tried with 9.0-PRERELEASE. This used to work normally as documented on the same host with the same iscsi.conf config file before upgrading from 8.2 to 9.0. Anybody else experiencing this problem? Suggestions welcome. Freshly installed from a FreeBSD 9.0-RC2 amd64 ISO image: # uname -a FreeBSD neli-virtual 9.0-RC2 FreeBSD 9.0-RC2 #0: Sat Nov 12 18:35:25 UTC 2011 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 # ps axl | grep isc 0 986 0 0 -16 0 0 16 isc_pr DL ?? 0:00.24 [isc_out 0] 0 987 0 0 -16 0 0 16 sbwait SL ?? 0:00.24 [isc_in 0] 0 988 1 0 20 0 16420 1644 ffp Ds ?? 0:00.09 iscontrol -v -c /etc/iscsi.conf -n xxx # procstat -k -k 988 PID TID COMM TDNAME KSTACK 988 100071 iscontrol - mi_switch+0x174 sleepq_timedwait+0x42 _sleep+0x301 ic_init+0x2f1 iscsi_ioctl+0x525 devfs_ioctl_f+0x7b kern_ioctl+0x115 sys_ioctl+0xfd amd64_syscall+0x450 Xfast_syscall+0xf7 # cat /etc/iscsi.conf xxx { AuthMethod = CHAP ChapIName = markxxx ChapSecret = xxxxx InitiatorName = iqn.2011-05.si.ijs.neli:storage.disk1 TargetName = iqn.1986-03.com.sun:02:f5db11a2-14d7-ceaf-ab13-8bdb51619dda TargetAddress = xxx.xxx.xxx.xxx:3260,1 } # sysctl net.iscsi_initiator net.iscsi_initiator.driver_version: 2.2.4.2 net.iscsi_initiator.isid: DIB00 net.iscsi_initiator.sessions: 1 net.iscsi_initiator.0.targetname: iqn.1986-03.com.sun:02:f5db11a2-14d7-ceaf-ab13-8bdb51619dda net.iscsi_initiator.0.targeaddress: xxx.xxx.xxx.xxx net.iscsi_initiator.0.stats: recv=7295 sent=7281 flags=0x0000059f pdus-alloc=0 pdus-max=7 cws=1024 cmd=1c03 exp=1c03 max=2002 stat=1c08 itt=1c03 net.iscsi_initiator.0.douio: 0 Mark From owner-freebsd-scsi@FreeBSD.ORG Tue Dec 6 07:11:30 2011 Return-Path: Delivered-To: freebsd-scsi@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38CB01065675; Tue, 6 Dec 2011 07:11:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 117538FC18; Tue, 6 Dec 2011 07:11:30 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pB67BTQL007330; Tue, 6 Dec 2011 07:11:29 GMT (envelope-from eadler@freefall.freebsd.org) Received: (from eadler@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pB67BT1o007324; Tue, 6 Dec 2011 07:11:29 GMT (envelope-from eadler) Date: Tue, 6 Dec 2011 07:11:29 GMT Message-Id: <201112060711.pB67BT1o007324@freefall.freebsd.org> To: eadler@FreeBSD.org, freebsd-scsi@FreeBSD.org, eadler@FreeBSD.org From: eadler@FreeBSD.org Cc: Subject: Re: kern/141934: [cam] [patch] add support for SEAGATE DAT Scopion 130 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 07:11:30 -0000 Synopsis: [cam] [patch] add support for SEAGATE DAT Scopion 130 Responsible-Changed-From-To: freebsd-scsi->eadler Responsible-Changed-By: eadler Responsible-Changed-When: Tue Dec 6 07:11:29 UTC 2011 Responsible-Changed-Why: I'll take it. http://www.freebsd.org/cgi/query-pr.cgi?pr=141934 From owner-freebsd-scsi@FreeBSD.ORG Tue Dec 6 19:57:04 2011 Return-Path: Delivered-To: scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 536181065672 for ; Tue, 6 Dec 2011 19:57:04 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id AC1738FC16 for ; Tue, 6 Dec 2011 19:57:03 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id B9E5F2A28CF0; Tue, 6 Dec 2011 20:57:02 +0100 (CET) Date: Tue, 6 Dec 2011 20:57:02 +0100 From: Ed Schouten To: scsi@freebsd.org Message-ID: <20111206195702.GF59489@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9sSKoi6Rw660DLir" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Use cdevpriv in targ(4) X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 19:57:04 -0000 --9sSKoi6Rw660DLir Content-Type: multipart/mixed; boundary="bO4vSxwwZtUjUWHo" Content-Disposition: inline --bO4vSxwwZtUjUWHo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello all, I sent this patch to mjacob@ previously, but he redirected me to this list, so here it goes. The other day I spent some time grepping through character device/devfs code and I noticed we can make the targ(4) driver a lot more beautiful if we simply change the code to use a single device node (/dev/targ) and use per-file descriptor data, instead of hacking around with clonelists. As I have no idea how to actually test and use targ(4), so is there a way I can persuade any of you to test/debug this patch for me? Thanks, --=20 Ed Schouten WWW: http://80386.nl/ --bO4vSxwwZtUjUWHo Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="targ.diff" Content-Transfer-Encoding: quoted-printable Index: sys/cam/scsi/scsi_target.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/cam/scsi/scsi_target.c (revision 228283) +++ sys/cam/scsi/scsi_target.c (working copy) @@ -96,12 +96,9 @@ targ_state state; struct selinfo read_select; struct devstat device_stats; - struct callout destroy_dev_callout; - struct mtx destroy_mtx; }; =20 static d_open_t targopen; -static d_close_t targclose; static d_read_t targread; static d_write_t targwrite; static d_ioctl_t targioctl; @@ -119,7 +116,6 @@ .d_version =3D D_VERSION, .d_flags =3D D_NEEDGIANT, .d_open =3D targopen, - .d_close =3D targclose, .d_read =3D targread, .d_write =3D targwrite, .d_ioctl =3D targioctl, @@ -152,15 +148,12 @@ static struct targ_cmd_descr * targgetdescr(struct targ_softc *softc); static periph_init_t targinit; -static void targclone(void *arg, struct ucred *cred, char *name, - int namelen, struct cdev **dev); static void targasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg); static void abort_all_pending(struct targ_softc *softc); static void notify_user(struct targ_softc *softc); static int targcamstatus(cam_status status); static size_t targccblen(xpt_opcode func_code); -static void targdestroy(void *); =20 static struct periph_driver targdriver =3D { @@ -171,66 +164,18 @@ =20 static MALLOC_DEFINE(M_TARG, "TARG", "TARG data"); =20 -/* - * Create softc and initialize it. Only one proc can open each targ device. - * There is no locking here because a periph doesn't get created until an - * ioctl is issued to do so, and that can't happen until this method retur= ns. - */ -static int -targopen(struct cdev *dev, int flags, int fmt, struct thread *td) +/* Disable LUN if enabled and teardown softc */ +static void +targcdevdtor(void *data) { struct targ_softc *softc; + struct cam_periph *periph; =20 - if (dev->si_drv1 !=3D 0) { - return (EBUSY); - } -=09 - /* Mark device busy before any potentially blocking operations */ - dev->si_drv1 =3D (void *)~0; - - /* Create the targ device, allocate its softc, initialize it */ - if ((dev->si_flags & SI_NAMED) =3D=3D 0) { - make_dev(&targ_cdevsw, dev2unit(dev), UID_ROOT, GID_WHEEL, 0600, - "targ%d", dev2unit(dev)); - } - softc =3D malloc(sizeof(*softc), M_TARG, - M_WAITOK | M_ZERO); - dev->si_drv1 =3D softc; - softc->state =3D TARG_STATE_OPENED; - softc->periph =3D NULL; - softc->path =3D NULL; - - TAILQ_INIT(&softc->pending_ccb_queue); - TAILQ_INIT(&softc->work_queue); - TAILQ_INIT(&softc->abort_queue); - TAILQ_INIT(&softc->user_ccb_queue); - knlist_init_mtx(&softc->read_select.si_note, NULL); - - return (0); -} - -/* Disable LUN if enabled and teardown softc */ -static int -targclose(struct cdev *dev, int flag, int fmt, struct thread *td) -{ - struct targ_softc *softc; - struct cam_periph *periph; - int error; - - softc =3D (struct targ_softc *)dev->si_drv1; - mtx_init(&softc->destroy_mtx, "targ_destroy", "SCSI Target dev destroy", = MTX_DEF); - callout_init_mtx(&softc->destroy_dev_callout, &softc->destroy_mtx, CALLO= UT_RETURNUNLOCKED); + softc =3D data; if (softc->periph =3D=3D NULL) { -#if 0 - destroy_dev(dev); + printf("%s: destroying non-enabled target\n", __func__); free(softc, M_TARG); -#endif - printf("%s: destroying non-enabled target\n", __func__); - mtx_lock(&softc->destroy_mtx); - callout_reset(&softc->destroy_dev_callout, hz / 2, - (void *)targdestroy, (void *)dev); - mtx_unlock(&softc->destroy_mtx); - return (0); + return; } =20 /* @@ -240,25 +185,41 @@ periph =3D softc->periph; cam_periph_acquire(periph); cam_periph_lock(periph); - error =3D targdisable(softc); + (void)targdisable(softc); if (softc->periph !=3D NULL) { cam_periph_invalidate(softc->periph); softc->periph =3D NULL; } cam_periph_unlock(periph); cam_periph_release(periph); - -#if 0 - destroy_dev(dev); free(softc, M_TARG); -#endif +} =20 - printf("%s: close finished error(%d)\n", __func__, error); - mtx_lock(&softc->destroy_mtx); - callout_reset(&softc->destroy_dev_callout, hz / 2, - (void *)targdestroy, (void *)dev); - mtx_unlock(&softc->destroy_mtx); - return (error); +/* + * Create softc and initialize it. There is no locking here because a + * periph doesn't get created until an ioctl is issued to do so, and + * that can't happen until this method returns. + */ +static int +targopen(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + struct targ_softc *softc; + + /* Allocate its softc, initialize it */ + softc =3D malloc(sizeof(*softc), M_TARG, + M_WAITOK | M_ZERO); + softc->state =3D TARG_STATE_OPENED; + softc->periph =3D NULL; + softc->path =3D NULL; + + TAILQ_INIT(&softc->pending_ccb_queue); + TAILQ_INIT(&softc->work_queue); + TAILQ_INIT(&softc->abort_queue); + TAILQ_INIT(&softc->user_ccb_queue); + knlist_init_mtx(&softc->read_select.si_note, NULL); + + devfs_set_cdevpriv(softc, targcdevdtor); + return (0); } =20 /* Enable/disable LUNs, set debugging level */ @@ -268,7 +229,7 @@ struct targ_softc *softc; cam_status status; =20 - softc =3D (struct targ_softc *)dev->si_drv1; + devfs_get_cdevpriv((void **)&softc); =20 switch (cmd) { case TARGIOCENABLE: @@ -346,7 +307,7 @@ struct targ_softc *softc; int revents; =20 - softc =3D (struct targ_softc *)dev->si_drv1; + devfs_get_cdevpriv((void **)&softc); =20 /* Poll for write() is always ok. */ revents =3D poll_events & (POLLOUT | POLLWRNORM); @@ -371,7 +332,7 @@ { struct targ_softc *softc; =20 - softc =3D (struct targ_softc *)dev->si_drv1; + devfs_get_cdevpriv((void **)&softc); kn->kn_hook =3D (caddr_t)softc; kn->kn_fop =3D &targread_filtops; knlist_add(&softc->read_select.si_note, kn, 0); @@ -572,7 +533,7 @@ int write_len, error; int func_code, priority; =20 - softc =3D (struct targ_softc *)dev->si_drv1; + devfs_get_cdevpriv((void **)&softc); write_len =3D error =3D 0; CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("write - uio_resid %zd\n", uio->uio_resid)); @@ -866,7 +827,7 @@ =20 error =3D 0; read_len =3D 0; - softc =3D (struct targ_softc *)dev->si_drv1; + devfs_get_cdevpriv((void **)&softc); user_queue =3D &softc->user_ccb_queue; abort_queue =3D &softc->abort_queue; CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("targread\n")); @@ -1051,23 +1012,11 @@ static void targinit(void) { - EVENTHANDLER_REGISTER(dev_clone, targclone, 0, 1000); -} + struct cdev *dev; =20 -static void -targclone(void *arg, struct ucred *cred, char *name, int namelen, - struct cdev **dev) -{ - int u; - - if (*dev !=3D NULL) - return; - if (dev_stdclone(name, NULL, "targ", &u) !=3D 1) - return; - *dev =3D make_dev(&targ_cdevsw, u, UID_ROOT, GID_WHEEL, - 0600, "targ%d", u); - dev_ref(*dev); - (*dev)->si_flags |=3D SI_CHEAPCLONE; + /* Add symbolic link to targ0 for compatibility. */ + dev =3D make_dev(&targ_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "targ"); + make_dev_alias(dev, "targ0"); } =20 static void @@ -1221,25 +1170,3 @@ =20 return (len); } - -/* - * work around to destroy targ device - * outside of targclose - */ -static void -targdestroy(void *dev) -{ - struct cdev *device =3D (struct cdev *)dev; - struct targ_softc *softc =3D (struct targ_softc *)device->si_drv1; - -#if 0 - callout_stop(&softc->destroy_dev_callout); -#endif - - mtx_unlock(&softc->destroy_mtx); - mtx_destroy(&softc->destroy_mtx); - free(softc, M_TARG); - device->si_drv1 =3D 0; - destroy_dev(device); - printf("%s: destroyed dev\n", __func__); -} --bO4vSxwwZtUjUWHo-- --9sSKoi6Rw660DLir Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJO3nOOAAoJEG5e2P40kaK77/8QAKSa9NSr8zLik8pk40h5jPgu wTgN6HCDx0pmVAmLWIMavTdF4hI8b17KMPPXHLSjq2f906LJKN4XUU9qsddbSWWo SICc5gHZbM4DOAQ3x7PIhgNP8tYvufcHlaxdPCg3jr1N3RG6qCCwXxEgiTvDTY7a ii+oupE7QV/rIy8qyGdm4nGg5RQ5qZZ1L7Jv1c3RTk/pwIx8Yd9kc4iZc3Bw7V3P NyrHgxk7lZuIHj/LYT6l5fc6XRdwILgD94kgPIRb9lbZLhgP7UAHfXaDK2YWgMVO BBEtkIE58/d+9SinxMt6SpzuI+Fiy5kgFWTa3aJS3wL/ezH1DldovaXxg88D9ANm 6Tnp09DIap/vnnmJsI1N7jkVm0axxAr7i/bZr7kW5Nk9aCBII07AZ3zhg+fjuMPT Kn/Z61UornBZSN9li6KredCEpiXD9HlKOpdkSyEAlF/2EUD4IiW6KhlFq8a4ikik zujBIYZ49b1dbircZWqD1plWiPX4XewTro0c8J7aY2muLUJiOT3S+BzJnXE2FWCM U41RQ2/BdtE4G6H10jCsRNGFcgHgfE8S6iXtpILtpfBO5z2Nt7F3aZ4WQVm0rRd7 S088mi93Qj7yGu7fzj/fbVRUvHXGlSjuksquKt27UtisYmU7ngkFCbu+xPUte2Yt y/0oShRgRG5n3wiD0Lrp =f6Rg -----END PGP SIGNATURE----- --9sSKoi6Rw660DLir-- From owner-freebsd-scsi@FreeBSD.ORG Tue Dec 6 22:57:51 2011 Return-Path: Delivered-To: scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB318106566B for ; Tue, 6 Dec 2011 22:57:51 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout1-b.corp.bf1.yahoo.com (mrout1-b.corp.bf1.yahoo.com [98.139.253.104]) by mx1.freebsd.org (Postfix) with ESMTP id 8454D8FC08 for ; Tue, 6 Dec 2011 22:57:51 +0000 (UTC) Received: from [127.0.0.1] (rideseveral.corp.yahoo.com [10.73.160.231]) by mrout1-b.corp.bf1.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id pB6MlH7e073732; Tue, 6 Dec 2011 14:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yahoo-inc.com; s=cobra; t=1323211638; bh=wO9OGSl8xgfFtTXDptOGwQG4+APSqsaVp+BguwmDcv8=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=C08Di/tDUoLcskygSHrYj/jQvySapN/XlxH5cp/EmxcVgO5kRjXMO6d9kNOhl6kFB JDs7wvAA0G38A7gonmx7IT2R5mTFMY1bi/hW8HkJM3Cw4scRoIsJZYXyJdtvQLBQn0 fv/VGIrbpS6QLr87AhqjN0vMHHBUN0uvmQ33nzT0= From: Sean Bruno To: Ed Schouten In-Reply-To: <20111206195702.GF59489@hoeg.nl> References: <20111206195702.GF59489@hoeg.nl> Content-Type: text/plain; charset="UTF-8" Date: Tue, 06 Dec 2011 14:47:17 -0800 Message-ID: <1323211637.19452.17.camel@hitfishpass-lx.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-1.fc14) Content-Transfer-Encoding: 7bit Cc: "scsi@freebsd.org" Subject: Re: Use cdevpriv in targ(4) X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 22:57:52 -0000 On Tue, 2011-12-06 at 11:57 -0800, Ed Schouten wrote: > Hello all, > > I sent this patch to mjacob@ previously, but he redirected me to this > list, so here it goes. > > The other day I spent some time grepping through character device/devfs > code and I noticed we can make the targ(4) driver a lot more beautiful > if we simply change the code to use a single device node (/dev/targ) and > use per-file descriptor data, instead of hacking around with clonelists. > > As I have no idea how to actually test and use targ(4), so is there a > way I can persuade any of you to test/debug this patch for me? > > Thanks, Ed: I'll likely be fireing this up against the firewire target this month. I'll let you know. Sean From owner-freebsd-scsi@FreeBSD.ORG Thu Dec 8 17:53:54 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 887081065722 for ; Thu, 8 Dec 2011 17:53:54 +0000 (UTC) (envelope-from attila.bogar@linguamatics.com) Received: from mail.linguamatics.com (mail.linguamatics.com [193.34.186.85]) by mx1.freebsd.org (Postfix) with ESMTP id 505A68FC13 for ; Thu, 8 Dec 2011 17:53:54 +0000 (UTC) Received: from [10.252.10.232] (random.linguamatics.com [10.252.10.232]) by mail.linguamatics.com (Postfix) with ESMTPSA id 07D08EFB44F for ; Thu, 8 Dec 2011 17:37:55 +0000 (GMT) Message-ID: <4EE0F5F2.3080802@linguamatics.com> Date: Thu, 08 Dec 2011 17:37:54 +0000 From: =?ISO-8859-1?Q?Attila_Bog=E1r?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 MIME-Version: 1.0 To: freebsd-scsi@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Enquiry about Dell H200, H700 and H800 support X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2011 17:53:54 -0000 Hi List, We are buying a Dell box for a ZFS purpose (yes, I know, they don't support FreeBSD, but I have to stick with Dell), I'd like to enquire about their SAS HBA support. Last year we bought a PowerEdge R515 with H200, but I couldn't get H200 working with more than 8 LUNs (mps driver). I raised the problem that time on the freebsd-drivers list, with some debugging of the mps driver, but I'm not aware anyone solved it. That time I replaced the H200 with an LSI MegaRAID 9240-8i, using LSI's driver, which I'd like to avoid this time and use Dell HBAs, because the built in cables doesn't fit. What's the current status of H200, H700 and H800 in 8-STABLE? My understanding is that H200 was supported by the mps driver from 9.0, but this thread is confusing me: http://www.freebsd.org/cgi/getmsg.cgi?fetch=25776+0+/usr/local/www/db/text/2011/freebsd-scsi/20110313.freebsd-scsi This thread from April talks about the mfi driver. Does the mfi driver supports H200 too? BTW H200 is much cheaper, than H700 or H800. I can see furthermore that the thread above solves the timeout problems on mfi. John Baldwin commited a patch for mfi too in September I think which solved the same problem. When using this patched mfi on 8-STABLE, how stable is it with the Dell HBAs? Thanks you all in advance for your valuable comments, Attila From owner-freebsd-scsi@FreeBSD.ORG Fri Dec 9 01:34:31 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4F81065673 for ; Fri, 9 Dec 2011 01:34:31 +0000 (UTC) (envelope-from chuck@tuffli.net) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF498FC08 for ; Fri, 9 Dec 2011 01:34:31 +0000 (UTC) Received: by ggnp1 with SMTP id p1so3731572ggn.13 for ; Thu, 08 Dec 2011 17:34:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.141.68 with SMTP id rm4mr34721obb.23.1323394470435; Thu, 08 Dec 2011 17:34:30 -0800 (PST) Received: by 10.182.108.105 with HTTP; Thu, 8 Dec 2011 17:34:30 -0800 (PST) Date: Thu, 8 Dec 2011 17:34:30 -0800 Message-ID: From: Chuck Tuffli To: freebsd-scsi Content-Type: text/plain; charset=ISO-8859-1 Subject: CAM locking question X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2011 01:34:31 -0000 Hi - I've been debugging a hang and am wondering if this might be a CAM problem. The setup is 8-stable, a FC initiator I'm developing, and fio using the POSIX aio engine with a queue depth > 1 (i.e. a bunch of concurrent IO). Note that this setup with a queue depth of 1 runs without issue. The symptom is fio gets stuck in aio_suspend() waiting for submitted IOs to complete. But I've verified the driver has already completed the IOs in question. Playing around with DTrace, it appears that camisr_runqueue() is running at the same time the driver is completing CCBs with xpt_done() albeit on different processors. Staring at the code seems to indicate that camisr_runqueue() is running inside CAM_SIM_LOCK() while manipulating the sim_doneq list, but it looks like xpt_done() could potentially be touching the same sim_doneq without locking. As an experiment, I added CAM_SIM_LOCK/CAM_SIM_UNLOCK around the TAILQ_INSERT_TAIL() in xpt_done(), and what was a reliable hang after a minute or two hasn't shown up in an hour. I'm not sure this is the right fix, but I wanted to run the scenario by the experts to get some feedback. Thoughts? ---chuck From owner-freebsd-scsi@FreeBSD.ORG Fri Dec 9 03:14:48 2011 Return-Path: Delivered-To: freebsd-scsi@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22EB41065702; Fri, 9 Dec 2011 03:14:48 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id EF6848FC0A; Fri, 9 Dec 2011 03:14:47 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pB93Elix036804; Fri, 9 Dec 2011 03:14:47 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pB93ElNx036800; Fri, 9 Dec 2011 03:14:47 GMT (envelope-from linimon) Date: Fri, 9 Dec 2011 03:14:47 GMT Message-Id: <201112090314.pB93ElNx036800@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-scsi@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/163130: [mpt] cannot dumpon to mpt connected disk X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2011 03:14:48 -0000 Old Synopsis: cannot dumpon to mpt connected disk New Synopsis: [mpt] cannot dumpon to mpt connected disk Responsible-Changed-From-To: freebsd-bugs->freebsd-scsi Responsible-Changed-By: linimon Responsible-Changed-When: Fri Dec 9 03:14:33 UTC 2011 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=163130