Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Feb 2009 17:21:04 -0800
From:      Sean Bruno <sean.bruno@dsl-only.net>
To:        Boris Kotzev <boris.kotzev@gmail.com>
Cc:        freebsd-firewire@freebsd.org
Subject:   Re: firewire disk stopped working
Message-ID:  <1235092864.24031.4.camel@localhost.localdomain>
In-Reply-To: <200902191309.41883.boris.kotzev@gmail.com>
References:  <200902150012.49329.boris.kotzev@gmail.com> <200902190312.24163.boris.kotzev@gmail.com> <1235019152.24031.0.camel@localhost.localdomain> <200902191309.41883.boris.kotzev@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-lJ15iRa4przpN5Ns8WdR
Content-Type: text/plain
Content-Transfer-Encoding: 7bit


> > > > Can you update to -current, and set:
> > > > debug.sbp_debug = 1
> > > > debug.firewire_debug = 1
> > > >
> > > > Then repost your dmesg.
> > > >
> > > > Sean
> > >
> > > Hi,
> > >
> > > The dmesg output after plugging the cable are as follows (full verbose
> > > dmesg can be found at
> > > http://host7.net62.hdsl-213-169.fastbg.net/dmesg.debug.txt ):
> >
> > I went over everything and came up with the following patch.  Let me
> > apply this to -current and let me know if it makes any difference.
> >
> > Sean
> 
> Hi,
> 
> No, unfortunately the patch did not help. The new dmesg output after plugging the cable follows below.
> (After unplugging the cable the system prints this on the screen:
> http://host7.net62.hdsl-213-169.fastbg.net/messages.jpg
> and then freezes completely.)

Ok, this output looks like something else I was pursuing.  Thanks for
testing.

Here's another patch for to test with.  Let me know what the results
are!  

There was a couple of variable not getting initialized causing some
serious grief in the speed negotiation.  Effectively causing the driver
to try and negotiate with itself.  Very icky.

Sean

--=-lJ15iRa4przpN5Ns8WdR
Content-Disposition: attachment; filename="firewire.diff"
Content-Type: text/x-patch; name="firewire.diff"; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Index: firewire.c
===================================================================
--- firewire.c	(revision 188750)
+++ firewire.c	(working copy)
@@ -31,7 +31,7 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  * 
- * $FreeBSD$
+ * $FreeBSD: head/sys/dev/firewire/firewire.c 188726 2009-02-17 19:37:04Z sbruno $
  *
  */
 
@@ -685,7 +685,8 @@
 	src->businfo.cyc_clk_acc = 100;
 	src->businfo.max_rec = fc->maxrec;
 	src->businfo.max_rom = MAXROM_4;
-	src->businfo.generation = 0;
+#define FW_GENERATION_CHANGEABLE 2
+	src->businfo.generation = FW_GENERATION_CHANGEABLE;
 	src->businfo.link_spd = fc->speed;
 
 	src->businfo.eui64.hi = fc->eui.hi;
@@ -763,14 +764,21 @@
 	 * If the old config rom needs to be overwritten,
 	 * bump the businfo.generation indicator to 
 	 * indicate that we need to be reprobed
+	 * See 1394a-2000 8.3.2.5.4 for more details.
+	 * generation starts at 2 and rolls over at 0xF
+	 * back to 2.
+	 * A generation of 0 indicates a device
+	 * that is not 1394a-2000 compliant.
+	 * A generation of 1 indicates a device that
+	 * does not change it's Bus Info Block or 
+	 * Configuration ROM.
 	 */
+#define FW_MAX_GENERATION 0xF
 	if (bcmp(src, fc->config_rom, CROMSIZE) != 0) {
-		/* generation is a 2 bit field */
-		/* valid values are only from 0 - 3 */
-		src->businfo.generation = 1;
+		if ( src->businfo.generation++ > FW_MAX_GENERATION )
+			src->businfo.generation = FW_GENERATION_CHANGEABLE;
 		bcopy(src, (void *)fc->config_rom, CROMSIZE);
-	} else
-		src->businfo.generation = 0;
+	}
 }
 
 /* Call once after reboot */
@@ -1590,6 +1598,10 @@
 		}
 		fwdev->fc = fc;
 		fwdev->eui = binfo->eui64;
+		fwdev->dst = dfwdev->dst;
+		fwdev->maxrec = dfwdev->maxrec;
+		fwdev->status = dfwdev->status;
+
 		/*
 		 * Pre-1394a-2000 didn't have link_spd in
 		 * the Bus Info block, so try and use the 

--=-lJ15iRa4przpN5Ns8WdR--




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