From owner-freebsd-scsi@FreeBSD.ORG Sun Oct 31 17:10:20 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 EEF57106567A; Sun, 31 Oct 2010 17:10:20 +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 ABDA18FC0A; Sun, 31 Oct 2010 17:10:20 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o9VHAHxi088149; Sun, 31 Oct 2010 11:10:17 -0600 (MDT) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <20101031141031.GA14661@sandvine.com> Date: Sun, 31 Oct 2010 11:10:16 -0600 Content-Transfer-Encoding: 7bit Message-Id: <739687DC-7412-4FAB-A570-A2FD9DC3E06A@samsco.org> References: <20101026160457.GA61133@sandvine.com> <9EC3B874-B089-4ED4-9A12-FA7A0E170A7B@samsco.org> <20101031141031.GA14661@sandvine.com> To: Ed Maste X-Mailer: Apple Mail (2.1081) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org 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 17:10:21 -0000 On Oct 31, 2010, at 8:10 AM, Ed Maste wrote: > 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 > > -Ed That all looks entirely reasonable. Thanks for researching it. Scott