From owner-freebsd-scsi@FreeBSD.ORG Sun Oct 31 19:16:36 2010 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 7A79B106564A for ; Sun, 31 Oct 2010 19:16:36 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 889A58FC0A for ; Sun, 31 Oct 2010 19:16:35 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA05844; Sun, 31 Oct 2010 21:16:31 +0200 (EET) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PCdOJ-000Pei-Jw; Sun, 31 Oct 2010 21:16:31 +0200 Message-ID: <4CCDC08E.7020506@icyb.net.ua> Date: Sun, 31 Oct 2010 21:16:30 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Ed Maste References: <20101026160457.GA61133@sandvine.com> <9EC3B874-B089-4ED4-9A12-FA7A0E170A7B@samsco.org> <20101031141031.GA14661@sandvine.com> In-Reply-To: <20101031141031.GA14661@sandvine.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-scsi@FreeBSD.org Subject: Re: camcontrol rescan all fails if there is no bus 0 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, 31 Oct 2010 19:16:36 -0000 on 31/10/2010 16:10 Ed Maste said the following: > On Tue, Oct 26, 2010 at 10:41:11AM -0600, Scott Long wrote: > >> Ok, I guess I need to see if CAM_XPT_PATH_ID can get returned from the >> devmatch. > > Is that not handled by this code that parses the returned XPT_DEV_MATCH > results in in reset_or_rescan_bus: > > for (i = 0; i < matchccb.cdm.num_matches; i++) { > struct bus_match_result *bus_result; > > ... > > bus_result = &matchccb.cdm.matches[i].result.bus_result; > > /* > * We don't want to rescan or reset the xpt bus. > * See above. > */ > if ((int)bus_result->path_id == -1) > continue; > > That is, we do the actual rescan only on legitimate busses after the > XPT_DEV_MATCH ioctl returns. > >> What happens with this patch if you run it with no real buses >> registered (i.e. cam module present, but no SIMs present)? > > From the user's perspective, with the stock camcontrol and no > registered busses I get: > > [root@edlaptop ~]# camcontrol rescan all > camcontrol: CAMIOCOMMAND ioctl failed: Invalid argument > > With the patch: > > [root@edlaptop ~]# ./camcontrol rescan all > [root@edlaptop ~]# > > And then with a umass device attached: > > [root@edlaptop ~]# ./camcontrol rescan all > Re-scan of bus 0 was successful Can you test a synthetic situation where you have e.g. bus 1, but no bus 0 ? E.g. by having two umass devices connected during boot and then removing one of them. -- Andriy Gapon