diff options
author | mjacob <mjacob@FreeBSD.org> | 2010-03-17 02:48:14 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2010-03-17 02:48:14 +0000 |
commit | beacc60317b27a9ab9f12cb5d16b7749a55cebaf (patch) | |
tree | 9b59548fccb01867380e2ab45c7c9743eebf5e7f /sys/dev/isp/isp_freebsd.c | |
parent | a16f0fefdce804c5d60c0aea44277f2cb95d3751 (diff) | |
download | FreeBSD-src-beacc60317b27a9ab9f12cb5d16b7749a55cebaf.zip FreeBSD-src-beacc60317b27a9ab9f12cb5d16b7749a55cebaf.tar.gz |
Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.
Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
turned off autologin and find them, or rather don't, via camcontrol rescan.
MFC after: 1 month
Diffstat (limited to 'sys/dev/isp/isp_freebsd.c')
-rw-r--r-- | sys/dev/isp/isp_freebsd.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index 902c827..ca459f3 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -3950,11 +3950,15 @@ isp_gdt(void *arg) if (lp->dev_map_idx == 0 || lp->target_mode) { continue; } - if (lp->new_reserved == 0) { + /* + * We can use new_portid here because it is untouched + * while the state is ZOMBIE + */ + if (lp->new_portid == 0) { continue; } - lp->new_reserved -= 1; - if (lp->new_reserved != 0) { + lp->new_portid -= 1; + if (lp->new_portid != 0) { more_to_do++; continue; } @@ -4064,7 +4068,7 @@ isp_kthread(void *arg) * * If not, we simply just wait for loop to come up. */ - if (lb && (fc->role & ISP_ROLE_INITIATOR)) { + if (lb && (FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR)) { /* * Increment loop down time by the last sleep interval */ @@ -4932,7 +4936,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) /* * We don't do any simq freezing if we are only in target mode */ - if (fc->role & ISP_ROLE_INITIATOR) { + if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) { if (fc->path) { isp_freeze_loopdown(isp, bus, msg); } @@ -4968,7 +4972,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) va_end(ap); fc = ISP_FC_PC(isp, bus); lp->reserved = 0; - if ((fc->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { + if ((FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { int dbidx = lp - FCPARAM(isp, bus)->portdb; int i; @@ -5056,10 +5060,13 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) * * If it isn't marked that isp_gdt is going to get rid of it, * announce that it's gone. + * + * We can use new_portid for the gone timer because it's + * undefined while the state is ZOMBIE. */ if (lp->dev_map_idx && lp->reserved == 0) { lp->reserved = 1; - lp->new_reserved = ISP_FC_PC(isp, bus)->gone_device_time; + lp->new_portid = ISP_FC_PC(isp, bus)->gone_device_time; lp->state = FC_PORTDB_STATE_ZOMBIE; if (fc->ready && !callout_active(&fc->gdt)) { isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus); @@ -5106,7 +5113,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) callout_stop(&fc->ldt); } isp_prt(isp, ISP_LOGINFO, msg, bus); - if (fc->role & ISP_ROLE_INITIATOR) { + if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, bus, msg); } wakeup(fc); |