Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: 6xis on July 11, 2016, 10:43:18 AM

Title: TCL7.2 tc-config waitusb sleeps before readiness check
Post by: 6xis on July 11, 2016, 10:43:18 AM
In stock TCL 7.2, tc-config's waitusb code performs a 0.25 second sleep before performing the initial device readiness check.  For each waitusb'd device which is already in a ready state, we unnecessarily wait 0.25 seconds.

This patch refactors the waitusb code to perform the readiness check before sleeping:
http://patches.tinycorelinux.net/uploaded/tc_config.patch__waitusb_check_before_sleep

I've posted a side-by-side video showing the timing difference in head-to-head video and with a simple test case at:
https://www.youtube.com/watch?v=kgjXxyIPKq8

Thank you,

jacob at 6x.is
Title: Re: TCL7.2 tc-config waitusb sleeps before readiness check
Post by: Misalf on July 11, 2016, 11:41:36 AM
What about this?
Code: [Select]
sleep 0.25
blkid -lt $dev >/dev/null && timeout=0
Code: [Select]
blkid -lt $dev >/dev/null && timeout=0 || sleep 0.25
Title: Re: TCL7.2 tc-config waitusb sleeps before readiness check
Post by: 6xis on July 11, 2016, 12:56:06 PM
Looks good to me.
Title: Re: TCL7.2 tc-config waitusb sleeps before readiness check
Post by: curaga on July 12, 2016, 03:02:41 PM
That's the first video patch I've seen. Even though I read very fast, some of the text frames were too quick for me, you may want to increase the time in the future.

I'll apply Misalf's version soon, maybe tomorrow.
Title: Re: TCL7.2 tc-config waitusb sleeps before readiness check
Post by: curaga on July 13, 2016, 01:21:49 PM
Applied, thanks to both.
Title: Re: TCL7.2 tc-config waitusb sleeps before readiness check
Post by: Misalf on July 19, 2016, 07:26:57 AM
Seems to break things.
http://forum.tinycorelinux.net/index.php/topic,17871.msg125457.html#msg125457
Title: Re: TCL7.2 tc-config waitusb sleeps before readiness check
Post by: Juanito on July 19, 2016, 07:34:00 AM
But that's dCore rather than Core*...
Title: Re: TCL7.2 tc-config waitusb sleeps before readiness check
Post by: Misalf on July 19, 2016, 08:21:49 AM
True.
Re-tested  waitusb=  with UUID, LABEL and without specifying a device.
Working as expected here.