Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] megaraid_sas: intercept cmd timeout and throttle io
  [SCSI] fusion: Fix |/|| confusion
  [SCSI] aic94xx: asd_clear_nexus should fail if the cleared task does not complete
  [SCSI] aic7xxx: fix aicasm build failure with gcc-3.4.6
  [SCSI] aacraid: apply commit config for reset_devices flag
  [SCSI] sd: fix refcounting regression in suspend/resume routines
  [SCSI] aacraid: fix panic on short Inquiry
  [SCSI] aacraid: Correct sa platform support. (Was: [Bug 8469] Bad EIP value on pentium3 SMP kernel-2.6.21.1)
  [SCSI] NCR53C9x: correct spelling mistake in deprecation notice
  [SCSI] tgt: fix a rdma indirect transfer error bug
  [SCSI] MegaRAID: Update MAINTAINERS email-id
  [SCSI] stex: minor cleanup and version update
  [SCSI] stex: fix reset recovery for console device
  [SCSI] stex: extend hard reset wait time
  [SCSI] stex: fix id mapping issue
  [SCSI] ipr: Proper return codes for eh_dev_reset for SATA devices
  [SCSI] zfcp: IO stall after deleting and path checker changes after reenabling zfcp devices
  [SCSI] zfcp: avoid clutter in erp_dbf
  • Loading branch information
Linus Torvalds committed May 29, 2007
2 parents d5d4db7 + 05e9ebb commit a432663
Show file tree
Hide file tree
Showing 22 changed files with 206 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Who: Dan Dennedy <dan@dennedy.org>, Stefan Richter <stefanr@s5r6.in-berlin.de>
What: old NCR53C9x driver
When: October 2007
Why: Replaced by the much better esp_scsi driver. Actual low-level
driver can ported over almost trivially.
driver can be ported over almost trivially.
Who: David Miller <davem@davemloft.net>
Christoph Hellwig <hch@lst.de>

Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,7 @@ S: Maintained

MEGARAID SCSI DRIVERS
P: Neela Syam Kolli
M: Neela.Kolli@engenio.com
M: megaraidlinux@lsi.com
S: linux-scsi@vger.kernel.org
W: http://megaraid.lsilogic.com
S: Maintained
Expand Down
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ typedef struct _MPT_SAS_MGMT {
typedef struct _mpt_ioctl_events {
u32 event; /* Specified by define above */
u32 eventContext; /* Index or counter */
int data[2]; /* First 8 bytes of Event Data */
u32 data[2]; /* First 8 bytes of Event Data */
} MPT_IOCTL_EVENTS;

/*
Expand Down
8 changes: 4 additions & 4 deletions drivers/message/fusion/mptscsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -2463,11 +2463,11 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE;
ioc->events[idx].eventContext = ioc->eventContext;

ioc->events[idx].data[0] = (pReq->LUN[1] << 24) ||
(MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) ||
(sc->device->channel << 8) || sc->device->id;
ioc->events[idx].data[0] = (pReq->LUN[1] << 24) |
(MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) |
(sc->device->channel << 8) | sc->device->id;

ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12];
ioc->events[idx].data[1] = (sense_data[13] << 8) | sense_data[12];

ioc->eventContext++;
if (hd->ioc->pcidev->vendor ==
Expand Down
1 change: 1 addition & 0 deletions drivers/s390/scsi/zfcp_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
int retval = 0;
unsigned long flags;

zfcp_adapter_scsi_unregister(adapter);
device_unregister(&adapter->generic_services);
zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
dev_set_drvdata(&adapter->ccw_device->dev, NULL);
Expand Down
5 changes: 1 addition & 4 deletions drivers/s390/scsi/zfcp_ccw.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device)
* @ccw_device: pointer to belonging ccw device
*
* This function gets called by the common i/o layer and sets an adapter
* into state offline. Setting an fcp device offline means that it will be
* unregistered from the SCSI stack and that the adapter will be shut down
* asynchronously.
* into state offline.
*/
static int
zfcp_ccw_set_offline(struct ccw_device *ccw_device)
Expand All @@ -202,7 +200,6 @@ zfcp_ccw_set_offline(struct ccw_device *ccw_device)
adapter = dev_get_drvdata(&ccw_device->dev);
zfcp_erp_adapter_shutdown(adapter, 0);
zfcp_erp_wait(adapter);
zfcp_adapter_scsi_unregister(adapter);
zfcp_erp_thread_kill(adapter);
zfcp_adapter_debug_unregister(adapter);
up(&zfcp_data.config_sema);
Expand Down
40 changes: 13 additions & 27 deletions drivers/s390/scsi/zfcp_fsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,44 +156,30 @@ zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req)
kfree(fsf_req);
}

/**
* zfcp_fsf_req_dismiss - dismiss a single fsf request
*/
static void zfcp_fsf_req_dismiss(struct zfcp_adapter *adapter,
struct zfcp_fsf_req *fsf_req,
unsigned int counter)
{
u64 dbg_tmp[2];

dbg_tmp[0] = (u64) atomic_read(&adapter->reqs_active);
dbg_tmp[1] = (u64) counter;
debug_event(adapter->erp_dbf, 4, (void *) dbg_tmp, 16);
list_del(&fsf_req->list);
fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
zfcp_fsf_req_complete(fsf_req);
}

/**
* zfcp_fsf_req_dismiss_all - dismiss all remaining fsf requests
/*
* Never ever call this without shutting down the adapter first.
* Otherwise the adapter would continue using and corrupting s390 storage.
* Included BUG_ON() call to ensure this is done.
* ERP is supposed to be the only user of this function.
*/
void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
{
struct zfcp_fsf_req *request, *tmp;
struct zfcp_fsf_req *fsf_req, *tmp;
unsigned long flags;
LIST_HEAD(remove_queue);
unsigned int i, counter;
unsigned int i;

BUG_ON(atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status));
spin_lock_irqsave(&adapter->req_list_lock, flags);
atomic_set(&adapter->reqs_active, 0);
for (i=0; i<REQUEST_LIST_SIZE; i++)
for (i = 0; i < REQUEST_LIST_SIZE; i++)
list_splice_init(&adapter->req_list[i], &remove_queue);

spin_unlock_irqrestore(&adapter->req_list_lock, flags);

counter = 0;
list_for_each_entry_safe(request, tmp, &remove_queue, list) {
zfcp_fsf_req_dismiss(adapter, request, counter);
counter++;
list_for_each_entry_safe(fsf_req, tmp, &remove_queue, list) {
list_del(&fsf_req->list);
fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
zfcp_fsf_req_complete(fsf_req);
}
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/s390/scsi/zfcp_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,9 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
int retval = 0;
static unsigned int unique_id = 0;

if (adapter->scsi_host)
goto out;

/* register adapter as SCSI host with mid layer of SCSI stack */
adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template,
sizeof (struct zfcp_adapter *));
Expand Down
15 changes: 9 additions & 6 deletions drivers/scsi/aacraid/aachba.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ static char *aac_get_status_string(u32 status);
static int nondasd = -1;
static int dacmode = -1;

static int commit = -1;
int aac_commit = -1;
int startup_timeout = 180;
int aif_timeout = 120;

module_param(nondasd, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on");
module_param(dacmode, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on");
module_param(commit, int, S_IRUGO|S_IWUSR);
module_param_named(commit, aac_commit, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on");
module_param(startup_timeout, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for adapter to have it's kernel up and\nrunning. This is typically adjusted for large systems that do not have a BIOS.");
Expand All @@ -173,6 +173,9 @@ int expose_physicals = -1;
module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays. -1=protect 0=off, 1=on");

int aac_reset_devices = 0;
module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization.");

static inline int aac_valid_context(struct scsi_cmnd *scsicmd,
struct fib *fibptr) {
Expand Down Expand Up @@ -246,7 +249,7 @@ int aac_get_config_status(struct aac_dev *dev, int commit_flag)
aac_fib_complete(fibptr);
/* Send a CT_COMMIT_CONFIG to enable discovery of devices */
if (status >= 0) {
if ((commit == 1) || commit_flag) {
if ((aac_commit == 1) || commit_flag) {
struct aac_commit_config * dinfo;
aac_fib_init(fibptr);
dinfo = (struct aac_commit_config *) fib_data(fibptr);
Expand All @@ -261,7 +264,7 @@ int aac_get_config_status(struct aac_dev *dev, int commit_flag)
1, 1,
NULL, NULL);
aac_fib_complete(fibptr);
} else if (commit == 0) {
} else if (aac_commit == 0) {
printk(KERN_WARNING
"aac_get_config_status: Foreign device configurations are being ignored\n");
}
Expand Down Expand Up @@ -340,7 +343,7 @@ int aac_get_containers(struct aac_dev *dev)
static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigned int offset, unsigned int len)
{
void *buf;
unsigned int transfer_len;
int transfer_len;
struct scatterlist *sg = scsicmd->request_buffer;

if (scsicmd->use_sg) {
Expand All @@ -351,7 +354,7 @@ static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigne
transfer_len = min(scsicmd->request_bufflen, len + offset);
}
transfer_len -= offset;
if (buf && transfer_len)
if (buf && transfer_len > 0)
memcpy(buf + offset, data, transfer_len);

if (scsicmd->use_sg)
Expand Down
3 changes: 3 additions & 0 deletions drivers/scsi/aacraid/aacraid.h
Original file line number Diff line number Diff line change
Expand Up @@ -1823,9 +1823,12 @@ int aac_send_shutdown(struct aac_dev *dev);
int aac_probe_container(struct aac_dev *dev, int cid);
int _aac_rx_init(struct aac_dev *dev);
int aac_rx_select_comm(struct aac_dev *dev, int comm);
int aac_rx_deliver_producer(struct fib * fib);
extern int numacb;
extern int acbsize;
extern char aac_driver_version[];
extern int startup_timeout;
extern int aif_timeout;
extern int expose_physicals;
extern int aac_reset_devices;
extern int aac_commit;
8 changes: 6 additions & 2 deletions drivers/scsi/aacraid/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static int aac_rx_check_health(struct aac_dev *dev)
*
* Will send a fib, returning 0 if successful.
*/
static int aac_rx_deliver_producer(struct fib * fib)
int aac_rx_deliver_producer(struct fib * fib)
{
struct aac_dev *dev = fib->dev;
struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue];
Expand Down Expand Up @@ -488,6 +488,8 @@ static int aac_rx_restart_adapter(struct aac_dev *dev, int bled)
return -EINVAL;
if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC)
return -ENODEV;
if (startup_timeout < 300)
startup_timeout = 300;
return 0;
}

Expand Down Expand Up @@ -542,7 +544,7 @@ int _aac_rx_init(struct aac_dev *dev)
dev->a_ops.adapter_sync_cmd = rx_sync_cmd;
dev->a_ops.adapter_enable_int = aac_rx_disable_interrupt;
dev->OIMR = status = rx_readb (dev, MUnit.OIMR);
if ((((status & 0x0c) != 0x0c) || reset_devices) &&
if ((((status & 0x0c) != 0x0c) || aac_reset_devices || reset_devices) &&
!aac_rx_restart_adapter(dev, 0))
++restart;
/*
Expand Down Expand Up @@ -594,6 +596,8 @@ int _aac_rx_init(struct aac_dev *dev)
}
msleep(1);
}
if (restart)
aac_commit = 1;
/*
* Fill in the common function dispatch table.
*/
Expand Down
9 changes: 8 additions & 1 deletion drivers/scsi/aacraid/sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* based on the old aacraid driver that is..
* Adaptec aacraid device driver for Linux.
*
* Copyright (c) 2000 Adaptec, Inc. (aacraid@adaptec.com)
* Copyright (c) 2000-2007 Adaptec, Inc. (aacraid@adaptec.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -257,6 +257,11 @@ static void aac_sa_start_adapter(struct aac_dev *dev)
NULL, NULL, NULL, NULL, NULL);
}

static int aac_sa_restart_adapter(struct aac_dev *dev, int bled)
{
return -EINVAL;
}

/**
* aac_sa_check_health
* @dev: device to check if healthy
Expand Down Expand Up @@ -366,7 +371,9 @@ int aac_sa_init(struct aac_dev *dev)
dev->a_ops.adapter_notify = aac_sa_notify_adapter;
dev->a_ops.adapter_sync_cmd = sa_sync_cmd;
dev->a_ops.adapter_check_health = aac_sa_check_health;
dev->a_ops.adapter_restart = aac_sa_restart_adapter;
dev->a_ops.adapter_intr = aac_sa_intr;
dev->a_ops.adapter_deliver = aac_rx_deliver_producer;
dev->a_ops.adapter_ioremap = aac_sa_ioremap;

/*
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ static void make_expression(expression_t *immed, int value);
static void add_conditional(symbol_t *symbol);
static void add_version(const char *verstring);
static int is_download_const(expression_t *immed);
void yyerror(const char *string);

#define SRAM_SYMNAME "SRAM_BASE"
#define SCB_SYMNAME "SCB_BASE"
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
static symbol_t *macro_symbol;

static void add_macro_arg(const char *argtext, int position);
void mmerror(const char *string);

%}

Expand Down
14 changes: 10 additions & 4 deletions drivers/scsi/aic94xx/aic94xx_tmf.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ static void asd_tmf_tasklet_complete(struct asd_ascb *ascb,
static inline int asd_clear_nexus(struct sas_task *task)
{
int res = TMF_RESP_FUNC_FAILED;
int leftover;
struct asd_ascb *tascb = task->lldd_task;
unsigned long flags;

Expand All @@ -298,10 +299,12 @@ static inline int asd_clear_nexus(struct sas_task *task)
res = asd_clear_nexus_tag(task);
else
res = asd_clear_nexus_index(task);
wait_for_completion_timeout(&tascb->completion,
AIC94XX_SCB_TIMEOUT);
leftover = wait_for_completion_timeout(&tascb->completion,
AIC94XX_SCB_TIMEOUT);
ASD_DPRINTK("came back from clear nexus\n");
spin_lock_irqsave(&task->task_state_lock, flags);
if (leftover < 1)
res = TMF_RESP_FUNC_FAILED;
if (task->task_state_flags & SAS_TASK_STATE_DONE)
res = TMF_RESP_FUNC_COMPLETE;
spin_unlock_irqrestore(&task->task_state_lock, flags);
Expand Down Expand Up @@ -350,6 +353,7 @@ int asd_abort_task(struct sas_task *task)
unsigned long flags;
struct asd_ascb *ascb = NULL;
struct scb *scb;
int leftover;

spin_lock_irqsave(&task->task_state_lock, flags);
if (task->task_state_flags & SAS_TASK_STATE_DONE) {
Expand Down Expand Up @@ -455,9 +459,11 @@ int asd_abort_task(struct sas_task *task)
break;
case TF_TMF_TASK_DONE + 0xFF00: /* done but not reported yet */
res = TMF_RESP_FUNC_FAILED;
wait_for_completion_timeout(&tascb->completion,
AIC94XX_SCB_TIMEOUT);
leftover = wait_for_completion_timeout(&tascb->completion,
AIC94XX_SCB_TIMEOUT);
spin_lock_irqsave(&task->task_state_lock, flags);
if (leftover < 1)
res = TMF_RESP_FUNC_FAILED;
if (task->task_state_flags & SAS_TASK_STATE_DONE)
res = TMF_RESP_FUNC_COMPLETE;
spin_unlock_irqrestore(&task->task_state_lock, flags);
Expand Down
7 changes: 7 additions & 0 deletions drivers/scsi/ipr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3954,6 +3954,13 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
spin_unlock_irq(scsi_cmd->device->host->host_lock);
ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL);
spin_lock_irq(scsi_cmd->device->host->host_lock);

list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) {
rc = -EIO;
break;
}
}
} else
rc = ipr_device_reset(ioa_cfg, res);
res->resetting_device = 0;
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/libsrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd,

sg_init_one(&dummy, md, id->table_desc.len);
sg_dma_address(&dummy) = token;
sg_dma_len(&dummy) = id->table_desc.len;
err = rdma_io(sc, &dummy, 1, &id->table_desc, 1, DMA_TO_DEVICE,
id->table_desc.len);
if (err) {
Expand Down
Loading

0 comments on commit a432663

Please sign in to comment.