Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Sep 2022 22:10:20 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        bob prohaska <fbsd@www.zefox.net>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>, freebsd-uboot@freebsd.org
Subject:   Re: u-boot debug, was: Re: U-boot on RPI3, sees disk but won't boot it
Message-ID:  <E3A1C678-8C47-4283-9F9F-4C9011DB8A2B@yahoo.com>
In-Reply-To: <6AA65AE6-41F1-405F-A592-7D641EA4C9CF@yahoo.com>
References:  <9F57D5D0-F715-4DD2-A05C-FB2B9E8B5C30@yahoo.com> <20220928015721.GA73356@www.zefox.net> <C657BE65-ADCC-479B-B756-445D0825E0FA@yahoo.com> <E0BDFF06-3998-48E0-B04D-3B4A11F4A9AE@yahoo.com> <20220928045145.GB73356@www.zefox.net> <81F58716-72CE-45E8-951A-B7B92AD0FE95@yahoo.com> <20220928172839.GA75564@www.zefox.net> <62A7FD9D-DFAD-46B2-8681-F6EF0E5AC0DE@yahoo.com> <8CB25EDF-704A-4F86-B0D4-40818291C161@yahoo.com> <20220928234341.GA77046@www.zefox.net> <20220929002131.GA77106@www.zefox.net> <197D3C46-063B-4C67-AB1A-A3A072521D7F@yahoo.com> <A8C2BA4E-4520-4B34-9614-DDC4D8BEB097@yahoo.com> <6AA65AE6-41F1-405F-A592-7D641EA4C9CF@yahoo.com>

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

--Apple-Mail=_1272EC13-0536-4365-9E7F-BBFDB2DE6D00
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

On 2022-Sep-28, at 20:31, Mark Millard <marklmi@yahoo.com> wrote:

>> . . .
> 
> It looks like that if you remove files/patch-common_usb__storage.c
> and rebuild/install the large output reporting usb reads will not
> happen.
> 

I've included a patch-common_usb__storage.c that comments out
the few high volume debug(...) instances but leaves the rest
in place. A dozen or so lines are still output via this source
file now and I was not sure if any might prove important. So
this way they are present to consider if this file is used
in the build.

===
Mark Millard
marklmi at yahoo.com

--Apple-Mail=_1272EC13-0536-4365-9E7F-BBFDB2DE6D00
Content-Disposition: attachment;
	filename=patch-common_usb__storage.c
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="patch-common_usb__storage.c"
Content-Transfer-Encoding: 7bit

--- common/usb_storage.c.orig	2022-04-04 07:31:32.000000000 -0700
+++ common/usb_storage.c	2022-09-28 21:46:42.289455000 -0700
@@ -20,6 +20,8 @@
  * FreeBSD.
  */
 
+#define LOG_DEBUG
+#define DEBUG
 /* Note:
  * Currently only the CBI transport protocoll has been implemented, and it
  * is only tested with a TEAC USB Floppy. Other Massstorages with CBI or CB
@@ -719,7 +721,7 @@
 	dir_in = US_DIRECTION(srb->cmd[0]);
 
 	/* COMMAND phase */
-	debug("COMMAND phase\n");
+	//MMJNK: debug("COMMAND phase\n");
 	result = usb_stor_BBB_comdat(srb, us);
 	if (result < 0) {
 		debug("failed to send CBW status %ld\n",
@@ -736,7 +738,7 @@
 	/* no data, go immediately to the STATUS phase */
 	if (srb->datalen == 0)
 		goto st;
-	debug("DATA phase\n");
+	//MMJNK: debug("DATA phase\n");
 	if (dir_in)
 		pipe = pipein;
 	else
@@ -769,7 +771,7 @@
 st:
 	retry = 0;
 again:
-	debug("STATUS phase\n");
+	//MMJNK: debug("STATUS phase\n");
 	result = usb_bulk_msg(us->pusb_dev, pipein, csw, UMASS_BBB_CSW_SIZE,
 				&actlen, USB_CNTL_TIMEOUT*5);
 
@@ -1079,7 +1081,7 @@
 	srb->cmd[7] = ((unsigned char) (blocks >> 8)) & 0xff;
 	srb->cmd[8] = (unsigned char) blocks & 0xff;
 	srb->cmdlen = 12;
-	debug("read10: start %lx blocks %x\n", start, blocks);
+	//MMJNK: debug("read10: start %lx blocks %x\n", start, blocks);
 	return ss->transport(srb, ss);
 }
 
@@ -1149,9 +1151,9 @@
 #if CONFIG_IS_ENABLED(BLK)
 	block_dev = dev_get_uclass_plat(dev);
 	udev = dev_get_parent_priv(dev_get_parent(dev));
-	debug("\nusb_read: udev %d\n", block_dev->devnum);
+	//MMJNK: debug("\nusb_read: udev %d\n", block_dev->devnum);
 #else
-	debug("\nusb_read: udev %d\n", block_dev->devnum);
+	//MMJNK: debug("\nusb_read: udev %d\n", block_dev->devnum);
 	udev = usb_dev_desc[block_dev->devnum].priv;
 	if (!udev) {
 		debug("%s: No device\n", __func__);
@@ -1167,8 +1169,8 @@
 	start = blknr;
 	blks = blkcnt;
 
-	debug("\nusb_read: dev %d startblk " LBAF ", blccnt " LBAF " buffer %lx\n",
-	      block_dev->devnum, start, blks, buf_addr);
+	//MMJNK: debug("\nusb_read: dev %d startblk " LBAF ", blccnt " LBAF " buffer %lx\n",
+	      //MMJNK: block_dev->devnum, start, blks, buf_addr);
 
 	do {
 		/* XXX need some comment here */
@@ -1197,13 +1199,13 @@
 		buf_addr += srb->datalen;
 	} while (blks != 0);
 
-	debug("usb_read: end startblk " LBAF ", blccnt %x buffer %lx\n",
-	      start, smallblks, buf_addr);
+	//MMJNK: debug("usb_read: end startblk " LBAF ", blccnt %x buffer %lx\n",
+	      //MMJNK: start, smallblks, buf_addr);
 
 	usb_lock_async(udev, 0);
 	usb_disable_asynch(0); /* asynch transfer allowed */
 	if (blkcnt >= ss->max_xfer_blk)
-		debug("\n");
+		; //MMJNK: debug("\n");
 	return blkcnt;
 }
 

--Apple-Mail=_1272EC13-0536-4365-9E7F-BBFDB2DE6D00--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E3A1C678-8C47-4283-9F9F-4C9011DB8A2B>