Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Feb 2003 01:04:56 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        firewire@FreeBSD.org
Subject:   Re: Bad news: bus resets not fixed yet
Message-ID:  <ybsznolll5j.wl@ett.sat.t.u-tokyo.ac.jp>
In-Reply-To: <ybs3cmdn37u.wl@ett.sat.t.u-tokyo.ac.jp>
References:  <20030222002547.GA1247@dhcp01.pn.xcllnt.net> <ybssmugmopp.wl@ett.sat.t.u-tokyo.ac.jp> <20030222194741.GA579@dhcp01.pn.xcllnt.net> <ybs3cmdn37u.wl@ett.sat.t.u-tokyo.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
At Mon, 24 Feb 2003 23:49:25 +0900,
Hidetoshi Shimokawa wrote:
> Does your BIOS support boot from the drive?
> It seems that the drive is already logged-in by BIOS and
> rejecting login ORB by bus reset....

How about this patch? (against -current)

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html

Index: sbp.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/firewire/sbp.c,v
retrieving revision 1.34
diff -u -r1.34 sbp.c
--- sbp.c	21 Feb 2003 02:27:13 -0000	1.34
+++ sbp.c	24 Feb 2003 15:59:06 -0000
@@ -247,6 +247,7 @@
 	struct firewire_dev_comm fd;
 	unsigned char flags;
 	struct cam_sim  *sim;
+	struct cam_path  *path;
 	struct sbp_target targets[SBP_NUM_TARGETS];
 	struct fw_bind fwb;
 	STAILQ_HEAD(, sbp_ocb) free_ocbs;
@@ -352,6 +353,9 @@
 	}
 
 	device_set_desc(dev, "SBP2/SCSI over firewire");
+
+	if (bootverbose)
+		debug = 1;
 	return (0);
 }
 
@@ -593,7 +597,9 @@
 				/* new or revived target */
 				sbp_probe_lun(sdev);
 				if (auto_login) {
+#if 0
 					sdev->status = SBP_DEV_TOATTACH;
+#endif
 					sbp_mgm_orb(sdev, ORB_FUN_LGI, 0, 0);
 				}
 				break;
@@ -605,7 +611,11 @@
 			}
 SBP_DEBUG(0)
 			sbp_show_sdev_info(sdev, 
+#if 0
 					(sdev->status == SBP_DEV_TOATTACH));
+#else
+					(sdev->status == SBP_DEV_RESET));
+#endif
 END_DEBUG
 		} else {
 			switch (sdev->status) {
@@ -647,6 +657,7 @@
 #if 0
 	xpt_freeze_simq(sbp->sim, /*count*/ 1);
 #endif
+	xpt_async(AC_BUS_RESET, sbp->path, /*arg*/ NULL);
 	if (sbp_cold > 0)
 		sbp_cold --;
 	/* Gabage Collection */
@@ -1488,6 +1499,9 @@
 printf("login: len %d, ID %d, cmd %08x%08x, recon_hold %d\n", login_res->len, login_res->id, login_res->cmd_hi, login_res->cmd_lo, ntohs(login_res->recon_hold));
 END_DEBUG
 #if 1
+					sdev->status = SBP_DEV_TOATTACH;
+#endif
+#if 1
 					sbp_busy_timeout(sdev);
 #else
 					sbp_mgm_orb(sdev, ORB_FUN_ATS, 0, 0);
@@ -1687,12 +1701,12 @@
 		sbp_free_ocb(sbp, &sbp->ocb[i]);
 	}
 
-	if (xpt_bus_register(sbp->sim, /*bus*/0) != CAM_SUCCESS) {
-		cam_sim_free(sbp->sim, /*free_devq*/TRUE);
-		contigfree(sbp->ocb, sizeof (struct sbp_ocb) * SBP_NUM_OCB,
-									M_SBP);
-		return (ENXIO);
-	}
+	if (xpt_bus_register(sbp->sim, /*bus*/0) != CAM_SUCCESS)
+		goto fail;
+
+	if (xpt_create_path(&sbp->path, 0, cam_sim_path(sbp->sim),
+			CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)
+		goto fail;
 
 	xfer = fw_xfer_alloc(M_SBP);
 	xfer->act.hand = sbp_recv;
@@ -1718,6 +1732,10 @@
 	}
 
 	return (0);
+fail:
+	cam_sim_free(sbp->sim, /*free_devq*/TRUE);
+	contigfree(sbp->ocb, sizeof (struct sbp_ocb) * SBP_NUM_OCB, M_SBP);
+	return (ENXIO);
 }
 
 static int

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-firewire" in the body of the message




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