home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 8590 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  3.0 KB

  1. Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!bloom-picayune.mit.edu!root
  2. From: jwiegand@moe.eng.temple.edu
  3. Newsgroups: comp.os.linux
  4. Subject: (none)
  5. Message-ID: <1992Aug19.054057.8491@athena.mit.edu>
  6. Date: 19 Aug 92 05:40:57 GMT
  7. Sender: root@athena.mit.edu (System PRIVILEGED Account)
  8. Reply-To: jwiegand@moe.eng.temple.edu
  9. Organization: The Internet
  10. Lines: 105
  11.  
  12. RE: HD: read_intr: status = 0x51
  13.  
  14. There seems to be a problem with certain hd's that have a braindead
  15. IDE bios. They return READY_STAT but do not clear the lower bits.
  16. This results in silly messages like:
  17. HD: read_intr: status = 0x51
  18. This happened with my Brand Technologies 200 MB hard drive
  19. and is fixed by ignoring the confused condition.
  20. I have used this patch on MSDOS and EXTFS partitions on the BT drive
  21. and have had no trouble backing up Linux (~150 MB of tar files)
  22. and transferring other big numbers of files. I was waiting for someone
  23. else to mention this before perpetrating the following on an 
  24. unsuspecting world:
  25.  
  26. *** hd.c.old    Wed Aug 19 00:50:49 1992
  27. --- hd.c    Wed Aug 19 00:29:33 1992
  28. ***************
  29. *** 248,256 ****
  30.   {
  31.       int i;
  32.   
  33.       i = (unsigned) inb_p(HD_STATUS);
  34. !     if ((i & STAT_MASK) != STAT_OK) {
  35.           printk("HD: read_intr: status = 0x%02x\n",i);
  36.           goto bad_read;
  37.       }
  38.       if (wait_DRQ()) {
  39. --- 248,256 ----
  40.   {
  41.       int i;
  42.   
  43.       i = (unsigned) inb_p(HD_STATUS);
  44. !     if (((i & STAT_MASK) != STAT_OK) && !(i & READY_STAT)) {
  45.           printk("HD: read_intr: status = 0x%02x\n",i);
  46.           goto bad_read;
  47.       }
  48.       if (wait_DRQ()) {
  49. ***************
  50. *** 259,267 ****
  51.       }
  52.       port_read(HD_DATA,CURRENT->buffer,256);
  53.       i = (unsigned) inb_p(HD_STATUS);
  54.       if (!(i & BUSY_STAT))
  55. !         if ((i & STAT_MASK) != STAT_OK) {
  56.               printk("HD: read_intr: second status = 0x%02x\n",i);
  57.               goto bad_read;
  58.           }
  59.       CURRENT->errors = 0;
  60. --- 259,267 ----
  61.       }
  62.       port_read(HD_DATA,CURRENT->buffer,256);
  63.       i = (unsigned) inb_p(HD_STATUS);
  64.       if (!(i & BUSY_STAT))
  65. !     if (((i & STAT_MASK) != STAT_OK) && !(i & READY_STAT)) {
  66.               printk("HD: read_intr: second status = 0x%02x\n",i);
  67.               goto bad_read;
  68.           }
  69.       CURRENT->errors = 0;
  70. ***************
  71. *** 286,294 ****
  72.   #endif
  73.       do_hd_request();
  74.       return;
  75.   bad_read:
  76. !     if (i & ERR_STAT) {
  77.           i = (unsigned) inb(HD_ERROR);
  78.           printk("HD: read_intr: error = 0x%02x\n",i);
  79.       }
  80.       bad_rw_intr();
  81. --- 286,294 ----
  82.   #endif
  83.       do_hd_request();
  84.       return;
  85.   bad_read:
  86. !     if (i & ERR_STAT)  {
  87.           i = (unsigned) inb(HD_ERROR);
  88.           printk("HD: read_intr: error = 0x%02x\n",i);
  89.       }
  90.       bad_rw_intr();
  91. ***************
  92. *** 300,308 ****
  93.   {
  94.       int i;
  95.   
  96.       i = (unsigned) inb_p(HD_STATUS);
  97. !     if ((i & STAT_MASK) != STAT_OK) {
  98.           printk("HD: write_intr: status = 0x%02x\n",i);
  99.           goto bad_write;
  100.       }
  101.       if (CURRENT->nr_sectors > 1 && wait_DRQ()) {
  102. --- 300,308 ----
  103.   {
  104.       int i;
  105.   
  106.       i = (unsigned) inb_p(HD_STATUS);
  107. !     if (((i & STAT_MASK) != STAT_OK) && !(i & READY_STAT)) {
  108.           printk("HD: write_intr: status = 0x%02x\n",i);
  109.           goto bad_write;
  110.       }
  111.       if (CURRENT->nr_sectors > 1 && wait_DRQ()) {
  112.  
  113. Of course Linus can clean this up by fiddling with the macros,
  114. but there it is!
  115.  
  116. jim
  117.