home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / bsd / 10299 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  2.2 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!ogicse!mimbres.cs.unm.edu!unmvax!uservx.plk.af.mil!hrd769.brooks.af.mil!hrd769.brooks.af.mil!not-for-mail
  2. From: news@hrd769.brooks.af.mil (InterNet News)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: 386BSD wd.c timeout problem during autoconfig
  5. Message-ID: <1gnpa7INN2u1@hrd769.brooks.af.mil>
  6. Date: 16 Dec 92 05:33:59 GMT
  7. Article-I.D.: hrd769.1gnpa7INN2u1
  8. References: <1992Dec16.002542.6959@moxie.hou.tx.us>
  9. Sender: burgess@hrd769.brooks.af.mil (Dave Burgess)
  10. Organization: Armstrong Lab MIS, Brooks AFB TX
  11. Lines: 44
  12. NNTP-Posting-Host: hrd769.brooks.af.mil
  13.  
  14. In article <1992Dec16.002542.6959@moxie.hou.tx.us> hackney@moxie.hou.tx.us (Greg Hackney) writes:
  15. }
  16. }We found a timeout problem in the wd.c code that occurs when the
  17. }system trys to autoconfigure the disk drives at boot time.
  18. }
  19. }In wdcommand() there is a declaration:  int timeout = 1000000;
  20. }
  21. }This is a loop counter that runs while the disk controller
  22. }registers are being probed. For a Conner 510MB IDE drive on a Compaq
  23. }SystemPro 486/33, that value is not large enough for the controller
  24. }to respond in time. (It's only short by a count of about 3,000 on
  25. }this system).
  26. }
  27. }As a result, booting the dist.fs floppy indicates you have no hard
  28. }disk drives.
  29. }
  30. }The fix was to increase the value of timeout. We used 1,500,000.
  31. }--
  32. }Greg Hackney   hackney@compaq.com
  33. }Mike Busby     mcb@compaq.com
  34. }
  35. }
  36.   I apologize for not looking at the code closely before I jump into this,
  37. but shouldn't we be using a time value instead of a processor speed
  38. dependent for loop?  Something like usleep(3) comes to mind, but I could be
  39. mistaken.
  40.  
  41.   As an example:
  42.  
  43.   while(((stat = inb(wdc + wd_status)) & WDCS_BUSY) && timeout-- > 0)
  44.     usleep(n);
  45.  
  46.   Where n is some reasonable number of milliseconds to pause and
  47.     timeout is the number of pauses before there is an actual error.
  48.  
  49.   If we sleep for 1 millisecond, and the timeout value is 1 second,
  50. then timeout would be 1000.  This way, the code doesn't break on fast
  51. '486 machines (assuming that usleep works).
  52.  
  53.   What kind of problems would this cause?
  54.  
  55. TSgt Dave Burgess
  56. NCOIC AL/MIS
  57. Brooks AFB, TX
  58.