From owner-freebsd-scsi@FreeBSD.ORG Mon Jan 1 00:08:02 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB8C716A40F for ; Mon, 1 Jan 2007 00:08:02 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 9004713C45D for ; Mon, 1 Jan 2007 00:08:02 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 63629 invoked from network); 31 Dec 2006 23:41:23 -0000 Received: from ppp-71-139-40-196.dsl.snfc21.pacbell.net (HELO ?10.0.5.59?) (nate-mail@71.139.40.196) by root.org with ESMTPA; 31 Dec 2006 23:41:23 -0000 Message-ID: <45984A97.3080201@root.org> Date: Sun, 31 Dec 2006 15:41:11 -0800 From: Nate Lawson User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Ivan Frosty References: <7fd638000612310125n672d11e9j6cfc20a080c443de@mail.gmail.com> In-Reply-To: <7fd638000612310125n672d11e9j6cfc20a080c443de@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-scsi@freebsd.org, freebsd-usb@freebsd.org Subject: Re: problem with samsung flash 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, 01 Jan 2007 00:08:02 -0000 Ivan Frosty wrote: > hello there, i have freebsd 6.1 pentiumII 355mhz processor and 128mb > of ram. everytime i put my samsung 512mb in tha usb the machine doesnt > boot it halts where the error be at if i pull it out it > boots.........then if i put it back in i get an error.......whats with > umass? i basically installed everybit and software of the unix i have > so i dont know why i get the error anyhelp will be highly appreciated! > > this is the error: > > da0 at umass-sim0 bus0 target0wn0 > da0: Removable Direct Access SCSI-0 device > da0:1.000MB/s transfers > da0:511mb(1046720 512 byte sectors:64H 32s/T s11c) > umass0:phase Error, residue = 0 > (da0:umass-sim0:0:0:0):synchronize cache failed, status == 0x4,scsi > status == 0x0 opened disk da0->5! > > thank you for your time Hi, this is a common error and should be a FAQ somewhere. Some USB devices can't handle SYNC CACHE, the command that says to write their data out to storage. Most can or reject it with an error and continue. Some hang, including yours. You can add a SCSI quirk (no sync cache). See the entries at the beginning of scsi_da.c for an example how to do it. Your string would be "SAMSUNG", "flash Disk", "*". See if that helps. As far has fixing this problem permanently, does anyone have an idea on how the experimental work went with disabling sync cache if the INQ data indicates the device doesn't cache data (similar to Linux)? Also, what do the scsi@ guys think of me adding a tunable/sysctl that is unit-specific so people can disable it without a quirk? Example: dev.da.0.no_sync_cache="1". It would be off by default, of course. -- Nate From owner-freebsd-scsi@FreeBSD.ORG Mon Jan 1 11:08:57 2007 Return-Path: X-Original-To: freebsd-scsi@FreeBSD.org Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B45AB16A508 for ; Mon, 1 Jan 2007 11:08:57 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id A3CA613C459 for ; Mon, 1 Jan 2007 11:08:57 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l01B8vRG049001 for ; Mon, 1 Jan 2007 11:08:57 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l01B8uCB048997 for freebsd-scsi@FreeBSD.org; Mon, 1 Jan 2007 11:08:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 1 Jan 2007 11:08:56 GMT Message-Id: <200701011108.l01B8uCB048997@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-scsi@FreeBSD.org Cc: Subject: Current problem reports assigned to you 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, 01 Jan 2007 11:08:57 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/27059 scsi [sym] SCSI subsystem hangs under heavy load on (Server o kern/39388 scsi ncr/sym drivers fail with 53c810 and more than 256MB m o kern/40895 scsi wierd kernel / device driver bug o kern/52638 scsi [panic] SCSI U320 on SMP server won't run faster than s kern/57398 scsi [mly] Current fails to install on mly(4) based RAID di o kern/60598 scsi wire down of scsi devices conflicts with config o kern/60641 scsi [sym] Sporadic SCSI bus resets with 53C810 under load s kern/61165 scsi [panic] kernel page fault after calling cam_send_ccb o kern/74627 scsi [ahc] [hang] Adaptec 2940U2W Can't boot 5.3 o kern/81887 scsi [aac] Adaptec SCSI 2130S aac0: GetDeviceProbeInfo comm o kern/90282 scsi [sym] SCSI bus resets cause loss of ch device o kern/92798 scsi [ahc] SCSI problem with timeouts o kern/93128 scsi [sym] FreeBSD 6.1 BETA 1 has problems with Symbios/LSI o kern/94838 scsi Kernel panic while mounting SD card with lock switch o o kern/99954 scsi [ahc] reading from DVD failes on 6.x (regression) 15 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/23314 scsi aic driver fails to detect Adaptec 1520B unless PnP is o kern/35234 scsi World access to /dev/pass? (for scanner) requires acce o kern/38828 scsi [feature request] DPT PM2012B/90 doesn't work o kern/44587 scsi dev/dpt/dpt.h is missing defines required for DPT_HAND o kern/76178 scsi [ahd] Problem with ahd and large SCSI Raid system o kern/96133 scsi [scsi] [patch] add scsi quirk for joyfly 128mb flash u o kern/103702 scsi [cam] [patch] ChipsBnk: Unsupported USB memory stick 7 problems total. From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 07:18:10 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E97616A412 for ; Fri, 5 Jan 2007 07:18:10 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 2A41513C44B for ; Fri, 5 Jan 2007 07:18:10 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.13.8/8.13.8) with ESMTP id l056ujEd093058 for ; Thu, 4 Jan 2007 22:56:55 -0800 (PST) (envelope-from mjacob@freebsd.org) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.13.8/8.13.8/Submit) with ESMTP id l056ujpV093055 for ; Thu, 4 Jan 2007 22:56:45 -0800 (PST) (envelope-from mjacob@freebsd.org) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Thu, 4 Jan 2007 22:56:45 -0800 (PST) From: mjacob@freebsd.org X-X-Sender: mjacob@ns1.feral.com To: freebsd-scsi@freebsd.org Message-ID: <20070104225519.Q92958@ns1.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: CAM rescanner thread? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 07:18:10 -0000 Opinions? Seems to do what *I* want for automatically attaching devices for mpt or isp when they appear on the fabric. All you have to do is alloc a ccb && a path and call xpt_rescan. ==== //depot/projects/mjexp/sys/cam/cam_xpt.c#4 - /home/FreeBSD/p4/mjexp/sys/cam/cam_xpt.c ==== @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef PC98 #include /* geometry translation */ @@ -1412,10 +1413,50 @@ return 0; } +/* thread to handle bus rescans */ +static TAILQ_HEAD(, ccb_hdr) ccb_scanq; +static void +xpt_scanner_thread(void *dummy) +{ + mtx_lock(&Giant); + for (;;) { + union ccb *ccb; + tsleep(&ccb_scanq, PRIBIO, "ccb_scanq", 0); + while ((ccb = (union ccb *)TAILQ_FIRST(&ccb_scanq)) != NULL) { + TAILQ_REMOVE(&ccb_scanq, &ccb->ccb_h, sim_links.tqe); + ccb->ccb_h.func_code = XPT_SCAN_BUS; + ccb->ccb_h.cbfcnp = xptdone; + xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 5); + cam_periph_runccb(ccb, NULL, 0, 0, NULL); + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); + } + } +} + +void +xpt_rescan(union ccb *ccb) +{ + struct ccb_hdr *hdr; + GIANT_REQUIRED; + /* + * Don't make duplicate entries for the same paths. + */ + TAILQ_FOREACH(hdr, &ccb_scanq, sim_links.tqe) { + if (xpt_path_comp(hdr->path, ccb->ccb_h.path) == 0) { + xpt_print(ccb->ccb_h.path, "rescan already queued\n"); + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); + return; + } + } + TAILQ_INSERT_TAIL(&ccb_scanq, &ccb->ccb_h, sim_links.tqe); + wakeup(&ccb_scanq); +} + /* Functions accessed by the peripheral drivers */ static void -xpt_init(dummy) - void *dummy; +xpt_init(void *dummy) { struct cam_sim *xpt_sim; struct cam_path *path; @@ -1425,6 +1466,7 @@ TAILQ_INIT(&xpt_busses); TAILQ_INIT(&cam_bioq); SLIST_INIT(&ccb_freeq); + TAILQ_INIT(&ccb_scanq); STAILQ_INIT(&highpowerq); mtx_init(&cam_bioq_lock, "CAM BIOQ lock", NULL, MTX_DEF); @@ -1490,6 +1532,10 @@ "- failing attach\n"); } + /* fire up rescan thread */ + if (kthread_create(xpt_scanner_thread, NULL, NULL, 0, 0, "xpt_thrd")) { + printf("xpt_init: failed to create rescan thread\n"); + } /* Install our software interrupt handlers */ swi_add(NULL, "cambio", camisr, &cam_bioq, SWI_CAMBIO, 0, &cambio_ih); } @@ -4453,8 +4499,7 @@ bus = TAILQ_FIRST(&xpt_busses); retry: /* Find an unoccupied pathid */ - while (bus != NULL - && bus->path_id <= pathid) { + while (bus != NULL && bus->path_id <= pathid) { if (bus->path_id == pathid) pathid++; bus = TAILQ_NEXT(bus, links); ==== //depot/projects/mjexp/sys/cam/cam_xpt.h#2 - /home/FreeBSD/p4/mjexp/sys/cam/cam_xpt.h ==== @@ -72,6 +72,7 @@ struct cam_periph *xpt_path_periph(struct cam_path *path); void xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg); +void xpt_rescan(union ccb *ccb); #endif /* _KERNEL */ #endif /* _CAM_CAM_XPT_H */ From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 16:45:05 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 917F216A403; Fri, 5 Jan 2007 16:45:05 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [64.129.166.50]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB7013C459; Fri, 5 Jan 2007 16:45:05 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.8/8.13.8) with ESMTP id l05GB2kI015783; Fri, 5 Jan 2007 10:11:04 -0600 (CST) (envelope-from anderson@centtech.com) Message-ID: <459E7896.9080504@centtech.com> Date: Fri, 05 Jan 2007 10:11:02 -0600 From: Eric Anderson User-Agent: Thunderbird 1.5.0.9 (X11/20061223) MIME-Version: 1.0 To: mjacob@freebsd.org References: <20070104225519.Q92958@ns1.feral.com> In-Reply-To: <20070104225519.Q92958@ns1.feral.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.88.4/2414/Thu Jan 4 19:41:51 2007 on mh1.centtech.com X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=8.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.6 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on mh1.centtech.com Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? 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, 05 Jan 2007 16:45:05 -0000 On 01/05/07 00:56, mjacob@freebsd.org wrote: > Opinions? Seems to do what *I* want for automatically attaching devices > for mpt or isp when they appear on the fabric. All you have to do is > alloc a ccb && a path and call xpt_rescan. Excuse my lameness: This means that with this patch, you would no longer need to do a 'camcontrol rescan ...'? Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology An undefined problem has an infinite number of solutions. ------------------------------------------------------------------------ From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 17:26:56 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D34B16A40F for ; Fri, 5 Jan 2007 17:26:56 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 5812A13C448 for ; Fri, 5 Jan 2007 17:26:56 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.13.8/8.13.8) with ESMTP id l05HQLHa033584; Fri, 5 Jan 2007 09:26:31 -0800 (PST) (envelope-from mjacob@freebsd.org) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.13.8/8.13.8/Submit) with ESMTP id l05HQLN3033581; Fri, 5 Jan 2007 09:26:21 -0800 (PST) (envelope-from mjacob@freebsd.org) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Fri, 5 Jan 2007 09:26:21 -0800 (PST) From: mjacob@freebsd.org X-X-Sender: mjacob@ns1.feral.com To: Eric Anderson In-Reply-To: <459E7896.9080504@centtech.com> Message-ID: <20070105092342.V33204@ns1.feral.com> References: <20070104225519.Q92958@ns1.feral.com> <459E7896.9080504@centtech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 17:26:56 -0000 On Fri, 5 Jan 2007, Eric Anderson wrote: > On 01/05/07 00:56, mjacob@freebsd.org wrote: >> Opinions? Seems to do what *I* want for automatically attaching devices for >> mpt or isp when they appear on the fabric. All you have to do is >> alloc a ccb && a path and call xpt_rescan. > > Excuse my lameness: > > This means that with this patch, you would no longer need to do a > 'camcontrol rescan ...'? It's not a lame question. It's a good one. Yes-= for SIMs that can call xpt_rescan. That would be isp && mpt. It would apply, btw, also for MPT/SAS. We already have an 'adequate' mechanism for noticing that a drive has gone away. The AC_FOUND_DEVICE doesn't work like you'd expect. It's possible that this just needs to be fixed (to use xpt_rescan :-)). -matt From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 17:29:18 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9242E16A415; Fri, 5 Jan 2007 17:29:18 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 5696813C461; Fri, 5 Jan 2007 17:29:18 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id l05HTCVm067316; Fri, 5 Jan 2007 10:29:17 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <459E8AE7.90104@samsco.org> Date: Fri, 05 Jan 2007 10:29:11 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2pre) Gecko/20061227 SeaMonkey/1.1 MIME-Version: 1.0 To: mjacob@freebsd.org References: <20070104225519.Q92958@ns1.feral.com> In-Reply-To: <20070104225519.Q92958@ns1.feral.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Fri, 05 Jan 2007 10:29:17 -0700 (MST) X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? 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, 05 Jan 2007 17:29:18 -0000 mjacob@freebsd.org wrote: > > Opinions? Seems to do what *I* want for automatically attaching devices > for mpt or isp when they appear on the fabric. All you have to do is > alloc a ccb && a path and call xpt_rescan. Why do you need a separate thread for this? Many other drivers already handle this just fine. Scott From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 17:47:24 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0516216A417 for ; Fri, 5 Jan 2007 17:47:24 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id D715613C4A5 for ; Fri, 5 Jan 2007 17:47:23 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.13.8/8.13.8) with ESMTP id l05HlDsq034976; Fri, 5 Jan 2007 09:47:23 -0800 (PST) (envelope-from mjacob@freebsd.org) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.13.8/8.13.8/Submit) with ESMTP id l05HlDq6034973; Fri, 5 Jan 2007 09:47:13 -0800 (PST) (envelope-from mjacob@freebsd.org) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Fri, 5 Jan 2007 09:47:13 -0800 (PST) From: mjacob@freebsd.org X-X-Sender: mjacob@ns1.feral.com To: Scott Long In-Reply-To: <459E8AE7.90104@samsco.org> Message-ID: <20070105093930.Y34456@ns1.feral.com> References: <20070104225519.Q92958@ns1.feral.com> <459E8AE7.90104@samsco.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 17:47:24 -0000 On Fri, 5 Jan 2007, Scott Long wrote: > mjacob@freebsd.org wrote: >> >> Opinions? Seems to do what *I* want for automatically attaching devices for >> mpt or isp when they appear on the fabric. All you have to do is >> alloc a ccb && a path and call xpt_rescan. > > Why do you need a separate thread for this? Many other drivers already > handle this just fine. In CAM? I did try doing it without a thread and had all sorts of problems that led to panics. I suppose I could try and fix that, but it's also true that notification that things have changed is almost certainly on an ithread and that the begin of a scan starts a heck of a lot of work before returning. D'ya think it's that crucial other than just another proc slot? -matt From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 18:24:46 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A2EE16A417; Fri, 5 Jan 2007 18:24:46 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id E01A813C442; Fri, 5 Jan 2007 18:24:45 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id l05IOdMW067627; Fri, 5 Jan 2007 11:24:44 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <459E97E6.4000603@samsco.org> Date: Fri, 05 Jan 2007 11:24:38 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2pre) Gecko/20061227 SeaMonkey/1.1 MIME-Version: 1.0 To: mjacob@freebsd.org References: <20070104225519.Q92958@ns1.feral.com> <459E8AE7.90104@samsco.org> <20070105093930.Y34456@ns1.feral.com> In-Reply-To: <20070105093930.Y34456@ns1.feral.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Fri, 05 Jan 2007 11:24:44 -0700 (MST) X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? 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, 05 Jan 2007 18:24:46 -0000 mjacob@freebsd.org wrote: > > > On Fri, 5 Jan 2007, Scott Long wrote: > >> mjacob@freebsd.org wrote: >>> >>> Opinions? Seems to do what *I* want for automatically attaching >>> devices for mpt or isp when they appear on the fabric. All you have >>> to do is >>> alloc a ccb && a path and call xpt_rescan. >> >> Why do you need a separate thread for this? Many other drivers >> already handle this just fine. > > In CAM? > > I did try doing it without a thread and had all sorts of problems that > led to panics. I suppose I could try and fix that, but it's also true > that notification that things have changed is almost certainly on an > ithread and that the begin of a scan starts a heck of a lot of work > before returning. > > D'ya think it's that crucial other than just another proc slot? > > -matt > Ok, I see what you're saying. What I think needs to ultimately happen is for the entire probe code to go into a thread. I've tried this a couple of times, but have been caught up in trying to separate out the SPI and non-SPI bits of it. Your patch is looks to be a good start at the more simple approach. Scott From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 18:27:48 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2FC5616A47B; Fri, 5 Jan 2007 18:27:48 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id E4B4313C469; Fri, 5 Jan 2007 18:27:47 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id l05IRfow067646; Fri, 5 Jan 2007 11:27:46 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <459E989C.2020602@samsco.org> Date: Fri, 05 Jan 2007 11:27:40 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2pre) Gecko/20061227 SeaMonkey/1.1 MIME-Version: 1.0 To: mjacob@freebsd.org References: <20070104225519.Q92958@ns1.feral.com> <459E8AE7.90104@samsco.org> <20070105093930.Y34456@ns1.feral.com> <459E97E6.4000603@samsco.org> In-Reply-To: <459E97E6.4000603@samsco.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Fri, 05 Jan 2007 11:27:47 -0700 (MST) X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? 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, 05 Jan 2007 18:27:48 -0000 Scott Long wrote: > mjacob@freebsd.org wrote: >> >> >> On Fri, 5 Jan 2007, Scott Long wrote: >> >>> mjacob@freebsd.org wrote: >>>> >>>> Opinions? Seems to do what *I* want for automatically attaching >>>> devices for mpt or isp when they appear on the fabric. All you have >>>> to do is >>>> alloc a ccb && a path and call xpt_rescan. >>> >>> Why do you need a separate thread for this? Many other drivers >>> already handle this just fine. >> >> In CAM? >> >> I did try doing it without a thread and had all sorts of problems that >> led to panics. I suppose I could try and fix that, but it's also true >> that notification that things have changed is almost certainly on an >> ithread and that the begin of a scan starts a heck of a lot of work >> before returning. >> >> D'ya think it's that crucial other than just another proc slot? >> >> -matt >> > > Ok, I see what you're saying. What I think needs to ultimately happen > is for the entire probe code to go into a thread. I've tried this a > couple of times, but have been caught up in trying to separate out the > SPI and non-SPI bits of it. Your patch is looks to be a good start at > the more simple approach. > > Scott > Oh, one more thing. Instead of it being a new XPT API function, could it be an async op with an appropriate handler in the XPT? Heck, maybe this is exactly how you 'fix' AC_FOUND_DEVICE to DTRT. Scott From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 18:35:34 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8FB116A4C2 for ; Fri, 5 Jan 2007 18:35:34 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 8772313C441 for ; Fri, 5 Jan 2007 18:35:34 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.13.8/8.13.8) with ESMTP id l05IZON7038179; Fri, 5 Jan 2007 10:35:34 -0800 (PST) (envelope-from mjacob@freebsd.org) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.13.8/8.13.8/Submit) with ESMTP id l05IZN8Y038176; Fri, 5 Jan 2007 10:35:24 -0800 (PST) (envelope-from mjacob@freebsd.org) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Fri, 5 Jan 2007 10:35:23 -0800 (PST) From: mjacob@freebsd.org X-X-Sender: mjacob@ns1.feral.com To: Scott Long In-Reply-To: <459E989C.2020602@samsco.org> Message-ID: <20070105103431.A34456@ns1.feral.com> References: <20070104225519.Q92958@ns1.feral.com> <459E8AE7.90104@samsco.org> <20070105093930.Y34456@ns1.feral.com> <459E97E6.4000603@samsco.org> <459E989C.2020602@samsco.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 18:35:34 -0000 >> >> Ok, I see what you're saying. What I think needs to ultimately happen is >> for the entire probe code to go into a thread. I've tried this a >> couple of times, but have been caught up in trying to separate out the >> SPI and non-SPI bits of it. Your patch is looks to be a good start at >> the more simple approach. >> >> Scott >> > > Oh, one more thing. Instead of it being a new XPT API function, could it be > an async op with an appropriate handler in the XPT? Heck, maybe > this is exactly how you 'fix' AC_FOUND_DEVICE to DTRT. Yes. *blush*. You're right that this would be a better idea :-). Thanks. -matt From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 18:50:55 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF14316A415 for ; Fri, 5 Jan 2007 18:50:55 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0E113C43E for ; Fri, 5 Jan 2007 18:50:52 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.13.8/8.13.8) with ESMTP id l05IogOQ039172; Fri, 5 Jan 2007 10:50:52 -0800 (PST) (envelope-from mjacob@freebsd.org) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.13.8/8.13.8/Submit) with ESMTP id l05Iog27039169; Fri, 5 Jan 2007 10:50:42 -0800 (PST) (envelope-from mjacob@freebsd.org) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Fri, 5 Jan 2007 10:50:42 -0800 (PST) From: mjacob@freebsd.org X-X-Sender: mjacob@ns1.feral.com To: Scott Long In-Reply-To: <20070105103431.A34456@ns1.feral.com> Message-ID: <20070105104021.D34456@ns1.feral.com> References: <20070104225519.Q92958@ns1.feral.com> <459E8AE7.90104@samsco.org> <20070105093930.Y34456@ns1.feral.com> <459E97E6.4000603@samsco.org> <459E989C.2020602@samsco.org> <20070105103431.A34456@ns1.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 18:50:56 -0000 On Fri, 5 Jan 2007, mjacob@freebsd.org wrote: > > >>> >>> Ok, I see what you're saying. What I think needs to ultimately happen is >>> for the entire probe code to go into a thread. I've tried this a >>> couple of times, but have been caught up in trying to separate out the >>> SPI and non-SPI bits of it. Your patch is looks to be a good start at >>> the more simple approach. >>> >>> Scott >>> >> >> Oh, one more thing. Instead of it being a new XPT API function, could it >> be an async op with an appropriate handler in the XPT? Heck, maybe >> this is exactly how you 'fix' AC_FOUND_DEVICE to DTRT. > > Yes. *blush*. You're right that this would be a better idea :-). Thanks. Actually, no. Now that I think about it and look at the code in cam_xpt.c, AC_FOUND_DEVICE seems to have a different semantic. It seems to be an announcement to all periph's who care *after* the device has been probed and configured. If you look at xpt_async itself, it walks existing target and device entries delivering the async_code. Even if the path for the async event is a wildcard, it still needs a cam_ed to deliver something to. The broadcast async stuff appears like it is *thinking* about having this done. In fact, code in da (daasync) seems to want to do this- but it requires initial inquiry data (via a ccb_getdev argument) which really makes me scratch my head a bit. This is a prime example of how not having a mind-meld with Ken or Justin really hurts. We can ask them what they were thinking about this, and it'll probably make sense, but because this isn't all very highly documented the architecture is often what you *guess* it is :-). -matt From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 20:07:14 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E4D816A40F; Fri, 5 Jan 2007 20:07:14 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 14FEB13C457; Fri, 5 Jan 2007 20:07:11 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id l05K75IC068245; Fri, 5 Jan 2007 13:07:11 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <459EAFE8.5070502@samsco.org> Date: Fri, 05 Jan 2007 13:07:04 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.2pre) Gecko/20061227 SeaMonkey/1.1 MIME-Version: 1.0 To: mjacob@freebsd.org References: <20070104225519.Q92958@ns1.feral.com> <459E8AE7.90104@samsco.org> <20070105093930.Y34456@ns1.feral.com> <459E97E6.4000603@samsco.org> <459E989C.2020602@samsco.org> <20070105103431.A34456@ns1.feral.com> <20070105104021.D34456@ns1.feral.com> In-Reply-To: <20070105104021.D34456@ns1.feral.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Fri, 05 Jan 2007 13:07:11 -0700 (MST) X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? 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, 05 Jan 2007 20:07:14 -0000 mjacob@freebsd.org wrote: > > > On Fri, 5 Jan 2007, mjacob@freebsd.org wrote: > >> >> >>>> >>>> Ok, I see what you're saying. What I think needs to ultimately >>>> happen is for the entire probe code to go into a thread. I've tried >>>> this a >>>> couple of times, but have been caught up in trying to separate out the >>>> SPI and non-SPI bits of it. Your patch is looks to be a good start at >>>> the more simple approach. >>>> >>>> Scott >>>> >>> >>> Oh, one more thing. Instead of it being a new XPT API function, >>> could it be an async op with an appropriate handler in the XPT? >>> Heck, maybe >>> this is exactly how you 'fix' AC_FOUND_DEVICE to DTRT. >> >> Yes. *blush*. You're right that this would be a better idea :-). Thanks. > > Actually, no. Now that I think about it and look at the code in > cam_xpt.c, AC_FOUND_DEVICE seems to have a different semantic. It seems > to be an announcement to all periph's who care *after* the device has > been probed and configured. > > If you look at xpt_async itself, it walks existing target and device > entries delivering the async_code. Even if the path for the async event > is a wildcard, it still needs a cam_ed to deliver something to. > > The broadcast async stuff appears like it is *thinking* about having > this done. In fact, code in da (daasync) seems to want to do this- but > it requires initial inquiry data (via a ccb_getdev argument) which > really makes me scratch my head a bit. > > This is a prime example of how not having a mind-meld with Ken or Justin > really hurts. We can ask them what they were thinking about this, and > it'll probably make sense, but because this isn't all very highly > documented the architecture is often what you *guess* it is :-). > > -matt > My next idea would be to just make it a CCB action then. I'm trying to keep down the number of entry points so that it doesn't further complicate locking. But we should also talk to Ken and Justin about it. Scott From owner-freebsd-scsi@FreeBSD.ORG Fri Jan 5 20:48:11 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C91F16A403 for ; Fri, 5 Jan 2007 20:48:11 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id E145413C448 for ; Fri, 5 Jan 2007 20:48:10 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.13.8/8.13.8) with ESMTP id l05KIlrx045593; Fri, 5 Jan 2007 12:18:57 -0800 (PST) (envelope-from mjacob@freebsd.org) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.13.8/8.13.8/Submit) with ESMTP id l05KIlT2045590; Fri, 5 Jan 2007 12:18:47 -0800 (PST) (envelope-from mjacob@freebsd.org) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Fri, 5 Jan 2007 12:18:47 -0800 (PST) From: mjacob@freebsd.org X-X-Sender: mjacob@ns1.feral.com To: Scott Long In-Reply-To: <459EAFE8.5070502@samsco.org> Message-ID: <20070105121832.X41680@ns1.feral.com> References: <20070104225519.Q92958@ns1.feral.com> <459E8AE7.90104@samsco.org> <20070105093930.Y34456@ns1.feral.com> <459E97E6.4000603@samsco.org> <459E989C.2020602@samsco.org> <20070105103431.A34456@ns1.feral.com> <20070105104021.D34456@ns1.feral.com> <459EAFE8.5070502@samsco.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-scsi@freebsd.org Subject: Re: CAM rescanner thread? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 20:48:11 -0000 >> > > My next idea would be to just make it a CCB action then. I'm trying to keep > down the number of entry points so that it doesn't further complicate > locking. But we should also talk to Ken and Justin about it. > yes and yes.