Commit 95e38aa0 authored by Doug Ledford's avatar Doug Ledford

[PATCH] qla1280 TCQ update

qla1280.h:
  Update device template
qla1280.c:
  Update to use slave_attach for setting queue depth
parent 7ec7888b
...@@ -70,17 +70,21 @@ static unsigned char target2alpa[] = { ...@@ -70,17 +70,21 @@ static unsigned char target2alpa[] = {
static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd); static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd);
static void fcal_select_queue_depths(struct Scsi_Host *host, Scsi_Device *devlist) int fcal_slave_attach(Scsi_Device *device)
{ {
Scsi_Device *device; int depth_to_use;
for (device = devlist; device; device = device->next) { if (device->tagged_supported)
if (device->host != host) continue; depth_to_use = /* 254 */ 8;
if (device->tagged_supported) else
device->queue_depth = /* 254 */ 8; depth_to_use = 2;
else
device->queue_depth = 2; scsi_adjust_queue_depth(device,
} (device->tagged_supported ?
MSG_SIMPLE_TAG : 0),
depth_to_use);
return 0;
} }
/* Detect all FC Arbitrated Loops attached to the machine. /* Detect all FC Arbitrated Loops attached to the machine.
...@@ -165,7 +169,6 @@ int __init fcal_detect(Scsi_Host_Template *tpnt) ...@@ -165,7 +169,6 @@ int __init fcal_detect(Scsi_Host_Template *tpnt)
#ifdef __sparc_v9__ #ifdef __sparc_v9__
host->unchecked_isa_dma = 1; host->unchecked_isa_dma = 1;
#endif #endif
host->select_queue_depths = fcal_select_queue_depths;
fc->channels = 1; fc->channels = 1;
fc->targets = 127; fc->targets = 127;
......
...@@ -23,6 +23,7 @@ struct fcal { ...@@ -23,6 +23,7 @@ struct fcal {
int fcal_detect(Scsi_Host_Template *); int fcal_detect(Scsi_Host_Template *);
int fcal_release(struct Scsi_Host *); int fcal_release(struct Scsi_Host *);
int fcal_proc_info (char *, char **, off_t, int, int, int); int fcal_proc_info (char *, char **, off_t, int, int, int);
int fcal_slave_attach(Scsi_Device *);
#define FCAL { \ #define FCAL { \
name: "Fibre Channel Arbitrated Loop",\ name: "Fibre Channel Arbitrated Loop",\
...@@ -30,6 +31,7 @@ int fcal_proc_info (char *, char **, off_t, int, int, int); ...@@ -30,6 +31,7 @@ int fcal_proc_info (char *, char **, off_t, int, int, int);
release: fcal_release, \ release: fcal_release, \
proc_info: fcal_proc_info, \ proc_info: fcal_proc_info, \
queuecommand: fcp_scsi_queuecommand, \ queuecommand: fcp_scsi_queuecommand, \
slave_attach: fcal_slave_attach, \
can_queue: FCAL_CAN_QUEUE, \ can_queue: FCAL_CAN_QUEUE, \
this_id: -1, \ this_id: -1, \
sg_tablesize: 1, \ sg_tablesize: 1, \
......
...@@ -378,8 +378,6 @@ static Scsi_Host_Template *the_template = NULL; ...@@ -378,8 +378,6 @@ static Scsi_Host_Template *the_template = NULL;
#define ScsiResult(host_code, scsi_code) (((host_code) << 16) + ((scsi_code) & 0x7f)) #define ScsiResult(host_code, scsi_code) (((host_code) << 16) + ((scsi_code) & 0x7f))
static void ncr53c8xx_select_queue_depths(
struct Scsi_Host *host, struct scsi_device *devlist);
static void ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs); static void ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs);
static void ncr53c8xx_timeout(unsigned long np); static void ncr53c8xx_timeout(unsigned long np);
...@@ -3710,7 +3708,6 @@ ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device) ...@@ -3710,7 +3708,6 @@ ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device)
instance->dma_channel = 0; instance->dma_channel = 0;
instance->cmd_per_lun = MAX_TAGS; instance->cmd_per_lun = MAX_TAGS;
instance->can_queue = (MAX_START-4); instance->can_queue = (MAX_START-4);
instance->select_queue_depths = ncr53c8xx_select_queue_depths;
scsi_set_pci_device(instance, device->pdev); scsi_set_pci_device(instance, device->pdev);
#ifdef SCSI_NCR_INTEGRITY_CHECKING #ifdef SCSI_NCR_INTEGRITY_CHECKING
...@@ -8500,56 +8497,57 @@ static void __init ncr_getclock (ncb_p np, int mult) ...@@ -8500,56 +8497,57 @@ static void __init ncr_getclock (ncb_p np, int mult)
** Linux select queue depths function ** Linux select queue depths function
*/ */
static void ncr53c8xx_select_queue_depths(struct Scsi_Host *host, struct scsi_device *devlist) int ncr53c8xx_slave_attach(Scsi_Device *device)
{ {
struct scsi_device *device; struct Scsi_Host *host = device->host;
ncb_p np;
tcb_p tp;
lcb_p lp;
int numtags, depth_to_use;
for (device = devlist; device; device = device->next) { np = ((struct host_data *) host->hostdata)->ncb;
ncb_p np; tp = &np->target[device->id];
tcb_p tp; lp = tp->lp[device->lun];
lcb_p lp;
int numtags;
if (device->host != host) /*
continue; ** Select queue depth from driver setup.
** Donnot use more than configured by user.
** Use at least 2.
** Donnot use more than our maximum.
*/
numtags = device_queue_depth(np->unit, device->id, device->lun);
if (numtags > tp->usrtags)
numtags = tp->usrtags;
if (!device->tagged_supported)
numtags = 1;
depth_to_use = numtags;
if (depth_to_use < 2)
depth_to_use = 2;
if (depth_to_use > MAX_TAGS)
depth_to_use = MAX_TAGS;
np = ((struct host_data *) host->hostdata)->ncb; scsi_adjust_queue_depth(device,
tp = &np->target[device->id]; (device->tagged_supported ?
lp = tp->lp[device->lun]; MSG_SIMPLE_TAG : 0),
depth_to_use);
/* /*
** Select queue depth from driver setup. ** Since the queue depth is not tunable under Linux,
** Donnot use more than configured by user. ** we need to know this value in order not to
** Use at least 2. ** announce stupid things to user.
** Donnot use more than our maximum. */
*/ if (lp) {
numtags = device_queue_depth(np->unit, device->id, device->lun); lp->numtags = lp->maxtags = numtags;
if (numtags > tp->usrtags) lp->scdev_depth = depth_to_use;
numtags = tp->usrtags; }
if (!device->tagged_supported) ncr_setup_tags (np, device->id, device->lun);
numtags = 1;
device->queue_depth = numtags;
if (device->queue_depth < 2)
device->queue_depth = 2;
if (device->queue_depth > MAX_TAGS)
device->queue_depth = MAX_TAGS;
/*
** Since the queue depth is not tunable under Linux,
** we need to know this value in order not to
** announce stupid things to user.
*/
if (lp) {
lp->numtags = lp->maxtags = numtags;
lp->scdev_depth = device->queue_depth;
}
ncr_setup_tags (np, device->id, device->lun);
#ifdef DEBUG_NCR53C8XX #ifdef DEBUG_NCR53C8XX
printk("ncr53c8xx_select_queue_depth: host=%d, id=%d, lun=%d, depth=%d\n", printk("ncr53c8xx_select_queue_depth: host=%d, id=%d, lun=%d, depth=%d\n",
np->unit, device->id, device->lun, device->queue_depth); np->unit, device->id, device->lun, depth_to_use);
#endif #endif
}
return 0;
} }
/* /*
......
...@@ -59,6 +59,7 @@ int ncr53c8xx_detect(Scsi_Host_Template *tpnt); ...@@ -59,6 +59,7 @@ int ncr53c8xx_detect(Scsi_Host_Template *tpnt);
const char *ncr53c8xx_info(struct Scsi_Host *host); const char *ncr53c8xx_info(struct Scsi_Host *host);
int ncr53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); int ncr53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int ncr53c8xx_reset(Scsi_Cmnd *, unsigned int); int ncr53c8xx_reset(Scsi_Cmnd *, unsigned int);
int ncr53c8xx_slave_attach(Scsi_Device *);
#ifdef MODULE #ifdef MODULE
int ncr53c8xx_release(struct Scsi_Host *); int ncr53c8xx_release(struct Scsi_Host *);
...@@ -74,6 +75,7 @@ int ncr53c8xx_release(struct Scsi_Host *); ...@@ -74,6 +75,7 @@ int ncr53c8xx_release(struct Scsi_Host *);
release: ncr53c8xx_release, \ release: ncr53c8xx_release, \
info: ncr53c8xx_info, \ info: ncr53c8xx_info, \
queuecommand: ncr53c8xx_queue_command,\ queuecommand: ncr53c8xx_queue_command,\
slave_attach: ncr53c8xx_slave_attach, \
abort: ncr53c8xx_abort, \ abort: ncr53c8xx_abort, \
reset: ncr53c8xx_reset, \ reset: ncr53c8xx_reset, \
bios_param: scsicam_bios_param, \ bios_param: scsicam_bios_param, \
......
...@@ -71,17 +71,21 @@ static void __init pluto_detect_scsi_done(Scsi_Cmnd *SCpnt) ...@@ -71,17 +71,21 @@ static void __init pluto_detect_scsi_done(Scsi_Cmnd *SCpnt)
up(&fc_sem); up(&fc_sem);
} }
static void pluto_select_queue_depths(struct Scsi_Host *host, Scsi_Device *devlist) int pluto_slave_attach(Scsi_Device *device)
{ {
Scsi_Device *device; int depth_to_use;
for (device = devlist; device; device = device->next) { if (device->tagged_supported)
if (device->host != host) continue; depth_to_use = /* 254 */ 8;
if (device->tagged_supported) else
device->queue_depth = /* 254 */ 8; depth_to_use = 2;
else
device->queue_depth = 2; scsi_adjust_queue_depth(device,
} (device->tagged_supported ?
MSG_SIMPLE_TAG : 0),
depth_to_use);
return 0;
} }
/* Detect all SSAs attached to the machine. /* Detect all SSAs attached to the machine.
...@@ -241,7 +245,6 @@ int __init pluto_detect(Scsi_Host_Template *tpnt) ...@@ -241,7 +245,6 @@ int __init pluto_detect(Scsi_Host_Template *tpnt)
host->unchecked_isa_dma = 1; host->unchecked_isa_dma = 1;
#endif #endif
host->select_queue_depths = pluto_select_queue_depths;
fc->channels = inq->channels + 1; fc->channels = inq->channels + 1;
fc->targets = inq->targets; fc->targets = inq->targets;
......
...@@ -41,6 +41,7 @@ struct pluto_inquiry { ...@@ -41,6 +41,7 @@ struct pluto_inquiry {
int pluto_detect(Scsi_Host_Template *); int pluto_detect(Scsi_Host_Template *);
int pluto_release(struct Scsi_Host *); int pluto_release(struct Scsi_Host *);
const char * pluto_info(struct Scsi_Host *); const char * pluto_info(struct Scsi_Host *);
int pluto_slave_attach(Scsi_Device *);
#define PLUTO { \ #define PLUTO { \
name: "Sparc Storage Array 100/200", \ name: "Sparc Storage Array 100/200", \
...@@ -48,6 +49,7 @@ const char * pluto_info(struct Scsi_Host *); ...@@ -48,6 +49,7 @@ const char * pluto_info(struct Scsi_Host *);
release: pluto_release, \ release: pluto_release, \
info: pluto_info, \ info: pluto_info, \
queuecommand: fcp_scsi_queuecommand, \ queuecommand: fcp_scsi_queuecommand, \
slave_attach: pluto_slave_attach, \
can_queue: PLUTO_CAN_QUEUE, \ can_queue: PLUTO_CAN_QUEUE, \
this_id: -1, \ this_id: -1, \
sg_tablesize: 1, \ sg_tablesize: 1, \
......
...@@ -382,8 +382,7 @@ static void qla1280_done(struct scsi_qla_host *, srb_t **, srb_t **); ...@@ -382,8 +382,7 @@ static void qla1280_done(struct scsi_qla_host *, srb_t **, srb_t **);
static void qla1280_next(struct scsi_qla_host *, scsi_lu_t *, int); static void qla1280_next(struct scsi_qla_host *, scsi_lu_t *, int);
static void qla1280_putq_t(scsi_lu_t *, srb_t *); static void qla1280_putq_t(scsi_lu_t *, srb_t *);
static void qla1280_done_q_put(srb_t *, srb_t **, srb_t **); static void qla1280_done_q_put(srb_t *, srb_t **, srb_t **);
static void qla1280_device_queue_depth(struct scsi_qla_host *, Scsi_Device *); static int qla1280_slave_attach(Scsi_Device *);
static void qla1280_select_queue_depth(struct Scsi_Host *, Scsi_Device *);
#if STOP_ON_ERROR #if STOP_ON_ERROR
static void qla1280_panic(char *, struct Scsi_Host *host); static void qla1280_panic(char *, struct Scsi_Host *host);
#endif #endif
...@@ -840,7 +839,6 @@ qla1280_do_device_init(struct pci_dev *pdev, ...@@ -840,7 +839,6 @@ qla1280_do_device_init(struct pci_dev *pdev,
host->can_queue = 0xfffff; /* unlimited */ host->can_queue = 0xfffff; /* unlimited */
host->cmd_per_lun = 1; host->cmd_per_lun = 1;
host->select_queue_depths = qla1280_select_queue_depth;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
host->base = (unsigned char *)ha->mmpbase; host->base = (unsigned char *)ha->mmpbase;
#else #else
...@@ -1796,7 +1794,7 @@ qla1280_do_dpc(void *p) ...@@ -1796,7 +1794,7 @@ qla1280_do_dpc(void *p)
} }
/************************************************************************** /**************************************************************************
* qla1280_device_queue_depth * qla1280_slave_attach
* *
* Description: * Description:
* Determines the queue depth for a given device. There are two ways * Determines the queue depth for a given device. There are two ways
...@@ -1806,51 +1804,28 @@ qla1280_do_dpc(void *p) ...@@ -1806,51 +1804,28 @@ qla1280_do_dpc(void *p)
* as the default queue depth. Otherwise, we use either 4 or 8 as the * as the default queue depth. Otherwise, we use either 4 or 8 as the
* default queue depth (dependent on the number of hardware SCBs). * default queue depth (dependent on the number of hardware SCBs).
**************************************************************************/ **************************************************************************/
static void static int
qla1280_device_queue_depth(struct scsi_qla_host *p, Scsi_Device * device) qla1280_slave_attach(Scsi_Device * device)
{ {
int default_depth = 3; struct scsi_qla_host *p = (struct scsi_qla_host *)device->host->hostdata;
int bus = device->channel; int bus = device->channel;
int target = device->id; int target = device->id;
device->queue_depth = default_depth; if (qla1280_check_for_dead_scsi_bus(p, bus))
return 1;
if (device->tagged_supported && if (device->tagged_supported &&
(p->bus_settings[bus].qtag_enables & (BIT_0 << target))) { (p->bus_settings[bus].qtag_enables & (BIT_0 << target))) {
device->tagged_queue = 1; scsi_adjust_queue_depth(device, MSG_ORDERED_TAG,
device->current_tag = 0; p->bus_settings[bus].hiwat);
device->queue_depth = p->bus_settings[bus].hiwat;
/* device->queue_depth = 20; */ /* device->queue_depth = 20; */
printk(KERN_INFO "scsi(%li:%d:%d:%d): Enabled tagged queuing, " printk(KERN_INFO "scsi(%li:%d:%d:%d): Enabled tagged queuing, "
"queue depth %d.\n", p->host_no, device->channel, "queue depth %d.\n", p->host_no, device->channel,
device->id, device->lun, device->queue_depth); device->id, device->lun, device->queue_depth);
} else {
scsi_adjust_queue_depth(device, 0 /* TCQ off */, 3);
} }
qla12160_get_target_parameters(p, bus, target, device->lun); qla12160_get_target_parameters(p, bus, target, device->lun);
} return 0;
/**************************************************************************
* qla1280_select_queue_depth
*
* Sets the queue depth for each SCSI device hanging off the input
* host adapter. We use a queue depth of 2 for devices that do not
* support tagged queueing.
**************************************************************************/
static void
qla1280_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs)
{
Scsi_Device *device;
struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
ENTER("qla1280_select_queue_depth");
for (device = scsi_devs; device != NULL; device = device->next) {
if (device->host == host)
qla1280_device_queue_depth (ha, device);
}
if (scsi_devs)
qla1280_check_for_dead_scsi_bus(ha, scsi_devs->channel);
LEAVE("qla1280_select_queue_depth");
} }
/* /*
......
...@@ -1314,6 +1314,7 @@ int qla1280_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); ...@@ -1314,6 +1314,7 @@ int qla1280_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
int qla1280_abort(Scsi_Cmnd *); int qla1280_abort(Scsi_Cmnd *);
int qla1280_reset(Scsi_Cmnd *, unsigned int); int qla1280_reset(Scsi_Cmnd *, unsigned int);
int qla1280_biosparam(Disk *, struct block_device *, int[]); int qla1280_biosparam(Disk *, struct block_device *, int[]);
static int qla1280_slave_attach(Scsi_Device *);
void qla1280_intr_handler(int, void *, struct pt_regs *); void qla1280_intr_handler(int, void *, struct pt_regs *);
void qla1280_setup(char *s, int *dummy); void qla1280_setup(char *s, int *dummy);
...@@ -1342,7 +1343,7 @@ void qla1280_setup(char *s, int *dummy); ...@@ -1342,7 +1343,7 @@ void qla1280_setup(char *s, int *dummy);
/* use_new_eh_code: 0, */ \ /* use_new_eh_code: 0, */ \
abort: qla1280_abort, \ abort: qla1280_abort, \
reset: qla1280_reset, \ reset: qla1280_reset, \
slave_attach: NULL, \ slave_attach: qla1280_slave_attach, \
bios_param: qla1280_biosparam, \ bios_param: qla1280_biosparam, \
can_queue: 255, /* max simultaneous cmds */\ can_queue: 255, /* max simultaneous cmds */\
this_id: -1, /* scsi id of host adapter */\ this_id: -1, /* scsi id of host adapter */\
......
...@@ -1341,8 +1341,6 @@ MODULE_PARM(sym53c8xx, "s"); ...@@ -1341,8 +1341,6 @@ MODULE_PARM(sym53c8xx, "s");
#define SetScsiAbortResult(cmd) SetScsiResult(cmd, DID_ABORT, 0xff) #define SetScsiAbortResult(cmd) SetScsiResult(cmd, DID_ABORT, 0xff)
#endif #endif
static void sym53c8xx_select_queue_depths(
struct Scsi_Host *host, struct scsi_device *devlist);
static void sym53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs); static void sym53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs);
static void sym53c8xx_timeout(unsigned long np); static void sym53c8xx_timeout(unsigned long np);
...@@ -5923,8 +5921,6 @@ ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device) ...@@ -5923,8 +5921,6 @@ ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device)
#endif #endif
#endif #endif
instance->select_queue_depths = sym53c8xx_select_queue_depths;
NCR_UNLOCK_NCB(np, flags); NCR_UNLOCK_NCB(np, flags);
/* /*
...@@ -13545,56 +13541,57 @@ static int device_queue_depth(ncb_p np, int target, int lun) ...@@ -13545,56 +13541,57 @@ static int device_queue_depth(ncb_p np, int target, int lun)
return DEF_DEPTH; return DEF_DEPTH;
} }
static void sym53c8xx_select_queue_depths(struct Scsi_Host *host, struct scsi_device *devlist) int sym53c8xx_slave_attach(Scsi_Device *device)
{ {
struct scsi_device *device; struct Scsi_Host *host = device->host;
ncb_p np;
for (device = devlist; device; device = device->next) { tcb_p tp;
ncb_p np; lcb_p lp;
tcb_p tp; int numtags, depth_to_use;
lcb_p lp;
int numtags;
if (device->host != host) np = ((struct host_data *) host->hostdata)->ncb;
continue; tp = &np->target[device->id];
lp = ncr_lp(np, tp, device->lun);
np = ((struct host_data *) host->hostdata)->ncb; /*
tp = &np->target[device->id]; ** Select queue depth from driver setup.
lp = ncr_lp(np, tp, device->lun); ** Donnot use more than configured by user.
** Use at least 2.
** Donnot use more than our maximum.
*/
numtags = device_queue_depth(np, device->id, device->lun);
if (numtags > tp->usrtags)
numtags = tp->usrtags;
if (!device->tagged_supported)
numtags = 1;
depth_to_use = numtags;
if (depth_to_use < 2)
depth_to_use = 2;
if (depth_to_use > MAX_TAGS)
depth_to_use = MAX_TAGS;
/* scsi_adjust_queue_depth(device,
** Select queue depth from driver setup. (device->tagged_supported ?
** Donnot use more than configured by user. MSG_SIMPLE_TAG : 0),
** Use at least 2. depth_to_use);
** Donnot use more than our maximum.
*/
numtags = device_queue_depth(np, device->id, device->lun);
if (numtags > tp->usrtags)
numtags = tp->usrtags;
if (!device->tagged_supported)
numtags = 1;
device->queue_depth = numtags;
if (device->queue_depth < 2)
device->queue_depth = 2;
if (device->queue_depth > MAX_TAGS)
device->queue_depth = MAX_TAGS;
/* /*
** Since the queue depth is not tunable under Linux, ** Since the queue depth is not tunable under Linux,
** we need to know this value in order not to ** we need to know this value in order not to
** announce stupid things to user. ** announce stupid things to user.
*/ */
if (lp) { if (lp) {
lp->numtags = lp->maxtags = numtags; lp->numtags = lp->maxtags = numtags;
lp->scdev_depth = device->queue_depth; lp->scdev_depth = depth_to_use;
} }
ncr_setup_tags (np, device->id, device->lun); ncr_setup_tags (np, device->id, device->lun);
#ifdef DEBUG_SYM53C8XX #ifdef DEBUG_SYM53C8XX
printk("sym53c8xx_select_queue_depth: host=%d, id=%d, lun=%d, depth=%d\n", printk("sym53c8xx_select_queue_depth: host=%d, id=%d, lun=%d, depth=%d\n",
np->unit, device->id, device->lun, device->queue_depth); np->unit, device->id, device->lun, depth_to_use);
#endif #endif
}
return 0;
} }
/* /*
......
...@@ -74,6 +74,7 @@ int sym53c8xx_detect(Scsi_Host_Template *tpnt); ...@@ -74,6 +74,7 @@ int sym53c8xx_detect(Scsi_Host_Template *tpnt);
const char *sym53c8xx_info(struct Scsi_Host *host); const char *sym53c8xx_info(struct Scsi_Host *host);
int sym53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); int sym53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int sym53c8xx_reset(Scsi_Cmnd *, unsigned int); int sym53c8xx_reset(Scsi_Cmnd *, unsigned int);
int sym53c8xx_slave_attach(Scsi_Device *);
#ifdef MODULE #ifdef MODULE
int sym53c8xx_release(struct Scsi_Host *); int sym53c8xx_release(struct Scsi_Host *);
...@@ -89,6 +90,7 @@ int sym53c8xx_release(struct Scsi_Host *); ...@@ -89,6 +90,7 @@ int sym53c8xx_release(struct Scsi_Host *);
release: sym53c8xx_release, \ release: sym53c8xx_release, \
info: sym53c8xx_info, \ info: sym53c8xx_info, \
queuecommand: sym53c8xx_queue_command,\ queuecommand: sym53c8xx_queue_command,\
slave_attach: sym53c8xx_slave_attach, \
abort: sym53c8xx_abort, \ abort: sym53c8xx_abort, \
reset: sym53c8xx_reset, \ reset: sym53c8xx_reset, \
bios_param: scsicam_bios_param, \ bios_param: scsicam_bios_param, \
......
...@@ -89,6 +89,8 @@ int sym53c8xx_eh_device_reset_handler(Scsi_Cmnd *); ...@@ -89,6 +89,8 @@ int sym53c8xx_eh_device_reset_handler(Scsi_Cmnd *);
int sym53c8xx_eh_bus_reset_handler(Scsi_Cmnd *); int sym53c8xx_eh_bus_reset_handler(Scsi_Cmnd *);
int sym53c8xx_eh_host_reset_handler(Scsi_Cmnd *); int sym53c8xx_eh_host_reset_handler(Scsi_Cmnd *);
int sym53c8xx_slave_attach(Scsi_Device *);
#ifdef MODULE #ifdef MODULE
int sym53c8xx_release(struct Scsi_Host *); int sym53c8xx_release(struct Scsi_Host *);
#else #else
...@@ -109,6 +111,7 @@ int sym53c8xx_release(struct Scsi_Host *); ...@@ -109,6 +111,7 @@ int sym53c8xx_release(struct Scsi_Host *);
release: sym53c8xx_release, \ release: sym53c8xx_release, \
info: sym53c8xx_info, \ info: sym53c8xx_info, \
queuecommand: sym53c8xx_queue_command, \ queuecommand: sym53c8xx_queue_command, \
slave_attach: sym53c8xx_slave_attach, \
eh_abort_handler: sym53c8xx_eh_abort_handler, \ eh_abort_handler: sym53c8xx_eh_abort_handler, \
eh_device_reset_handler:sym53c8xx_eh_device_reset_handler, \ eh_device_reset_handler:sym53c8xx_eh_device_reset_handler, \
eh_bus_reset_handler: sym53c8xx_eh_bus_reset_handler, \ eh_bus_reset_handler: sym53c8xx_eh_bus_reset_handler, \
......
...@@ -1327,66 +1327,63 @@ static int device_queue_depth(hcb_p np, int target, int lun) ...@@ -1327,66 +1327,63 @@ static int device_queue_depth(hcb_p np, int target, int lun)
/* /*
* Linux entry point for device queue sizing. * Linux entry point for device queue sizing.
*/ */
static void int
sym53c8xx_select_queue_depths(struct Scsi_Host *host, sym53c8xx_slave_attach(Scsi_Device *device)
struct scsi_device *devlist)
{ {
struct scsi_device *device; struct Scsi_Host *host = device->host;
hcb_p np;
for (device = devlist; device; device = device->next) { tcb_p tp;
hcb_p np; lcb_p lp;
tcb_p tp; int reqtags, depth_to_use;
lcb_p lp;
int reqtags;
if (device->host != host)
continue;
np = ((struct host_data *) host->hostdata)->ncb; np = ((struct host_data *) host->hostdata)->ncb;
tp = &np->target[device->id]; tp = &np->target[device->id];
/* /*
* Get user settings for transfer parameters. * Get user settings for transfer parameters.
*/ */
tp->inq_byte7_valid = (INQ7_SYNC|INQ7_WIDE16); tp->inq_byte7_valid = (INQ7_SYNC|INQ7_WIDE16);
sym_update_trans_settings(np, tp); sym_update_trans_settings(np, tp);
/* /*
* Allocate the LCB if not yet. * Allocate the LCB if not yet.
* If it fail, we may well be in the sh*t. :) * If it fail, we may well be in the sh*t. :)
*/ */
lp = sym_alloc_lcb(np, device->id, device->lun); lp = sym_alloc_lcb(np, device->id, device->lun);
if (!lp) { if (!lp)
device->queue_depth = 1; return -ENOMEM;
continue;
}
/* /*
* Get user flags. * Get user flags.
*/ */
lp->curr_flags = lp->user_flags; lp->curr_flags = lp->user_flags;
/* /*
* Select queue depth from driver setup. * Select queue depth from driver setup.
* Donnot use more than configured by user. * Donnot use more than configured by user.
* Use at least 2. * Use at least 2.
* Donnot use more than our maximum. * Donnot use more than our maximum.
*/ */
reqtags = device_queue_depth(np, device->id, device->lun); reqtags = device_queue_depth(np, device->id, device->lun);
if (reqtags > tp->usrtags) if (reqtags > tp->usrtags)
reqtags = tp->usrtags; reqtags = tp->usrtags;
if (!device->tagged_supported) if (!device->tagged_supported)
reqtags = 0; reqtags = 0;
#if 1 /* Avoid to locally queue commands for no good reasons */ #if 1 /* Avoid to locally queue commands for no good reasons */
if (reqtags > SYM_CONF_MAX_TAG) if (reqtags > SYM_CONF_MAX_TAG)
reqtags = SYM_CONF_MAX_TAG; reqtags = SYM_CONF_MAX_TAG;
device->queue_depth = reqtags ? reqtags : 2; depth_to_use = (reqtags ? reqtags : 2);
#else #else
device->queue_depth = reqtags ? SYM_CONF_MAX_TAG : 2; depth_to_use = (reqtags ? SYM_CONF_MAX_TAG : 2);
#endif #endif
lp->s.scdev_depth = device->queue_depth; scsi_adjust_queue_depth(device,
sym_tune_dev_queuing(np, device->id, device->lun, reqtags); (device->tagged_supported ?
} MSG_SIMPLE_TAG : 0),
depth_to_use);
lp->s.scdev_depth = depth_to_use;
sym_tune_dev_queuing(np, device->id, device->lun, reqtags);
return 0;
} }
/* /*
...@@ -2132,7 +2129,6 @@ sym_attach (Scsi_Host_Template *tpnt, int unit, sym_device *dev) ...@@ -2132,7 +2129,6 @@ sym_attach (Scsi_Host_Template *tpnt, int unit, sym_device *dev)
#if LINUX_VERSION_CODE >= LinuxVersionCode(2,4,0) #if LINUX_VERSION_CODE >= LinuxVersionCode(2,4,0)
instance->max_cmd_len = 16; instance->max_cmd_len = 16;
#endif #endif
instance->select_queue_depths = sym53c8xx_select_queue_depths;
instance->highmem_io = 1; instance->highmem_io = 1;
SYM_UNLOCK_HCB(np, flags); SYM_UNLOCK_HCB(np, flags);
......
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