printk("%s: reset, enter, target %d.%d:%d, pid %ld.\n", BN(j), SCarg->device->channel, SCarg->device->id, SCarg->device->lun, SCarg->pid); 
scmd_printk(KERN_INFO, SCarg, "reset, enter, pid %ld.\n", SCarg->pid); 
static int u14_34f_eh_host_reset(struct scsi_cmnd *SCarg) {   unsigned int i, j, time, k, c, limit = 0;   int arg_done = FALSE;   struct scsi_cmnd *SCpnt;   j = ((struct hostdata *) SCarg->device->host->hostdata)->board_number;   printk("%s: reset, enter, target %d.%d:%d, pid %ld.\n",          BN(j), SCarg->device->channel, SCarg->device->id, SCarg->device->lun, SCarg->pid);   spin_lock_irq(sh[j]->host_lock);   if (SCarg->host_scribble == NULL)      printk("%s: reset, pid %ld inactive.\n", BN(j), SCarg->pid);   if (HD(j)->in_reset) {      printk("%s: reset, exit, already in reset.\n", BN(j));      spin_unlock_irq(sh[j]->host_lock);      return FAILED;      }   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {      printk("%s: reset, exit, timeout error.\n", BN(j));      spin_unlock_irq(sh[j]->host_lock);      return FAILED;      }   HD(j)->retries = 0;   for (c = 0; c <= sh[j]->max_channel; c++)      for (k = 0; k < sh[j]->max_id; k++) {         HD(j)->target_redo[k][c] = TRUE;         HD(j)->target_to[k][c] = 0;         }   for (i = 0; i < sh[j]->can_queue; i++) {      if (HD(j)->cp_stat[i] == FREE) continue;      if (HD(j)->cp_stat[i] == LOCKED) {         HD(j)->cp_stat[i] = FREE;         printk("%s: reset, locked mbox %d forced free.\n", BN(j), i);         continue;         }      if (!(SCpnt = HD(j)->cp[i].SCpnt))         panic("%s: reset, mbox %d, SCpnt == NULL.\n", BN(j), i);      if (HD(j)->cp_stat[i] == READY || HD(j)->cp_stat[i] == ABORTING) {         HD(j)->cp_stat[i] = ABORTING;         printk("%s: reset, mbox %d aborting, pid %ld.\n",                BN(j), i, SCpnt->pid);         }      else {         HD(j)->cp_stat[i] = IN_RESET;         printk("%s: reset, mbox %d in reset, pid %ld.\n",                BN(j), i, SCpnt->pid);         }      if (SCpnt->host_scribble == NULL)         panic("%s: reset, mbox %d, garbled SCpnt.\n", BN(j), i);      if (*(unsigned int *)SCpnt->host_scribble != i)         panic("%s: reset, mbox %d, index mismatch.\n", BN(j), i);      if (SCpnt->scsi_done == NULL)         panic("%s: reset, mbox %d, SCpnt->scsi_done == NULL.\n", BN(j), i);      if (SCpnt == SCarg) arg_done = TRUE;      }   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {      printk("%s: reset, cannot reset, timeout error.\n", BN(j));      spin_unlock_irq(sh[j]->host_lock);      return FAILED;      }   outb(CMD_RESET, sh[j]->io_port + REG_LCL_INTR);   printk("%s: reset, board reset done, enabling interrupts.\n", BN(j));#if defined(DEBUG_RESET)   do_trace = TRUE;#endif   HD(j)->in_reset = TRUE;   spin_unlock_irq(sh[j]->host_lock);   time = jiffies;   while ((jiffies - time) < (10 * HZ) && limit++ < 200000) udelay(100L);   spin_lock_irq(sh[j]->host_lock);   printk("%s: reset, interrupts disabled, loops %d.\n", BN(j), limit);   for (i = 0; i < sh[j]->can_queue; i++) {      if (HD(j)->cp_stat[i] == IN_RESET) {         SCpnt = HD(j)->cp[i].SCpnt;         unmap_dma(i, j);         SCpnt->result = DID_RESET << 16;         SCpnt->host_scribble = NULL;         /* This mailbox is still waiting for its interrupt */         HD(j)->cp_stat[i] = LOCKED;         printk("%s, reset, mbox %d locked, DID_RESET, pid %ld done.\n",                BN(j), i, SCpnt->pid);         }      else if (HD(j)->cp_stat[i] == ABORTING) {         SCpnt = HD(j)->cp[i].SCpnt;         unmap_dma(i, j);         SCpnt->result = DID_RESET << 16;         SCpnt->host_scribble = NULL;         /* This mailbox was never queued to the adapter */         HD(j)->cp_stat[i] = FREE;         printk("%s, reset, mbox %d aborting, DID_RESET, pid %ld done.\n",                BN(j), i, SCpnt->pid);         }      else         /* Any other mailbox has already been set free by interrupt */         continue;      SCpnt->scsi_done(SCpnt);      }   HD(j)->in_reset = FALSE;   do_trace = FALSE;   if (arg_done) printk("%s: reset, exit, pid %ld done.\n", BN(j), SCarg->pid);   else          printk("%s: reset, exit.\n", BN(j));   spin_unlock_irq(sh[j]->host_lock);   return SUCCESS;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/017560fca496f72ed9dd734ffde63ce39dfe0411/u14-34f.c/buggy/drivers/scsi/u14-34f.c