* RE: [patch 3/3] HCIL accraid updates
@ 2005-10-31 12:23 Salyzyn, Mark
2005-11-11 11:55 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Salyzyn, Mark @ 2005-10-31 12:23 UTC (permalink / raw)
To: Jeff Garzik, Mark Haverkamp, SCSI Mailing List
No problem from me.
There was a time I would have resisted while we were working out our
SATA cards as we were exploring the possibility of representing the
increased number of array targets with id & lun by keeping the decision
centralized in a small series of macros allowing us to act quickly; but
I am all over that now. SATA cards have 128 array targets, and still map
one-to-one with id.
Would have preferred the patch to cut the cord completely and drop all
the container to id macros, that can follow in a cosmetic cleanup patch
behind all the big ones on their way.
Sincerely -- Mark Salyzyn
-----Original Message-----
From: linux-scsi-owner@vger.kernel.org
[mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Jeff Garzik
Sent: Saturday, October 29, 2005 5:40 PM
To: linux-scsi@vger.kernel.org
Cc: markh@osdl.org
Subject: [patch 3/3] HCIL accraid updates
commit 5ffa5fea1a50cdc3196e5f0c4e18b1aceb88125f
Author: Jeff Garzik <jgarzik@pobox.com>
Date: Sat Oct 29 17:32:26 2005 -0400
[SCSI] aacraid: use scmd_id(), begin elimination of
ID_LUN_TO_CONTAINER()
- begin elimination of ID_LUN_TO_CONTAINER(), which takes "id" and
"lun"
arguments, but only uses the "id" argument. This eliminates
needless
references to sdev->lun, which are always compiled out.
- begin using wrappers scmd_id(), sdev_id()
drivers/scsi/aacraid/aachba.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/aacraid/aachba.c
b/drivers/scsi/aacraid/aachba.c index 2a128a1..8b797d6 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -908,7 +908,7 @@ static void io_callback(void *context, s
scsicmd = (struct scsi_cmnd *) context;
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
- cid = ID_LUN_TO_CONTAINER(scsicmd->device->id,
scsicmd->device->lun);
+ cid = scmd_id(scsicmd);
if (nblank(dprintk(x))) {
u64 lba;
@@ -1353,7 +1353,7 @@ static void synchronize_callback(void *c
else {
struct scsi_device *sdev = cmd->device;
struct aac_dev *dev = (struct aac_dev
*)sdev->host->hostdata;
- u32 cid = ID_LUN_TO_CONTAINER(sdev->id, sdev->lun);
+ u32 cid = sdev_id(sdev);
printk(KERN_WARNING
"synchronize_callback: synchronize failed, status =
%d\n",
le32_to_cpu(synchronizereply->status));
@@ -1547,7 +1547,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsi
{
struct inquiry_data inq_data;
- dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n",
scsicmd->device->id));
+ dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n",
scmd_id(scsicmd)));
memset(&inq_data, 0, sizeof (struct inquiry_data));
inq_data.inqd_ver = 2; /* claim compliance to SCSI-2 */
@@ -1774,7 +1774,7 @@ static int query_disk(struct aac_dev *de
if (copy_from_user(&qd, arg, sizeof (struct aac_query_disk)))
return -EFAULT;
if (qd.cnum == -1)
- qd.cnum = ID_LUN_TO_CONTAINER(qd.id, qd.lun);
+ qd.cnum = qd.id;
else if ((qd.bus == -1) && (qd.id == -1) && (qd.lun == -1))
{
if (qd.cnum < 0 || qd.cnum >=
dev->maximum_num_containers)
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org More majordomo info
at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread* [patch 1/3] HCIL: more sfoo_printk()
@ 2005-10-29 21:38 Jeff Garzik
2005-10-29 21:39 ` [patch 3/3] HCIL accraid updates Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2005-10-29 21:38 UTC (permalink / raw)
To: linux-scsi
commit bab4e339d19ea45eaea3ea252a545d9d0efcae9f
Author: Jeff Garzik <jgarzik@pobox.com>
Date: Sat Oct 29 17:13:28 2005 -0400
[SCSI] more uses of sfoo_printk()
drivers/scsi/NCR5380.c | 11 ++++++++---
drivers/scsi/NCR5380.h | 8 ++++++++
drivers/scsi/constants.c | 3 +--
drivers/scsi/eata.c | 12 +++++-------
drivers/scsi/scsi.c | 2 +-
drivers/scsi/scsi_error.c | 9 ++++-----
drivers/scsi/sd.c | 3 +--
7 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index cc9ecb3..9e2764f 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -1120,7 +1120,8 @@ static void NCR5380_main(void *p)
this is needed for Mustek scanners, that
do not respond to commands immediately
after a scan */
- printk(KERN_DEBUG "scsi%d: device %d did not respond in time\n", instance->host_no, tmp->device->id);
+ scmd_printk(KERN_DEBUG, tmp,
+ "device did not respond in time\n");
LIST(tmp, hostdata->issue_queue);
tmp->host_scribble = (unsigned char *) hostdata->issue_queue;
hostdata->issue_queue = tmp;
@@ -2244,7 +2245,8 @@ static void NCR5380_information_transfer
/* The next command is still part of this process */
cmd->next_link->tag = cmd->tag;
cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8);
- dprintk(NDEBUG_LINKED, ("scsi%d : target %d lun %d linked request done, calling scsi_done().\n", instance->host_no, cmd->device->id, cmd->device->lun));
+ ddprintk(KERN_DEBUG, cmd,
+ "linked request done, calling scsi_done().\n");
collect_stats(hostdata, cmd);
cmd->scsi_done(cmd);
cmd = hostdata->connected;
@@ -2339,7 +2341,10 @@ static void NCR5380_information_transfer
hostdata->disconnected_queue;
hostdata->connected = NULL;
hostdata->disconnected_queue = cmd;
- dprintk(NDEBUG_QUEUES, ("scsi%d : command for target %d lun %d was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->device->id, cmd->device->lun));
+ ddprintk(KERN_DEBUG, cmd,
+ "command for target was moved from connected to"
+ " the disconnected_queue\n");
+
/*
* Restore phase bits to 0 so an interrupted selection,
* arbitration can resume.
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
index c3462e3..298b2df 100644
--- a/drivers/scsi/NCR5380.h
+++ b/drivers/scsi/NCR5380.h
@@ -289,6 +289,14 @@ struct NCR5380_hostdata {
#define NCR5380_dprint(a,b) do {} while(0)
#define NCR5380_dprint_phase(a,b) do {} while(0)
+#if 0
+#define ddprintk(prefix, scmd, fmt, a...) \
+ scmd_printk(prefix, scmd, fmt, ##a)
+#else
+#define ddprintk(prefix, scmd, fmt, a...) \
+ do {} while (0)
+#endif
+
#if defined(AUTOPROBE_IRQ)
static int NCR5380_probe_irq(struct Scsi_Host *instance, int possible);
#endif
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 09bc815..8bd936b 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1389,8 +1389,7 @@ EXPORT_SYMBOL(scsi_print_msg);
void scsi_print_command(struct scsi_cmnd *cmd)
{
/* Assume appended output (i.e. not at start of line) */
- sdev_printk("", cmd->device, "\n");
- printk(KERN_INFO " command: ");
+ scmd_printk(KERN_INFO, cmd, "command:\n\t");
scsi_print_cdb(cmd->cmnd, cmd->cmd_len, 0);
}
EXPORT_SYMBOL(scsi_print_command);
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index b45a4c7..cd0fc64 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -2455,20 +2455,18 @@ static irqreturn_t ihdlr(int irq, struct
status = DID_OK << 16;
if (tstatus == GOOD)
- ha->target_redo[SCpnt->device->id][SCpnt->device->
- channel] = 0;
+ ha->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)] = 0;
if (spp->target_status && SCpnt->device->type == TYPE_DISK &&
(!(tstatus == CHECK_CONDITION && ha->iocount <= 1000 &&
(SCpnt->sense_buffer[2] & 0xf) == NOT_READY)))
- printk("%s: ihdlr, target %d.%d:%d, pid %ld, "
+ scmd_printk(KERN_INFO, SCpnt,
+ "ihdlr, pid %ld, "
"target_status 0x%x, sense key 0x%x.\n",
- ha->board_name,
- SCpnt->device->channel, SCpnt->device->id,
- SCpnt->device->lun, SCpnt->pid,
+ SCpnt->pid,
spp->target_status, SCpnt->sense_buffer[2]);
- ha->target_to[SCpnt->device->id][SCpnt->device->channel] = 0;
+ ha->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] = 0;
if (ha->last_retried_pid == SCpnt->pid)
ha->retries = 0;
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 0be60bb..4f86215 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -806,7 +806,7 @@ static void scsi_softirq(struct softirq_
disposition = scsi_decide_disposition(cmd);
if (disposition != SUCCESS &&
time_before(cmd->jiffies_at_alloc + wait_for, jiffies)) {
- sdev_printk(KERN_ERR, cmd->device,
+ scmd_printk(KERN_ERR, cmd,
"timing out command, waited %lus\n",
wait_for/HZ);
disposition = SUCCESS;
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 0c5b02d..4fddb9b 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1174,9 +1174,9 @@ static void scsi_eh_offline_sdevs(struct
struct scsi_cmnd *scmd, *next;
list_for_each_entry_safe(scmd, next, work_q, eh_entry) {
- sdev_printk(KERN_INFO, scmd->device,
- "scsi: Device offlined - not"
- " ready after error recovery\n");
+ scmd_printk(KERN_INFO, scmd,
+ "Device offlined - not"
+ " ready after error recovery\n");
scsi_device_set_state(scmd->device, SDEV_OFFLINE);
if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) {
/*
@@ -1338,8 +1338,7 @@ int scsi_decide_disposition(struct scsi_
return SUCCESS;
case RESERVATION_CONFLICT:
- sdev_printk(KERN_INFO, scmd->device,
- "reservation conflict\n");
+ scmd_printk(KERN_INFO, scmd, "reservation conflict\n");
return SUCCESS; /* causes immediate i/o error */
default:
return FAILED;
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9de8e18..fca6e0e 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1534,8 +1534,7 @@ static int sd_probe(struct device *dev)
if (sdp->type != TYPE_DISK && sdp->type != TYPE_MOD && sdp->type != TYPE_RBC)
goto out;
- SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp,
- "sd_attach\n"));
+ SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp, "sd_attach\n"));
error = -ENOMEM;
sdkp = kmalloc(sizeof(*sdkp), GFP_KERNEL);
^ permalink raw reply related [flat|nested] 3+ messages in thread* [patch 3/3] HCIL accraid updates
2005-10-29 21:38 [patch 1/3] HCIL: more sfoo_printk() Jeff Garzik
@ 2005-10-29 21:39 ` Jeff Garzik
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2005-10-29 21:39 UTC (permalink / raw)
To: linux-scsi; +Cc: markh
commit 5ffa5fea1a50cdc3196e5f0c4e18b1aceb88125f
Author: Jeff Garzik <jgarzik@pobox.com>
Date: Sat Oct 29 17:32:26 2005 -0400
[SCSI] aacraid: use scmd_id(), begin elimination of ID_LUN_TO_CONTAINER()
- begin elimination of ID_LUN_TO_CONTAINER(), which takes "id" and "lun"
arguments, but only uses the "id" argument. This eliminates needless
references to sdev->lun, which are always compiled out.
- begin using wrappers scmd_id(), sdev_id()
drivers/scsi/aacraid/aachba.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 2a128a1..8b797d6 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -908,7 +908,7 @@ static void io_callback(void *context, s
scsicmd = (struct scsi_cmnd *) context;
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
- cid = ID_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
+ cid = scmd_id(scsicmd);
if (nblank(dprintk(x))) {
u64 lba;
@@ -1353,7 +1353,7 @@ static void synchronize_callback(void *c
else {
struct scsi_device *sdev = cmd->device;
struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
- u32 cid = ID_LUN_TO_CONTAINER(sdev->id, sdev->lun);
+ u32 cid = sdev_id(sdev);
printk(KERN_WARNING
"synchronize_callback: synchronize failed, status = %d\n",
le32_to_cpu(synchronizereply->status));
@@ -1547,7 +1547,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsi
{
struct inquiry_data inq_data;
- dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", scsicmd->device->id));
+ dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", scmd_id(scsicmd)));
memset(&inq_data, 0, sizeof (struct inquiry_data));
inq_data.inqd_ver = 2; /* claim compliance to SCSI-2 */
@@ -1774,7 +1774,7 @@ static int query_disk(struct aac_dev *de
if (copy_from_user(&qd, arg, sizeof (struct aac_query_disk)))
return -EFAULT;
if (qd.cnum == -1)
- qd.cnum = ID_LUN_TO_CONTAINER(qd.id, qd.lun);
+ qd.cnum = qd.id;
else if ((qd.bus == -1) && (qd.id == -1) && (qd.lun == -1))
{
if (qd.cnum < 0 || qd.cnum >= dev->maximum_num_containers)
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-11 11:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-31 12:23 [patch 3/3] HCIL accraid updates Salyzyn, Mark
2005-11-11 11:55 ` Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2005-10-29 21:38 [patch 1/3] HCIL: more sfoo_printk() Jeff Garzik
2005-10-29 21:39 ` [patch 3/3] HCIL accraid updates Jeff Garzik
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.