[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: firewire disk stopped working



> > > > 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
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 
_______________________________________________
freebsd-firewire_(_at_)_freebsd_(_dot_)_org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-firewire
To unsubscribe, send any mail to "freebsd-firewire-unsubscribe_(_at_)_freebsd_(_dot_)_org"

Visit your host, monkey.org