From owner-freebsd-firewire Tue Feb 25 22:13:39 2003 Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 27E4737B401 for ; Tue, 25 Feb 2003 22:13:36 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7045143F85 for ; Tue, 25 Feb 2003 22:13:34 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.6/8.12.6) with ESMTP id h1Q6DX1o051851; Tue, 25 Feb 2003 22:13:33 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.7/8.12.7) with ESMTP id h1Q6DXWs000614; Tue, 25 Feb 2003 22:13:33 -0800 (PST) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.7/8.12.7/Submit) id h1Q6DQ6o000613; Tue, 25 Feb 2003 22:13:26 -0800 (PST) Date: Tue, 25 Feb 2003 22:13:21 -0800 From: Marcel Moolenaar To: Hidetoshi Shimokawa Cc: firewire@FreeBSD.ORG Subject: Re: Bad news: bus resets not fixed yet Message-ID: <20030226061321.GA549@dhcp01.pn.xcllnt.net> References: <20030222002547.GA1247@dhcp01.pn.xcllnt.net> <20030222194741.GA579@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.3i Sender: owner-freebsd-firewire@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Feb 25, 2003 at 01:04:56AM +0900, Hidetoshi Shimokawa wrote: > 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) Ok, I found some time to test some more: o An unmodified kernel from sources as of today (tue, feb 25) exhibits the bus reset loop. o Enabling debug in sbp.c fixes the bus reset loop (no other changes). o The patch given below applied to unmodified sources has the exact same behaviour as the unmodified source: bus reset loop (this is non-verbose). o Booting verbose enables debug and consequently fixes the bus reset loop. Non-verbose boot info can be found here: http://www.xcllnt.net/~marcel/vaio.txt Verbose boot info can be found here: http://www.xcllnt.net/~marcel/vaio-verbose.txt > 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 -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-firewire" in the body of the message