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: (40 commits)
  [SCSI] aic79xx: Print out signalling
  [SCSI] aic7xxx: Remove slave_destroy
  [SCSI] aic79xx: set precompensation
  [SCSI] aic79xx: Fixup external device reset
  [SCSI] replace u8 and u32 with __u8 and __u32 in scsi.h for user space
  [SCSI] lpfc: fix printk format warning
  [SCSI] aic79xx: make ahd_set_tags() static
  [SCSI] aic7xxx: cleanups
  [SCSI] drivers/scsi: Handcrafted MIN/MAX macro removal
  [SCSI] scsi_debug: support REPORT TARGET PORT GROUPS
  [SCSI] qla1280 bus reset typo
  [SCSI] libiscsi: fix logout pdu processing
  [SCSI] libiscsi: fix aen support
  [SCSI] libiscsi: fix missed iscsi_task_put in xmit error path
  [SCSI] libiscsi: fix oops in connection create failure path
  [SCSI] iscsi class: fix slab corruption during restart
  [SCSI] Switch fdomain to the pci_get API
  [SCSI] add can_queue to host parameters
  [SCSI] megaraid_{mm,mbox}: 64-bit DMA capability fix
  [SCSI] aic94xx: Supermicro motherboards support
  ...
  • Loading branch information
Linus Torvalds committed Oct 26, 2006
2 parents 9d81a78 + d6b9ccb commit 71fa0a8
Show file tree
Hide file tree
Showing 64 changed files with 1,010 additions and 874 deletions.
28 changes: 15 additions & 13 deletions drivers/fc4/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@

#define FCP_CMND(SCpnt) ((fcp_cmnd *)&(SCpnt->SCp))
#define FC_SCMND(SCpnt) ((fc_channel *)(SCpnt->device->host->hostdata[0]))
#define SC_FCMND(fcmnd) ((Scsi_Cmnd *)((long)fcmnd - (long)&(((Scsi_Cmnd *)0)->SCp)))
#define SC_FCMND(fcmnd) ((struct scsi_cmnd *)((long)fcmnd - (long)&(((struct scsi_cmnd *)0)->SCp)))

static int fcp_scsi_queue_it(fc_channel *, Scsi_Cmnd *, fcp_cmnd *, int);
static int fcp_scsi_queue_it(fc_channel *, struct scsi_cmnd *, fcp_cmnd *, int);
void fcp_queue_empty(fc_channel *);

static void fcp_scsi_insert_queue (fc_channel *fc, fcp_cmnd *fcmd)
Expand Down Expand Up @@ -378,14 +378,14 @@ void fcp_register(fc_channel *fc, u8 type, int unregister)
printk ("FC: %segistering unknown type %02x\n", unregister ? "Unr" : "R", type);
}

static void fcp_scsi_done(Scsi_Cmnd *SCpnt);
static void fcp_scsi_done(struct scsi_cmnd *SCpnt);

static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hdr *fch)
{
fcp_cmnd *fcmd;
fcp_rsp *rsp;
int host_status;
Scsi_Cmnd *SCpnt;
struct scsi_cmnd *SCpnt;
int sense_len;
int rsp_status;

Expand Down Expand Up @@ -757,13 +757,14 @@ void fcp_release(fc_channel *fcchain, int count) /* count must > 0 */
}


static void fcp_scsi_done (Scsi_Cmnd *SCpnt)
static void fcp_scsi_done(struct scsi_cmnd *SCpnt)
{
if (FCP_CMND(SCpnt)->done)
FCP_CMND(SCpnt)->done(SCpnt);
}

static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare)
static int fcp_scsi_queue_it(fc_channel *fc, struct scsi_cmnd *SCpnt,
fcp_cmnd *fcmd, int prepare)
{
long i;
fcp_cmd *cmd;
Expand Down Expand Up @@ -837,7 +838,8 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
return 0;
}

int fcp_scsi_queuecommand(Scsi_Cmnd *SCpnt, void (* done)(Scsi_Cmnd *))
int fcp_scsi_queuecommand(struct scsi_cmnd *SCpnt,
void (* done)(struct scsi_cmnd *))
{
fcp_cmnd *fcmd = FCP_CMND(SCpnt);
fc_channel *fc = FC_SCMND(SCpnt);
Expand Down Expand Up @@ -873,7 +875,7 @@ void fcp_queue_empty(fc_channel *fc)
}
}

int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
int fcp_scsi_abort(struct scsi_cmnd *SCpnt)
{
/* Internal bookkeeping only. Lose 1 cmd_slots slot. */
fcp_cmnd *fcmd = FCP_CMND(SCpnt);
Expand Down Expand Up @@ -910,7 +912,7 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
}

#if 0
void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
void fcp_scsi_reset_done(struct scsi_cmnd *SCpnt)
{
fc_channel *fc = FC_SCMND(SCpnt);

Expand All @@ -921,7 +923,7 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)

#define FCP_RESET_TIMEOUT (2*HZ)

int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
int fcp_scsi_dev_reset(struct scsi_cmnd *SCpnt)
{
#if 0 /* broken junk, but if davem wants to compile this driver, let him.. */
unsigned long flags;
Expand All @@ -931,7 +933,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
DECLARE_MUTEX_LOCKED(sem);

if (!fc->rst_pkt) {
fc->rst_pkt = (Scsi_Cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL);
fc->rst_pkt = (struct scsi_cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL);
if (!fc->rst_pkt) return FAILED;

fcmd = FCP_CMND(fc->rst_pkt);
Expand Down Expand Up @@ -999,7 +1001,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
return SUCCESS;
}

static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
static int __fcp_scsi_host_reset(struct scsi_cmnd *SCpnt)
{
fc_channel *fc = FC_SCMND(SCpnt);
fcp_cmnd *fcmd = FCP_CMND(SCpnt);
Expand All @@ -1020,7 +1022,7 @@ static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
else return FAILED;
}

int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
int fcp_scsi_host_reset(struct scsi_cmnd *SCpnt)
{
unsigned long flags;
int rc;
Expand Down
15 changes: 8 additions & 7 deletions drivers/fc4/fcp_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct _fc_channel;
typedef struct fcp_cmnd {
struct fcp_cmnd *next;
struct fcp_cmnd *prev;
void (*done)(Scsi_Cmnd *);
void (*done)(struct scsi_cmnd *);
unsigned short proto;
unsigned short token;
unsigned int did;
Expand Down Expand Up @@ -94,14 +94,14 @@ typedef struct _fc_channel {
long *scsi_bitmap;
long scsi_bitmap_end;
int scsi_free;
int (*encode_addr)(Scsi_Cmnd *, u16 *, struct _fc_channel *, fcp_cmnd *);
int (*encode_addr)(struct scsi_cmnd *, u16 *, struct _fc_channel *, fcp_cmnd *);
fcp_cmnd *scsi_que;
char scsi_name[4];
fcp_cmnd **cmd_slots;
int channels;
int targets;
long *ages;
Scsi_Cmnd *rst_pkt;
struct scsi_cmnd *rst_pkt;
fcp_posmap *posmap;
/* LOGIN stuff */
fcp_cmnd *login;
Expand Down Expand Up @@ -155,9 +155,10 @@ int fc_do_prli(fc_channel *, unsigned char);
for_each_fc_channel(fc) \
if (fc->state == FC_STATE_ONLINE)

int fcp_scsi_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
int fcp_scsi_abort(Scsi_Cmnd *);
int fcp_scsi_dev_reset(Scsi_Cmnd *);
int fcp_scsi_host_reset(Scsi_Cmnd *);
int fcp_scsi_queuecommand(struct scsi_cmnd *,
void (* done) (struct scsi_cmnd *));
int fcp_scsi_abort(struct scsi_cmnd *);
int fcp_scsi_dev_reset(struct scsi_cmnd *);
int fcp_scsi_host_reset(struct scsi_cmnd *);

#endif /* !(_FCP_SCSI_H) */
4 changes: 2 additions & 2 deletions drivers/message/fusion/mptbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR
#endif

#define MPT_LINUX_VERSION_COMMON "3.04.01"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.01"
#define MPT_LINUX_VERSION_COMMON "3.04.02"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.02"
#define WHAT_MAGIC_STRING "@" "(" "#" ")"

#define show_mptmod_ver(s,ver) \
Expand Down
89 changes: 85 additions & 4 deletions drivers/message/fusion/mptfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ static int mptfc_qcmd(struct scsi_cmnd *SCpnt,
static void mptfc_target_destroy(struct scsi_target *starget);
static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
static void __devexit mptfc_remove(struct pci_dev *pdev);
static int mptfc_abort(struct scsi_cmnd *SCpnt);
static int mptfc_dev_reset(struct scsi_cmnd *SCpnt);
static int mptfc_bus_reset(struct scsi_cmnd *SCpnt);
static int mptfc_host_reset(struct scsi_cmnd *SCpnt);

static struct scsi_host_template mptfc_driver_template = {
.module = THIS_MODULE,
Expand All @@ -110,10 +114,10 @@ static struct scsi_host_template mptfc_driver_template = {
.target_destroy = mptfc_target_destroy,
.slave_destroy = mptscsih_slave_destroy,
.change_queue_depth = mptscsih_change_queue_depth,
.eh_abort_handler = mptscsih_abort,
.eh_device_reset_handler = mptscsih_dev_reset,
.eh_bus_reset_handler = mptscsih_bus_reset,
.eh_host_reset_handler = mptscsih_host_reset,
.eh_abort_handler = mptfc_abort,
.eh_device_reset_handler = mptfc_dev_reset,
.eh_bus_reset_handler = mptfc_bus_reset,
.eh_host_reset_handler = mptfc_host_reset,
.bios_param = mptscsih_bios_param,
.can_queue = MPT_FC_CAN_QUEUE,
.this_id = -1,
Expand Down Expand Up @@ -171,6 +175,77 @@ static struct fc_function_template mptfc_transport_functions = {
.show_host_symbolic_name = 1,
};

static int
mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
int (*func)(struct scsi_cmnd *SCpnt),
const char *caller)
{
struct scsi_device *sdev = SCpnt->device;
struct Scsi_Host *shost = sdev->host;
struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
unsigned long flags;
int ready;

spin_lock_irqsave(shost->host_lock, flags);
while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) {
spin_unlock_irqrestore(shost->host_lock, flags);
dfcprintk ((MYIOC_s_INFO_FMT
"mptfc_block_error_handler.%d: %d:%d, port status is "
"DID_IMM_RETRY, deferring %s recovery.\n",
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
SCpnt->device->id,SCpnt->device->lun,caller));
msleep(1000);
spin_lock_irqsave(shost->host_lock, flags);
}
spin_unlock_irqrestore(shost->host_lock, flags);

if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) {
dfcprintk ((MYIOC_s_INFO_FMT
"%s.%d: %d:%d, failing recovery, "
"port state %d, vdev %p.\n", caller,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
SCpnt->device->id,SCpnt->device->lun,ready,
SCpnt->device->hostdata));
return FAILED;
}
dfcprintk ((MYIOC_s_INFO_FMT
"%s.%d: %d:%d, executing recovery.\n", caller,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
SCpnt->device->id,SCpnt->device->lun));
return (*func)(SCpnt);
}

static int
mptfc_abort(struct scsi_cmnd *SCpnt)
{
return
mptfc_block_error_handler(SCpnt, mptscsih_abort, __FUNCTION__);
}

static int
mptfc_dev_reset(struct scsi_cmnd *SCpnt)
{
return
mptfc_block_error_handler(SCpnt, mptscsih_dev_reset, __FUNCTION__);
}

static int
mptfc_bus_reset(struct scsi_cmnd *SCpnt)
{
return
mptfc_block_error_handler(SCpnt, mptscsih_bus_reset, __FUNCTION__);
}

static int
mptfc_host_reset(struct scsi_cmnd *SCpnt)
{
return
mptfc_block_error_handler(SCpnt, mptscsih_host_reset, __FUNCTION__);
}

static void
mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
{
Expand Down Expand Up @@ -562,6 +637,12 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
return 0;
}

if (!SCpnt->device->hostdata) { /* vdev */
SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt);
return 0;
}

/* dd_data is null until finished adding target */
ri = *((struct mptfc_rport_info **)rport->dd_data);
if (unlikely(!ri)) {
Expand Down
4 changes: 4 additions & 0 deletions drivers/s390/scsi/zfcp_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ zfcp_address_to_sg(void *address, struct scatterlist *list)
(ZFCP_MAX_SBALS_PER_REQ * ZFCP_MAX_SBALES_PER_SBAL - 2)
/* request ID + QTCB in SBALE 0 + 1 of first SBAL in chain */

#define ZFCP_MAX_SECTORS (ZFCP_MAX_SBALES_PER_REQ * 8)
/* max. number of (data buffer) SBALEs in largest SBAL chain
multiplied with number of sectors per 4k block */

/* FIXME(tune): free space should be one max. SBAL chain plus what? */
#define ZFCP_QDIO_PCI_INTERVAL (QDIO_MAX_BUFFERS_PER_Q \
- (ZFCP_MAX_SBALS_PER_REQ + 4))
Expand Down
1 change: 1 addition & 0 deletions drivers/s390/scsi/zfcp_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct zfcp_data zfcp_data = {
.cmd_per_lun = 1,
.use_clustering = 1,
.sdev_attrs = zfcp_sysfs_sdev_attrs,
.max_sectors = ZFCP_MAX_SECTORS,
},
.driver_version = ZFCP_VERSION,
};
Expand Down
Loading

0 comments on commit 71fa0a8

Please sign in to comment.