summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpt
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-05-21 12:36:40 +0000
committerjhb <jhb@FreeBSD.org>2009-05-21 12:36:40 +0000
commitf8c44f421431480944363c3b91303e82e91d0797 (patch)
treef77c12e073da2787df9873a642af58b376263e00 /sys/dev/mpt
parent333b42e3d881644853b2bf9e6e64066dfa647d9f (diff)
downloadFreeBSD-src-f8c44f421431480944363c3b91303e82e91d0797.zip
FreeBSD-src-f8c44f421431480944363c3b91303e82e91d0797.tar.gz
Largely revert the earlier change to use a single CCB for the RAID recovery
thread. Multiple RAID events in quick succession can cause an additional bus rescan to be scheduled before an earlier scan has completed. In this case the driver was attempting to use the same CCB storage for two requests. PR: kern/130330 Reviewed by: Riccardo Torrini riccardo.torrini | esaote com MFC after: 1 week
Diffstat (limited to 'sys/dev/mpt')
-rw-r--r--sys/dev/mpt/mpt_raid.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/mpt/mpt_raid.c b/sys/dev/mpt/mpt_raid.c
index 0d5e03a..6b7eb7b 100644
--- a/sys/dev/mpt/mpt_raid.c
+++ b/sys/dev/mpt/mpt_raid.c
@@ -658,19 +658,19 @@ mpt_terminate_raid_thread(struct mpt_softc *mpt)
static void
mpt_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb)
{
+
xpt_free_path(ccb->ccb_h.path);
+ xpt_free_ccb(ccb);
}
static void
mpt_raid_thread(void *arg)
{
struct mpt_softc *mpt;
- union ccb *ccb;
int firstrun;
mpt = (struct mpt_softc *)arg;
firstrun = 1;
- ccb = xpt_alloc_ccb();
MPT_LOCK(mpt);
while (mpt->shutdwn_raid == 0) {
@@ -698,15 +698,21 @@ mpt_raid_thread(void *arg)
}
if (mpt->raid_rescan != 0) {
+ union ccb *ccb;
struct cam_path *path;
int error;
mpt->raid_rescan = 0;
+ MPT_UNLOCK(mpt);
+ ccb = xpt_alloc_ccb();
+
+ MPT_LOCK(mpt);
error = xpt_create_path(&path, xpt_periph,
cam_sim_path(mpt->phydisk_sim),
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
if (error != CAM_REQ_CMP) {
+ xpt_free_ccb(ccb);
mpt_prt(mpt, "Unable to rescan RAID Bus!\n");
} else {
xpt_setup_ccb(&ccb->ccb_h, path, 5);
@@ -719,7 +725,6 @@ mpt_raid_thread(void *arg)
}
}
}
- xpt_free_ccb(ccb);
mpt->raid_thread = NULL;
wakeup(&mpt->raid_thread);
MPT_UNLOCK(mpt);
OpenPOWER on IntegriCloud