Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2003 17:39:58 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        firewire@FreeBSD.org
Subject:   Re: Firewire regression
Message-ID:  <ybsheazny5d.wl@ett.sat.t.u-tokyo.ac.jp>
In-Reply-To: <20030220082209.GA551@dhcp01.pn.xcllnt.net>
References:  <20030219081818.GA668@dhcp01.pn.xcllnt.net> <ybsr8a4o61q.wl@ett.sat.t.u-tokyo.ac.jp> <20030219212811.GA523@athlon.pn.xcllnt.net> <ybsof57o6ql.wl@ett.sat.t.u-tokyo.ac.jp> <20030220082209.GA551@dhcp01.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I have some ideas about it but none of them explains the problem
cleanly.. Please try next patch attached this mail.
I cannot reproduce the problem on any of my hardware.

When did you build the last kernel without the problem?

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


At Thu, 20 Feb 2003 00:22:09 -0800,
Marcel Moolenaar wrote:
> 
> On Thu, Feb 20, 2003 at 02:34:26PM +0900, Hidetoshi Shimokawa wrote:
> > The CD seems keeping to initiate bus reset. I don't know why..
> 
> I haven't had the time to narrow it down to a specific commit. Let
> me know if that would help. Otherwise I'll assume you know roughly
> what might have caused it.
> 
> > This shouldn't happen because these address range should be handled
> > by OHCI. Could you try the follwing patch?
> 
> Sorry. Doesn't make a difference.
> 
> I don't know anything about firewire so there's at this time not
> much I can do than apply patches and try them out.
> 
> -- 
>  Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

Index: sbp.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/firewire/sbp.c,v
retrieving revision 1.32
diff -u -r1.32 sbp.c
--- sbp.c	17 Feb 2003 14:24:06 -0000	1.32
+++ sbp.c	20 Feb 2003 06:17:43 -0000
@@ -131,9 +131,10 @@
 #define ORB_RES_ILLE 2
 #define ORB_RES_VEND 3
 
-static int debug = 0;
+static int debug = 1;
 static int auto_login = 1;
 static int max_speed = 2;
+static int sbp_cold = 1;
 
 SYSCTL_DECL(_hw_firewire);
 SYSCTL_NODE(_hw_firewire, OID_AUTO, sbp, CTLFLAG_RD, 0, "SBP-II Subsystem");
@@ -640,12 +641,14 @@
 	struct fw_device *fwdev;
 	int i, alive;
 
-SBP_DEBUG(1)
-	printf("sbp_post_explore\n");
+SBP_DEBUG(0)
+	printf("sbp_post_explore (sbp_cold=%d)\n", sbp_cold);
 END_DEBUG
 #if 0
 	xpt_freeze_simq(sbp->sim, /*count*/ 1);
 #endif
+	if (sbp_cold > 0)
+		sbp_cold --;
 	/* Gabage Collection */
 	for(i = 0 ; i < SBP_NUM_TARGETS ; i ++){
 		target = &sbp->targets[i];
@@ -879,11 +882,22 @@
 	printf("sbp_do_attach\n");
 END_DEBUG
 	fw_xfer_free(xfer);
+
 	if (sdev->path == NULL)
 		xpt_create_path(&sdev->path, xpt_periph,
 			cam_sim_path(sdev->target->sbp->sim),
 			sdev->target->target_id, sdev->lun_id);
 
+	/*
+	 * Let CAM scan the bus if we are in the boot process.
+	 * XXX xpt_scan_bus cannot detect LUN larger than 0
+	 * if LUN 0 doesn't exists.
+	 */
+	if (sbp_cold > 0) {
+		sdev->status = SBP_DEV_PROBE;
+		return;
+	}
+
 	if (sdev->status == SBP_DEV_RETRY)
 		sbp_ping_unit(sdev);
 	else
@@ -1615,9 +1629,11 @@
 	int i, s, error;
 
 SBP_DEBUG(0)
-	printf("sbp_attach\n");
+	printf("sbp_attach (cold=%d)\n", cold);
 END_DEBUG
 
+	if (cold)
+		sbp_cold ++;
 	sbp = ((struct sbp_softc *)device_get_softc(dev));
 	bzero(sbp, sizeof(struct sbp_softc));
 	sbp->fd.dev = dev;
@@ -1694,9 +1710,12 @@
 	fw_bindadd(sbp->fd.fc, &sbp->fwb);
 
 	sbp->fd.post_explore = sbp_post_explore;
-	s = splfw();
-	sbp_post_explore((void *)sbp);
-	splx(s);
+
+	if (sbp->fd.fc->status != -1) {
+		s = splfw();
+		sbp_post_explore((void *)sbp);
+		splx(s);
+	}
 
 	return (0);
 }
@@ -2069,7 +2088,7 @@
 		cpi->version_num = 1; /* XXX??? */
 		cpi->hba_inquiry = 0;
 		cpi->target_sprt = 0;
-		cpi->hba_misc = 0;
+		cpi->hba_misc = PIM_NOBUSRESET;
 		cpi->hba_eng_cnt = 0;
 		cpi->max_target = SBP_NUM_TARGETS - 1;
 		cpi->max_lun = SBP_NUM_LUNS - 1;

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?ybsheazny5d.wl>