summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpt
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2008-03-31 21:54:05 +0000
committerscottl <scottl@FreeBSD.org>2008-03-31 21:54:05 +0000
commitf69578dd1e2f1de1b7e84b05f1b918f13bc544b1 (patch)
tree0f64337f74ca274135d5e2a55cad2e52459402f4 /sys/dev/mpt
parent15067326c7ad1fbebd8a7ab45abcf83fcb64d1d9 (diff)
downloadFreeBSD-src-f69578dd1e2f1de1b7e84b05f1b918f13bc544b1.zip
FreeBSD-src-f69578dd1e2f1de1b7e84b05f1b918f13bc544b1.tar.gz
The MPT driver treats the "core" module with the same importance and
abstraction as the RAID and CAM modules, making it nearly impossible for enough initialization to be done in time for the RAID module to know whether to attach. On top of this, no reset was being done on the controller on attach, in violation of the spec. Additionally, the port enable step was being deferred to the end of the attach process, long after it should have been done to ensure reliable operation from the controller. Fix all of these with a few hacks to force the "attach" and "enable" steps of the core module early on, and ensure that a reset and port enable also happens early on. In the future, the driver needs to be refactored to eliminate the core module abstraction, clean up withe reset/enable steps, and defer event messages until all of the modules are available to recieve them.
Diffstat (limited to 'sys/dev/mpt')
-rw-r--r--sys/dev/mpt/mpt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/mpt/mpt.c b/sys/dev/mpt/mpt.c
index b35d109..4802234 100644
--- a/sys/dev/mpt/mpt.c
+++ b/sys/dev/mpt/mpt.c
@@ -218,8 +218,8 @@ static struct mpt_personality mpt_core_personality =
{
.name = "mpt_core",
.load = mpt_core_load,
- .attach = mpt_core_attach,
- .enable = mpt_core_enable,
+// .attach = mpt_core_attach,
+// .enable = mpt_core_enable,
.event = mpt_core_event,
.reset = mpt_core_ioc_reset,
.shutdown = mpt_core_shutdown,
@@ -2144,6 +2144,9 @@ mpt_attach(struct mpt_softc *mpt)
int i;
int error;
+ mpt_core_attach(mpt);
+ mpt_core_enable(mpt);
+
TAILQ_INSERT_TAIL(&mpt_tailq, mpt, links);
for (i = 0; i < MPT_MAX_PERSONALITIES; i++) {
pers = mpt_personalities[i];
@@ -2265,7 +2268,7 @@ mpt_core_attach(struct mpt_softc *mpt)
mpt_ioc_diag(mpt_read(mpt, MPT_OFFSET_DOORBELL)));
MPT_LOCK(mpt);
- error = mpt_configure_ioc(mpt, 0, 0);
+ error = mpt_configure_ioc(mpt, 0, 1);
MPT_UNLOCK(mpt);
return (error);
@@ -2683,7 +2686,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, int tn, int needreset)
/*
* Enable the IOC
*/
- if (mpt_enable_ioc(mpt, 0) != MPT_OK) {
+ if (mpt_enable_ioc(mpt, 1) != MPT_OK) {
mpt_prt(mpt, "unable to initialize IOC\n");
return (ENXIO);
}
OpenPOWER on IntegriCloud