BIO Usage Error or Conflicting Designs

From: Andre Hedrick (andre@linuxdiskcert.org)
Date: Sat Jan 12 2002 - 14:07:16 EST


Jens,

Below is a single sector read using ACB.
If I do not use the code inside "#ifdef USEBIO" and run UP/SMP but no
highmem, it runs and works like a charm. It is also 100% unchanged code
from what is in 2.4 patches. The attached oops is generate under
SMP without highmem and running the USEBIO code.

CONFIG_NOHIGHMEM=y
# CONFIG_HIGHMEM4G is not set
# CONFIG_HIGHMEM64G is not set

Regards,

Andre Hedrick
Linux Disk Certification Project Linux ATA Development

/*
 * Handler for command with PIO data-in phase
 */
ide_startstop_t task_in_intr (ide_drive_t *drive)
{
  byte stat = GET_STAT();
  byte io_32bit = drive->io_32bit;
  struct request *rq = HWGROUP(drive)->rq;
  char *pBuf = NULL;

  if (!OK_STAT(stat,DATA_READY,BAD_R_STAT)) {
    if (stat & (ERR_STAT|DRQ_STAT)) {
      return ide_error(drive, "task_in_intr", stat);
    }
    if (!(stat & BUSY_STAT)) {
      DTF("task_in_intr to Soon wait for next interrupt\n");
      ide_set_handler(drive, &task_in_intr, WAIT_CMD, NULL);
      return ide_started;
    }
  }
  drive->io_32bit = 0;
  DTF("stat: %02x\n", stat);
#ifdef USEBIO
  if (rq->flags & REQ_CMD) {
    pBuf = ide_map_buffer(rq, &flags);
  } else {
    pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE);
  }
#else
  pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE);
#endif
  DTF("Read: %p, rq->current_nr_sectors: %d\n", pBuf, (int) rq->current_nr_sectors);
  taskfile_input_data(drive, pBuf, SECTOR_WORDS);
#ifdef USEBIO
  if (rq->flags & REQ_CMD)
    ide_unmap_buffer(pBuf, &flags);
  rq->sector++;
  rq->errors = 0;
#endif
  drive->io_32bit = io_32bit;
  if (--rq->current_nr_sectors <= 0) {
    /* (hs): swapped next 2 lines */
    DTF("Request Ended stat: %02x\n", GET_STAT());
    ide_end_request(1, HWGROUP(drive));
  } else {
    ide_set_handler(drive, &task_in_intr, WAIT_CMD, NULL);
    return ide_started;
  }
  return ide_stopped;
}



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jan 15 2002 - 21:00:39 EST