Commit 5c8dc888 authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] fixup some tagged queuing mess

This is a followup to Doug's comments and older work.  It kills
sdev->tagged_queue which wasn't ever set in 2.5/2.6 except through
obscure and broken ioctls (!).  As a reason of that tagged queing
didn't work for a lot of drivers, so this does change behaviour.
Be careful..

James, can you review the code in 53c700.c?  Calling scsi_activate_tcq
in ->queuecommand rather than ->slave_configure looks rather strange to
me..
parent 20d32d9d
......@@ -3330,9 +3330,8 @@ mptscsih_slave_configure(Scsi_Device *device)
device, device->id, device->lun, device->channel));
dsprintk((KERN_INFO "sdtr %d wdtr %d ppr %d inq length=%d\n",
device->sdtr, device->wdtr, device->ppr, device->inquiry_len));
dsprintk(("tagged %d queue %d simple %d ordered %d\n",
device->tagged_supported, device->tagged_queue,
device->simple_tags, device->ordered_tags));
dsprintk(("tagged %d simple %d ordered %d\n",
device->tagged_supported, device->simple_tags, device->ordered_tags));
/* set target parameters, queue depths, set dv flags ? */
if (hd && (hd->Targets != NULL)) {
......
......@@ -1758,7 +1758,7 @@ NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
printk("53c700: scsi%d, command ", SCp->device->host->host_no);
print_command(SCp->cmnd);
#endif
if(SCp->device->tagged_supported && !SCp->device->tagged_queue
if(SCp->device->tagged_supported && !SCp->device->simple_tags &&
&& (hostdata->tag_negotiated &(1<<SCp->device->id)) == 0
&& NCR_700_is_flag_clear(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING)) {
/* upper layer has indicated tags are supported. We don't
......
......@@ -1231,8 +1231,8 @@ static void AM53C974_intr(int irq, void *dev_id, struct pt_regs *regs)
hostdata->sel_cmd = NULL;
hostdata->selecting = 0;
#ifdef SCSI2
if (!hostdata->connected->device->tagged_queue)
#endif
if (!hostdata->conneted->device->simple_tags)
#else
hostdata->busy[hostdata->connected->device->id] |= (1 << hostdata->connected->device->lun);
/* very strange -- use_sg is sometimes nonzero for request sense commands !! */
if ((hostdata->connected->cmnd[0] == REQUEST_SENSE) && hostdata->connected->use_sg) {
......@@ -1811,7 +1811,7 @@ static int AM53C974_message(struct Scsi_Host *instance, Scsi_Cmnd * cmd,
case HEAD_OF_QUEUE_TAG:
case ORDERED_QUEUE_TAG:
case SIMPLE_QUEUE_TAG:
cmd->device->tagged_queue = 0;
cmd->device->simple_tags = 0;
hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
break;
default:
......@@ -1958,7 +1958,7 @@ static void AM53C974_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag
#endif
#ifdef SCSI2
if (cmd->device->tagged_queue && (tag != TAG_NONE)) {
if (cmd->device->simple_tags && (tag != TAG_NONE)) {
tmp[1] = SIMPLE_QUEUE_TAG;
if (tag == TAG_NEXT) {
/* 0 is TAG_NONE, used to imply no tag for this command */
......
......@@ -2512,7 +2512,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
case HEAD_OF_QUEUE_TAG:
case ORDERED_QUEUE_TAG:
case SIMPLE_QUEUE_TAG:
cmd->device->tagged_queue = 0;
cmd->device->simple_tags = 0;
hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
break;
default:
......
......@@ -768,7 +768,7 @@ intr_ret_t acornscsi_kick(AS_Host *host)
/*
* tagged queueing - allocate a new tag to this command
*/
if (SCpnt->device->tagged_queue) {
if (SCpnt->device->simple_tags) {
SCpnt->device->current_tag += 1;
if (SCpnt->device->current_tag == 0)
SCpnt->device->current_tag = 1;
......@@ -1590,7 +1590,7 @@ void acornscsi_message(AS_Host *host)
*/
printk(KERN_NOTICE "scsi%d.%c: disabling tagged queueing\n",
host->host->host_no, acornscsi_target(host));
host->SCpnt->device->tagged_queue = 0;
host->SCpnt->device->simple_tags = 0;
set_bit(host->SCpnt->device->id * 8 + host->SCpnt->device->lun, host->busyluns);
break;
#endif
......@@ -2935,7 +2935,7 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start,
p += sprintf(p, " %d/%d ", scd->id, scd->lun);
if (scd->tagged_supported)
p += sprintf(p, "%3sabled(%3d) ",
scd->tagged_queue ? "en" : "dis",
scd->simple_tags ? "en" : "dis",
scd->current_tag);
else
p += sprintf(p, "unsupported ");
......
......@@ -1819,7 +1819,7 @@ static void fas216_allocate_tag(FAS216_Info *info, Scsi_Cmnd *SCpnt)
/*
* tagged queuing - allocate a new tag to this command
*/
if (SCpnt->device->tagged_queue && SCpnt->cmnd[0] != REQUEST_SENSE &&
if (SCpnt->device->simple_tags && SCpnt->cmnd[0] != REQUEST_SENSE &&
SCpnt->cmnd[0] != INQUIRY) {
SCpnt->device->current_tag += 1;
if (SCpnt->device->current_tag == 0)
......@@ -3012,7 +3012,7 @@ int fas216_print_devices(FAS216_Info *info, char *buffer)
p += sprintf(p, " %d/%d ", scd->id, scd->lun);
if (scd->tagged_supported)
p += sprintf(p, "%3sabled(%3d) ",
scd->tagged_queue ? "en" : "dis",
scd->simple_tags ? "en" : "dis",
scd->current_tag);
else
p += sprintf(p, "unsupported ");
......
......@@ -4357,19 +4357,6 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
}
cp->cmd = cmd;
/*---------------------------------------------------
**
** Enable tagged queue if asked by scsi ioctl
**
**----------------------------------------------------
*/
#if 0 /* This stuff was only useful for linux-1.2.13 */
if (lp && !lp->numtags && cmd->device && cmd->device->tagged_queue) {
lp->numtags = tp->usrtags;
ncr_setup_tags (np, cmd->device->id, cmd->device->lun);
}
#endif
/*----------------------------------------------------
**
** Build the identify / tag / sdtr message
......
......@@ -3649,7 +3649,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
(SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd);
/* Enable simple tag queuing if device supports it. */
if (cmd->device->tagged_queue)
if (cmd->device->simple_tags)
pkt->control_flags |= cpu_to_le16(BIT_3);
/* Load SCSI command packet. */
......@@ -3949,7 +3949,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
(SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd);
/* Enable simple tag queuing if device supports it. */
if (cmd->device->tagged_queue)
if (cmd->device->simple_tags)
pkt->control_flags |= cpu_to_le16(BIT_3);
/* Load SCSI command packet. */
......@@ -4909,7 +4909,7 @@ qla12160_get_target_parameters(struct scsi_qla_host *ha, Scsi_Device *device)
} else
printk(" Async");
if (device->tagged_queue)
if (device->simple_tags)
printk(", Tagged queuing: depth %d", device->queue_depth);
printk("\n");
}
......
......@@ -408,30 +408,6 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void *arg)
return 0;
case SCSI_IOCTL_GET_BUS_NUMBER:
return put_user(sdev->host->host_no, (int *)arg);
/*
* The next two ioctls either need to go or need to be changed to
* pass tagged queueing changes through the low level drivers.
* Simply enabling or disabling tagged queueing without the knowledge
* of the low level driver is a *BAD* thing.
*
* Oct. 10, 2002 - Doug Ledford <dledford@redhat.com>
*/
case SCSI_IOCTL_TAGGED_ENABLE:
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (!sdev->tagged_supported)
return -EINVAL;
sdev->tagged_queue = 1;
sdev->current_tag = 1;
return 0;
case SCSI_IOCTL_TAGGED_DISABLE:
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (!sdev->tagged_supported)
return -EINVAL;
sdev->tagged_queue = 0;
sdev->current_tag = 0;
return 0;
case SCSI_IOCTL_PROBE_HOST:
return ioctl_probe(sdev->host, arg);
case SCSI_IOCTL_SEND_COMMAND:
......
......@@ -6594,19 +6594,6 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
}
cp->cmd = cmd;
/*---------------------------------------------------
**
** Enable tagged queue if asked by scsi ioctl
**
**----------------------------------------------------
*/
#if 0 /* This stuff was only useful for linux-1.2.13 */
if (lp && !lp->numtags && cmd->device && cmd->device->tagged_queue) {
lp->numtags = tp->usrtags;
ncr_setup_tags (np, cp->target, cp->lun);
}
#endif
/*----------------------------------------------------
**
** Build the identify / tag / sdtr message
......
......@@ -74,8 +74,6 @@ struct scsi_device {
unsigned wdtr:1; /* Device supports WDTR messages */
unsigned ppr:1; /* Device supports PPR messages */
unsigned tagged_supported:1; /* Supports SCSI-II tagged queuing */
unsigned tagged_queue:1;/* This is going away!!!! Look at simple_tags
instead!!! Please fix your driver now!! */
unsigned simple_tags:1; /* simple queue tag messages are enabled */
unsigned ordered_tags:1;/* ordered queue tag messages are enabled */
unsigned single_lun:1; /* Indicates we should only allow I/O to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment