From owner-freebsd-scsi@FreeBSD.ORG Sun Aug 7 21:27:10 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 D6A57106564A for ; Sun, 7 Aug 2011 21:27:10 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id A3DB08FC0A for ; Sun, 7 Aug 2011 21:27:10 +0000 (UTC) Received: from [192.168.135.103] (c-24-7-47-62.hsd1.ca.comcast.net [24.7.47.62]) (authenticated bits=0) by ns1.feral.com (8.14.4/8.14.4) with ESMTP id p77LR8FO009197 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Sun, 7 Aug 2011 14:27:09 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4E3F0332.7030004@feral.com> Date: Sun, 07 Aug 2011 14:27:14 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-scsi@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.67.166.1]); Sun, 07 Aug 2011 14:27:09 -0700 (PDT) Subject: some changes to xpt to help make unloading sim modules safer 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: Sun, 07 Aug 2011 21:27:10 -0000 See http://people.freebsd.org/~mjacob/xpt_patches.txt The first one come from a coworker (Chuck Tuffli) who found a hole xpt_create_path_unlocked. I added a few after that to guard against overrunning some counters so that they would wrap. It helped me find out what was going on much easier by adding the function described here: http://people.freebsd.org/~mjacob/xpt_path_counts.txt Finally, http://people.freebsd.org/~mjacob/isp_patches.txt makes isp safe for unload as a module. There's some ambiguity over whether it's safe to unload when a periph is open. Using xpt_path_counts to check with the bus reference count is > 3 for each scsibus attached to each isp sim is a way to avoid that. Comments? From owner-freebsd-scsi@FreeBSD.ORG Mon Aug 8 11:07:16 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 055E01065677 for ; Mon, 8 Aug 2011 11:07:16 +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 E79D58FC08 for ; Mon, 8 Aug 2011 11:07:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p78B7F3K078661 for ; Mon, 8 Aug 2011 11:07:15 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p78B7FNp078659 for freebsd-scsi@FreeBSD.org; Mon, 8 Aug 2011 11:07:15 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 8 Aug 2011 11:07:15 GMT Message-Id: <201108081107.p78B7FNp078659@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, 08 Aug 2011 11:07:16 -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/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/124667 scsi [amd] [panic] FreeBSD-7 kernel page faults at amd-scsi 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 48 problems total. From owner-freebsd-scsi@FreeBSD.ORG Mon Aug 8 15:22:10 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 F08E0106566B for ; Mon, 8 Aug 2011 15:22:10 +0000 (UTC) (envelope-from chuck@tuffli.net) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id BAD3E8FC17 for ; Mon, 8 Aug 2011 15:22:10 +0000 (UTC) Received: by qwc9 with SMTP id 9so1123844qwc.13 for ; Mon, 08 Aug 2011 08:22:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.249.208 with SMTP id ml16mr4289126qcb.163.1312815152445; Mon, 08 Aug 2011 07:52:32 -0700 (PDT) Received: by 10.229.156.207 with HTTP; Mon, 8 Aug 2011 07:52:32 -0700 (PDT) In-Reply-To: <4E3F0332.7030004@feral.com> References: <4E3F0332.7030004@feral.com> Date: Mon, 8 Aug 2011 07:52:32 -0700 Message-ID: From: Chuck Tuffli To: Matthew Jacob Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-scsi@freebsd.org Subject: Re: some changes to xpt to help make unloading sim modules safer 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, 08 Aug 2011 15:22:11 -0000 On Sun, Aug 7, 2011 at 2:27 PM, Matthew Jacob wrote: > > See http://people.freebsd.org/~mjacob/xpt_patches.txt Matt - Thanks for doing this. So it seems the rule is to hold xsoftc.xpt_topo_lock while modifying bus->refcount . If so, does xpt_alloc_target need mtx_lock() / mtx_unlock() around bus->refcount++ ? ---chuck From owner-freebsd-scsi@FreeBSD.ORG Mon Aug 8 15:57:24 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 DE3101065670 for ; Mon, 8 Aug 2011 15:57:24 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id A99458FC16 for ; Mon, 8 Aug 2011 15:57:24 +0000 (UTC) Received: from [192.168.135.110] (c-24-7-47-62.hsd1.ca.comcast.net [24.7.47.62]) (authenticated bits=0) by ns1.feral.com (8.14.4/8.14.4) with ESMTP id p78FvNNm005484 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Mon, 8 Aug 2011 08:57:24 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4E40075E.3020001@feral.com> Date: Mon, 08 Aug 2011 08:57:18 -0700 From: Matthew Jacob User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-scsi@freebsd.org References: <4E3F0332.7030004@feral.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.67.166.1]); Mon, 08 Aug 2011 08:57:24 -0700 (PDT) Subject: Re: some changes to xpt to help make unloading sim modules safer 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, 08 Aug 2011 15:57:24 -0000 On 8/8/2011 7:52 AM, Chuck Tuffli wrote: > On Sun, Aug 7, 2011 at 2:27 PM, Matthew Jacob wrote: >> See http://people.freebsd.org/~mjacob/xpt_patches.txt > Matt - > > Thanks for doing this. So it seems the rule is to hold > xsoftc.xpt_topo_lock while modifying bus->refcount . If so, does > xpt_alloc_target need mtx_lock() / mtx_unlock() around bus->refcount++ > ? > > By jove, I think you're right! From owner-freebsd-scsi@FreeBSD.ORG Tue Aug 9 19:39:53 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 32740106566B for ; Tue, 9 Aug 2011 19:39:53 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id EE47E8FC0A for ; Tue, 9 Aug 2011 19:39:52 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id p79JdnZK021146; Tue, 9 Aug 2011 13:39:49 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id p79Jdnp2021145; Tue, 9 Aug 2011 13:39:49 -0600 (MDT) (envelope-from ken) Date: Tue, 9 Aug 2011 13:39:49 -0600 From: "Kenneth D. Merry" To: Matthew Jacob Message-ID: <20110809193949.GA93077@nargothrond.kdm.org> References: <4E3F0332.7030004@feral.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E3F0332.7030004@feral.com> User-Agent: Mutt/1.4.2i Cc: freebsd-scsi@freebsd.org Subject: Re: some changes to xpt to help make unloading sim modules safer 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, 09 Aug 2011 19:39:53 -0000 On Sun, Aug 07, 2011 at 14:27:14 -0700, Matthew Jacob wrote: > > See http://people.freebsd.org/~mjacob/xpt_patches.txt > > The first one come from a coworker (Chuck Tuffli) who found a hole > xpt_create_path_unlocked. This looks fine. > I added a few after that to guard against overrunning some counters so > that they would wrap. Just out of curiosity, have you seen instances where the counters have gone negative? > It helped me find out what was going on much easier by adding the > function described here: > http://people.freebsd.org/~mjacob/xpt_path_counts.txt > > Finally, http://people.freebsd.org/~mjacob/isp_patches.txt makes isp > safe for unload as a module. > > There's some ambiguity over whether it's safe to unload when a periph is > open. Using xpt_path_counts to check with the bus reference count is > 3 > for each scsibus attached to each isp sim is a way to avoid that. > > Comments? I would think you'd want to wait until the periph is closed, but perhaps there is a way to get away with it if there aren't any commands outstanding in the SIM. You could send async notifications that all of the devices on the bus have gone away, and then once everything disappears, you could finish the unload. Ken -- Kenneth Merry ken@kdm.org From owner-freebsd-scsi@FreeBSD.ORG Tue Aug 9 20:18: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 07371106566C for ; Tue, 9 Aug 2011 20:18:31 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id C6ED68FC0C for ; Tue, 9 Aug 2011 20:18:30 +0000 (UTC) Received: from [192.168.135.110] (c-24-7-47-62.hsd1.ca.comcast.net [24.7.47.62]) (authenticated bits=0) by ns1.feral.com (8.14.4/8.14.4) with ESMTP id p79KITck038249 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Tue, 9 Aug 2011 13:18:30 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4E41960F.9040203@feral.com> Date: Tue, 09 Aug 2011 13:18:23 -0700 From: Matthew Jacob User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-scsi@freebsd.org References: <4E3F0332.7030004@feral.com> <20110809193949.GA93077@nargothrond.kdm.org> In-Reply-To: <20110809193949.GA93077@nargothrond.kdm.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.67.166.1]); Tue, 09 Aug 2011 13:18:30 -0700 (PDT) Subject: Re: some changes to xpt to help make unloading sim modules safer 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, 09 Aug 2011 20:18:31 -0000 On 8/9/2011 12:39 PM, Kenneth D. Merry wrote: > >> I added a few after that to guard against overrunning some counters so >> that they would wrap. > Just out of curiosity, have you seen instances where the counters have > gone negative? No- but it's one of those things you'd be unlikely to notice w/o unloads :-) > > I would think you'd want to wait until the periph is closed, but perhaps > there is a way to get away with it if there aren't any commands outstanding > in the SIM. > > You could send async notifications that all of the devices on the bus have > gone away, and then once everything disappears, you could finish the > unload. > > \ Either would work, but I'm inclined to think it'd be better if we finish newbusifying all of this. > Ken