Change in osmo-ccid-firmware[master]: Avoid endless loop while printing debug uart ringbuffer

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Nov 13 16:27:19 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16055 )

Change subject: Avoid endless loop while printing debug uart ringbuffer
......................................................................

Avoid endless loop while printing debug uart ringbuffer

Change-Id: I84bf6f47c785cfecec4764f7e86958103cf24f8a
---
M sysmoOCTSIM/hal/src/hal_usart_async_rings.c
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Hoernchen: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/sysmoOCTSIM/hal/src/hal_usart_async_rings.c b/sysmoOCTSIM/hal/src/hal_usart_async_rings.c
index 38bdca4..704c6ab 100644
--- a/sysmoOCTSIM/hal/src/hal_usart_async_rings.c
+++ b/sysmoOCTSIM/hal/src/hal_usart_async_rings.c
@@ -321,7 +321,11 @@
 	ASSERT(descr && buf && length);
 
 	for (uint16_t i = 0; i < length; i++) {
-		while (ringbuffer_num(&descr->tx) > descr->tx.size); // WARNING blocking until there is space in the buffer
+		/* HACK: disabling this to avoid getting stuck indefinitely.  In theory, this while loop below
+		 * would exit at some point as the UART is supposedly transmitting data.  However, in some
+		 * situations it is not transmitting, and hence the condition becomes never true, waiting here
+		 * indefinitely.  We will now simply ovewrite old log data if it isn't sent fast enough */
+		//while (ringbuffer_num(&descr->tx) > descr->tx.size); // WARNING blocking until there is space in the buffer
 		ringbuffer_put(&descr->tx, buf[i]);
 	}
 	descr->stat             = USART_ASYNC_RINGS_STATUS_BUSY;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16055
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: I84bf6f47c785cfecec4764f7e86958103cf24f8a
Gerrit-Change-Number: 16055
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191113/947f1eb6/attachment.htm>


More information about the gerrit-log mailing list