Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71fa0a84 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* 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
  ...
parents 9d81a782 d6b9ccbb
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -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)
@@ -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;

@@ -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;
@@ -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);
@@ -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);
@@ -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);

@@ -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;
@@ -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);
@@ -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);
@@ -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;
+8 −7
Original line number Diff line number Diff line
@@ -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;
@@ -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;
@@ -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) */
+2 −2
Original line number Diff line number Diff line
@@ -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)  \
+85 −4
Original line number Diff line number Diff line
@@ -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,
@@ -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,
@@ -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)
{
@@ -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)) {
+4 −0
Original line number Diff line number Diff line
@@ -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))
Loading