home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10743 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  3.6 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!ra!tantalus!eric
  2. From: eric@tantalus.dell.com (Eric Youngdale)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: .97pl5 won't boot (it's a SCSI problem)
  5. Message-ID: <3612@ra.nrl.navy.mil>
  6. Date: 15 Sep 92 15:53:50 GMT
  7. References: <1992Sep14.134849.2716@odin.diku.dk> <1992Sep15.134447.12185@odin.diku.dk>
  8. Sender: usenet@ra.nrl.navy.mil
  9. Organization: Naval Research Laboratory
  10. Lines: 83
  11.  
  12. In article <1992Sep15.134447.12185@odin.diku.dk> dingbat@diku.dk (Niels Skov Olsen) writes:
  13. >I wrote:
  14. >
  15. >>My .97pl5 won't boot. My configuration:
  16. >
  17. >>    i386dx/33mhz
  18. >>    8mb ram
  19. >>    adaptec 1542b with 3 disks on the scsi bus
  20. >[ ... ]
  21. >
  22. >Now I have found out that the problem is in sd_init. The system
  23. >is trying to do READ_CAPACITY on sd2, and is waiting for the_result
  24. >to become non-negative:
  25. >
  26. >excerpt from kernel/blkdrv/scsi/sd.c:
  27. >
  28. >        do {
  29. >         the_result = -1;
  30. >#ifdef DEBUG
  31. >    printk("sd%d : READ CAPACITY\n ", i); 
  32. >#endif
  33. >        scsi_do_cmd (rscsi_disks[i].device->host_no , 
  34. >                rscsi_disks[i].device->id, 
  35. >                (void *) cmd, (void *) buffer,
  36. >                 512, sd_init_done,  SD_TIMEOUT, sense_buffer,
  37. >                 MAX_RETRIES);
  38. >
  39. >        while(the_result < 0);
  40. >        ^^^^^^^^^^^^^^^^^^^^^^ it never comes out of this loop...
  41. >
  42. >        } while (try_again  && the_result);
  43. >
  44. >I don't understand the details of this, because this code has not
  45. >changed since .97pl4 where it works!
  46. >
  47. >What's going on?
  48.  
  49.     Basically what is happening is that the code is waiting for an
  50. interrupt to change the value of try_again.  One of the parameters to
  51. scsi_do_cmd is the address of the routine sd_init_done, and guess what
  52. sd_init_done does???.
  53.  
  54.     The interrupts are handled by several routines.  Each different
  55. host adapter has a low-level routine that does any host-specific things,
  56. and this in turn calls the mid-level routine, which is scsi_done in scsi.c.
  57. This routine has the job of interpreting the status codes that come back from
  58. the device, and deciding what to do.  Possibilities are:
  59.  
  60.      * I/O completed normally.
  61.      * Some type of fatal error condition.
  62.      * Some type of error for which we can simply retry the I/O request.
  63.      * Some type of error for which we do not know enough.  In this
  64.        case, the routine issues the REQUEST_SENSE command, to ask
  65.        for further information, and when the REQUEST_SENSE command
  66.        completes, it calls scsi_done a second time, and then decides what
  67.        to do based upon the data returned from the REQUEST_SENSE command.
  68.  
  69.     For each request, there should always come a point where it is
  70. considered "complete", and at this time the top-level completion function is
  71. called.   In this case the routine sd_init_done is that function.
  72.  
  73.     Basically there were a number of bugs in the scsi code in pre-0.97pl5,
  74. which resulted in the following:
  75.  
  76.     * The adaptec was being improperly asked for the sense information.
  77.     * The wrong buffer was examined to interpret the sense information.
  78.     * The top-level completion function was being called before the
  79.       request was actually complete, and thus it was inadvertently called
  80.       twice.  This could lead to the queueing of another command to
  81.       the scsi device before the first one is really complete.
  82.  
  83.     I thought that I had fixed all of these in 0.97pl5, but there is
  84. apparently a case where the mid-level driver is not calling the top-level
  85. function.  Offhand I do not know why this is the case, but I would suggest that
  86. anyone who sees this try compiling scsi.c with DEBUG defined, and looking
  87. at the resulting output to see why this I/O is not calling the top-level
  88. function.  If I get a good report from someone, I should be able to come up
  89. with a patch on fairly short order.
  90.  
  91. -Eric
  92. --
  93. Eric Youngdale
  94. eric@tantalus.nrl.navy.mil
  95.