Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixe…
Browse files Browse the repository at this point in the history
…s-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] dpt_i2o: fix transferred data length for scsi_set_resid()
  [SCSI] scsi_error regression: Fix idempotent command handling
  [SCSI] zfcp: Fix hexdump data in s390dbf traces
  [SCSI] zfcp: fix erp timeout cleanup for port open requests
  [SCSI] zfcp: Wait for port scan to complete when setting adapter online
  [SCSI] zfcp: Fix cast warning
  [SCSI] zfcp: Fix request list handling in error path
  [SCSI] zfcp: fix mempool usage for status_read requests
  [SCSI] zfcp: fix req_list_locking.
  [SCSI] zfcp: Dont clear reference from SCSI device to unit
  [SCSI] qla2xxx: Update version number to 8.02.01-k9.
  [SCSI] qla2xxx: Return a FAILED status when abort mailbox-command fails.
  [SCSI] qla2xxx: Do not honour max_vports from firmware for 2G ISPs and below.
  [SCSI] qla2xxx: Use pci_disable_rom() to manipulate PCI config space.
  [SCSI] qla2xxx: Correct Atmel flash-part handling.
  [SCSI] megaraid: fix mega_internal_command oops
  • Loading branch information
torvalds committed Nov 15, 2008
2 parents 52168e6 + df81d23 commit c98114d
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 99 deletions.
3 changes: 2 additions & 1 deletion drivers/s390/scsi/zfcp_aux.c
Expand Up @@ -610,7 +610,8 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status);
atomic_set(&port->refcount, 0);

dev_set_name(&port->sysfs_device, "0x%016llx", wwpn);
dev_set_name(&port->sysfs_device, "0x%016llx",
(unsigned long long)wwpn);
port->sysfs_device.parent = &adapter->ccw_device->dev;

port->sysfs_device.release = zfcp_sysfs_port_release;
Expand Down
4 changes: 3 additions & 1 deletion drivers/s390/scsi/zfcp_ccw.c
Expand Up @@ -116,7 +116,9 @@ static int zfcp_ccw_set_online(struct ccw_device *ccw_device)
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85,
NULL);
zfcp_erp_wait(adapter);
goto out;
up(&zfcp_data.config_sema);
flush_work(&adapter->scan_work);
return 0;

out_scsi_register:
zfcp_erp_thread_kill(adapter);
Expand Down
42 changes: 16 additions & 26 deletions drivers/s390/scsi/zfcp_dbf.c
Expand Up @@ -30,7 +30,7 @@ static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len,
dump->offset = offset;
dump->size = min(from_len - offset, room);
memcpy(dump->data, from + offset, dump->size);
debug_event(dbf, level, dump, dump->size);
debug_event(dbf, level, dump, dump->size + sizeof(*dump));
}
}

Expand Down Expand Up @@ -108,7 +108,7 @@ static int zfcp_dbf_view_header(debug_info_t *id, struct debug_view *view,
t.tv_sec, t.tv_nsec);
zfcp_dbf_out(&p, "cpu", "%02i", entry->id.fields.cpuid);
} else {
zfcp_dbf_outd(&p, NULL, dump->data, dump->size, dump->offset,
zfcp_dbf_outd(&p, "", dump->data, dump->size, dump->offset,
dump->total_size);
if ((dump->offset + dump->size) == dump->total_size)
p += sprintf(p, "\n");
Expand Down Expand Up @@ -366,6 +366,7 @@ static void zfcp_hba_dbf_view_response(char **p,
break;
zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd);
zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial);
p += sprintf(*p, "\n");
break;

case FSF_QTCB_OPEN_PORT_WITH_DID:
Expand Down Expand Up @@ -465,7 +466,8 @@ static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view,
else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0)
zfcp_hba_dbf_view_berr(&p, &r->u.berr);

p += sprintf(p, "\n");
if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) != 0)
p += sprintf(p, "\n");
return p - out_buf;
}

Expand Down Expand Up @@ -880,6 +882,7 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
struct ct_hdr *hdr = sg_virt(ct->req);
struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf;
struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req;
int level = 3;
unsigned long flags;

spin_lock_irqsave(&adapter->san_dbf_lock, flags);
Expand All @@ -896,9 +899,10 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
oct->options = hdr->options;
oct->max_res_size = hdr->max_res_size;
oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr),
ZFCP_DBF_CT_PAYLOAD);
memcpy(oct->payload, (void *)hdr + sizeof(struct ct_hdr), oct->len);
debug_event(adapter->san_dbf, 3, r, sizeof(*r));
ZFCP_DBF_SAN_MAX_PAYLOAD);
debug_event(adapter->san_dbf, level, r, sizeof(*r));
zfcp_dbf_hexdump(adapter->san_dbf, r, sizeof(*r), level,
(void *)hdr + sizeof(struct ct_hdr), oct->len);
spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
}

Expand All @@ -914,6 +918,7 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
struct ct_hdr *hdr = sg_virt(ct->resp);
struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf;
struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp;
int level = 3;
unsigned long flags;

spin_lock_irqsave(&adapter->san_dbf_lock, flags);
Expand All @@ -929,9 +934,10 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
rct->expl = hdr->reason_code_expl;
rct->vendor_unique = hdr->vendor_unique;
rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr),
ZFCP_DBF_CT_PAYLOAD);
memcpy(rct->payload, (void *)hdr + sizeof(struct ct_hdr), rct->len);
debug_event(adapter->san_dbf, 3, r, sizeof(*r));
ZFCP_DBF_SAN_MAX_PAYLOAD);
debug_event(adapter->san_dbf, level, r, sizeof(*r));
zfcp_dbf_hexdump(adapter->san_dbf, r, sizeof(*r), level,
(void *)hdr + sizeof(struct ct_hdr), rct->len);
spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
}

Expand All @@ -954,7 +960,7 @@ static void zfcp_san_dbf_event_els(const char *tag, int level,
rec->u.els.ls_code = ls_code;
debug_event(adapter->san_dbf, level, rec, sizeof(*rec));
zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level,
buffer, min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD));
buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD));
spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
}

Expand Down Expand Up @@ -1008,8 +1014,6 @@ static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view,
char *out_buf, const char *in_buf)
{
struct zfcp_san_dbf_record *r = (struct zfcp_san_dbf_record *)in_buf;
char *buffer = NULL;
int buflen = 0, total = 0;
char *p = out_buf;

if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
Expand All @@ -1029,33 +1033,19 @@ static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view,
zfcp_dbf_out(&p, "gs_subtype", "0x%02x", ct->gs_subtype);
zfcp_dbf_out(&p, "options", "0x%02x", ct->options);
zfcp_dbf_out(&p, "max_res_size", "0x%04x", ct->max_res_size);
total = ct->len;
buffer = ct->payload;
buflen = min(total, ZFCP_DBF_CT_PAYLOAD);
} else if (strncmp(r->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) {
struct zfcp_san_dbf_record_ct_response *ct = &r->u.ct_resp;
zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", ct->cmd_rsp_code);
zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision);
zfcp_dbf_out(&p, "reason_code", "0x%02x", ct->reason_code);
zfcp_dbf_out(&p, "reason_code_expl", "0x%02x", ct->expl);
zfcp_dbf_out(&p, "vendor_unique", "0x%02x", ct->vendor_unique);
total = ct->len;
buffer = ct->payload;
buflen = min(total, ZFCP_DBF_CT_PAYLOAD);
} else if (strncmp(r->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 ||
strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 ||
strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) {
struct zfcp_san_dbf_record_els *els = &r->u.els;
zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code);
total = els->len;
buffer = els->payload;
buflen = min(total, ZFCP_DBF_ELS_PAYLOAD);
}

zfcp_dbf_outd(&p, "payload", buffer, buflen, 0, total);
if (buflen == total)
p += sprintf(p, "\n");

return p - out_buf;
}

Expand Down
8 changes: 2 additions & 6 deletions drivers/s390/scsi/zfcp_dbf.h
Expand Up @@ -163,8 +163,6 @@ struct zfcp_san_dbf_record_ct_request {
u8 options;
u16 max_res_size;
u32 len;
#define ZFCP_DBF_CT_PAYLOAD 24
u8 payload[ZFCP_DBF_CT_PAYLOAD];
} __attribute__ ((packed));

struct zfcp_san_dbf_record_ct_response {
Expand All @@ -174,15 +172,11 @@ struct zfcp_san_dbf_record_ct_response {
u8 expl;
u8 vendor_unique;
u32 len;
u8 payload[ZFCP_DBF_CT_PAYLOAD];
} __attribute__ ((packed));

struct zfcp_san_dbf_record_els {
u8 ls_code;
u32 len;
#define ZFCP_DBF_ELS_PAYLOAD 32
#define ZFCP_DBF_ELS_MAX_PAYLOAD 1024
u8 payload[ZFCP_DBF_ELS_PAYLOAD];
} __attribute__ ((packed));

struct zfcp_san_dbf_record {
Expand All @@ -196,6 +190,8 @@ struct zfcp_san_dbf_record {
struct zfcp_san_dbf_record_ct_response ct_resp;
struct zfcp_san_dbf_record_els els;
} u;
#define ZFCP_DBF_SAN_MAX_PAYLOAD 1024
u8 payload[32];
} __attribute__ ((packed));

struct zfcp_scsi_dbf_record {
Expand Down
1 change: 1 addition & 0 deletions drivers/s390/scsi/zfcp_erp.c
Expand Up @@ -472,6 +472,7 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act)
ZFCP_STATUS_ERP_TIMEDOUT)) {
act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
zfcp_rec_dbf_event_action(142, act);
act->fsf_req->erp_action = NULL;
}
if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
zfcp_rec_dbf_event_action(143, act);
Expand Down
23 changes: 10 additions & 13 deletions drivers/s390/scsi/zfcp_fsf.c
Expand Up @@ -683,6 +683,7 @@ static struct zfcp_fsf_req *zfcp_fsf_alloc_noqtcb(mempool_t *pool)
if (!req)
return NULL;
memset(req, 0, sizeof(*req));
req->pool = pool;
return req;
}

Expand Down Expand Up @@ -769,28 +770,24 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_adapter *adapter,
static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
{
struct zfcp_adapter *adapter = req->adapter;
struct zfcp_qdio_queue *req_q = &adapter->req_q;
unsigned long flags;
int idx;

/* put allocated FSF request into hash table */
spin_lock(&adapter->req_list_lock);
spin_lock_irqsave(&adapter->req_list_lock, flags);
idx = zfcp_reqlist_hash(req->req_id);
list_add_tail(&req->list, &adapter->req_list[idx]);
spin_unlock(&adapter->req_list_lock);
spin_unlock_irqrestore(&adapter->req_list_lock, flags);

req->qdio_outb_usage = atomic_read(&req_q->count);
req->qdio_outb_usage = atomic_read(&adapter->req_q.count);
req->issued = get_clock();
if (zfcp_qdio_send(req)) {
/* Queues are down..... */
del_timer(&req->timer);
spin_lock(&adapter->req_list_lock);
zfcp_reqlist_remove(adapter, req);
spin_unlock(&adapter->req_list_lock);
/* undo changes in request queue made for this request */
atomic_add(req->sbal_number, &req_q->count);
req_q->first -= req->sbal_number;
req_q->first += QDIO_MAX_BUFFERS_PER_Q;
req_q->first %= QDIO_MAX_BUFFERS_PER_Q; /* wrap */
spin_lock_irqsave(&adapter->req_list_lock, flags);
/* lookup request again, list might have changed */
if (zfcp_reqlist_find_safe(adapter, req))
zfcp_reqlist_remove(adapter, req);
spin_unlock_irqrestore(&adapter->req_list_lock, flags);
zfcp_erp_adapter_reopen(adapter, 0, 116, req);
return -EIO;
}
Expand Down
12 changes: 4 additions & 8 deletions drivers/s390/scsi/zfcp_scsi.c
Expand Up @@ -24,14 +24,10 @@ char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu)
static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
{
struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
WARN_ON(!unit);
if (unit) {
atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
sdpnt->hostdata = NULL;
unit->device = NULL;
zfcp_erp_unit_failed(unit, 12, NULL);
zfcp_unit_put(unit);
}
atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
unit->device = NULL;
zfcp_erp_unit_failed(unit, 12, NULL);
zfcp_unit_put(unit);
}

static int zfcp_scsi_slave_configure(struct scsi_device *sdp)
Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/dpt_i2o.c
Expand Up @@ -2445,7 +2445,7 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
hba_status = detailed_status >> 8;

// calculate resid for sg
scsi_set_resid(cmd, scsi_bufflen(cmd) - readl(reply+5));
scsi_set_resid(cmd, scsi_bufflen(cmd) - readl(reply+20));

pHba = (adpt_hba*) cmd->device->host->hostdata[0];

Expand All @@ -2456,7 +2456,7 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
case I2O_SCSI_DSC_SUCCESS:
cmd->result = (DID_OK << 16);
// handle underflow
if(readl(reply+5) < cmd->underflow ) {
if (readl(reply+20) < cmd->underflow) {
cmd->result = (DID_ERROR <<16);
printk(KERN_WARNING"%s: SCSI CMD underflow\n",pHba->name);
}
Expand Down
11 changes: 8 additions & 3 deletions drivers/scsi/megaraid.c
Expand Up @@ -4402,6 +4402,10 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
scb_t *scb;
int rval;

scmd = scsi_allocate_command(GFP_KERNEL);
if (!scmd)
return -ENOMEM;

/*
* The internal commands share one command id and hence are
* serialized. This is so because we want to reserve maximum number of
Expand All @@ -4412,12 +4416,11 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
scb = &adapter->int_scb;
memset(scb, 0, sizeof(scb_t));

scmd = &adapter->int_scmd;
memset(scmd, 0, sizeof(Scsi_Cmnd));

sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
scmd->device = sdev;

memset(adapter->int_cdb, 0, sizeof(adapter->int_cdb));
scmd->cmnd = adapter->int_cdb;
scmd->device->host = adapter->host;
scmd->host_scribble = (void *)scb;
scmd->cmnd[0] = MEGA_INTERNAL_CMD;
Expand Down Expand Up @@ -4456,6 +4459,8 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)

mutex_unlock(&adapter->int_mtx);

scsi_free_command(GFP_KERNEL, scmd);

return rval;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/megaraid.h
Expand Up @@ -888,8 +888,8 @@ typedef struct {

u8 sglen; /* f/w supported scatter-gather list length */

unsigned char int_cdb[MAX_COMMAND_SIZE];
scb_t int_scb;
Scsi_Cmnd int_scmd;
struct mutex int_mtx; /* To synchronize the internal
commands */
struct completion int_waitq; /* wait queue for internal
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/qla2xxx/qla_def.h
Expand Up @@ -2547,7 +2547,6 @@ typedef struct scsi_qla_host {
uint8_t fcode_revision[16];
uint32_t fw_revision[4];

uint16_t fdt_odd_index;
uint32_t fdt_wrt_disable;
uint32_t fdt_erase_cmd;
uint32_t fdt_block_size;
Expand Down

0 comments on commit c98114d

Please sign in to comment.