WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline 6xis

  • WikiUser
  • *
  • Posts: 3
TCL7.2 tc-config waitusb sleeps before readiness check
« on: July 11, 2016, 06: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:
newbielink:http://patches.tinycorelinux.net/uploaded/tc_config.patch__waitusb_check_before_sleep [nonactive]

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

Thank you,

jacob at 6x.is

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1594
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #1 on: July 11, 2016, 07: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

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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9624
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #3 on: July 12, 2016, 11:02:41 AM »
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: 9624
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #4 on: July 13, 2016, 09:21:49 AM »
Applied, thanks to both.
The only barriers that can stop you are the ones you create yourself.

Offline Misalf

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

Offline Juanito

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

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1594
Re: TCL7.2 tc-config waitusb sleeps before readiness check
« Reply #7 on: July 19, 2016, 04: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 ;)