WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TCL7.2 tc-config waitusb sleeps before readiness check  (Read 6208 times)

Offline 6xis

  • Newbie
  • *
  • Posts: 3
TCL7.2 tc-config waitusb sleeps before readiness check
« 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

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #1 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
Download a copy and keep it handy: Core book ;)

Offline 6xis

  • Newbie
  • *
  • Posts: 3
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #2 on: July 11, 2016, 12:56:06 PM »
Looks good to me.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #3 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.
The only barriers that can stop you are the ones you create yourself.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #4 on: July 13, 2016, 01:21:49 PM »
Applied, thanks to both.
The only barriers that can stop you are the ones you create yourself.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Download a copy and keep it handy: Core book ;)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #6 on: July 19, 2016, 07:34:00 AM »
But that's dCore rather than Core*...

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #7 on: July 19, 2016, 08:21:49 AM »
True.
Re-tested  waitusb=  with UUID, LABEL and without specifying a device.
Working as expected here.
Download a copy and keep it handy: Core book ;)