Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Oct 2010 10:10:31 -0400
From:      Ed Maste <emaste@FreeBSD.org>
To:        Scott Long <scottl@samsco.org>
Cc:        freebsd-scsi@FreeBSD.org
Subject:   Re: camcontrol rescan all fails if there is no bus 0
Message-ID:  <20101031141031.GA14661@sandvine.com>
In-Reply-To: <9EC3B874-B089-4ED4-9A12-FA7A0E170A7B@samsco.org>
References:  <AANLkTiksEn2DP7Y=x=u99qcf28bBEspOWRnsWUfhaOPg@mail.gmail.com> <E4EB1292-C4F8-4385-8ACD-58BE792988F1@samsco.org> <20101026160457.GA61133@sandvine.com> <9EC3B874-B089-4ED4-9A12-FA7A0E170A7B@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101031141031.GA14661>