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

Commit 6ec129c3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (58 commits)
  [SCSI] zfcp: clear boxed flag on unit reopen.
  [SCSI] zfcp: clear adapter failed flag if an fsf request times out.
  [SCSI] zfcp: rework request ID management.
  [SCSI] zfcp: Fix deadlock between zfcp ERP and SCSI
  [SCSI] zfcp: Locking for req_no and req_seq_no
  [SCSI] zfcp: print S_ID and D_ID with 3 bytes
  [SCSI] ipr: Use PCI-E reset API for new ipr adapter
  [SCSI] qla2xxx: Update version number to 8.01.07-k7.
  [SCSI] qla2xxx: Add MSI support.
  [SCSI] qla2xxx: Correct pci_set_msi() usage semantics.
  [SCSI] qla2xxx: Attempt to stop firmware only if it had been previously executed.
  [SCSI] qla2xxx: Honor NVRAM port-down-retry-count settings.
  [SCSI] qla2xxx: Error-out during probe() if we're unable to complete HBA initialization.
  [SCSI] zfcp: Stop system after memory corruption
  [SCSI] mesh: cleanup variable usage in interrupt handler
  [SCSI] megaraid: replace yield() with cond_resched()
  [SCSI] megaraid: fix warnings when CONFIG_PROC_FS=n
  [SCSI] aacraid: correct SUN products to README
  [SCSI] aacraid: superfluous adapter reset for IBM 8 series ServeRAID controllers
  [SCSI] aacraid: kexec fix (reset interrupt handler)
  ...
parents 01e73be3 b64ddf96
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -59,6 +59,15 @@ 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.
Who:	David Miller <davem@davemloft.net>
	Christoph Hellwig <hch@lst.de>

---------------------------

What:	Video4Linux API 1 ioctls and video_decoder.h from Video devices.
When:	December 2006
Why:	V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6
+2 −2
Original line number Diff line number Diff line
@@ -98,8 +98,8 @@ Supported Cards/Chipsets
	9005:0285:9005:02b0		(Sunrise Lake ARK)
	9005:0285:9005:02b1	Adaptec	(Voodoo 8 internal 8 external)
	9005:0285:108e:7aac	SUN	STK RAID REM (Voodoo44 Coyote)
	9005:0285:108e:0286	SUN	SG-XPCIESAS-R-IN (Cougar)
	9005:0285:108e:0287	SUN	SG-XPCIESAS-R-EX (Prometheus)
	9005:0285:108e:0286	SUN	STK RAID INT (Cougar)
	9005:0285:108e:0287	SUN	STK RAID EXT (Prometheus)

People
-------------------------
+14 −76
Original line number Diff line number Diff line
@@ -118,97 +118,32 @@ _zfcp_hex_dump(char *addr, int count)

#define ZFCP_LOG_AREA			ZFCP_LOG_AREA_FSF

static int zfcp_reqlist_init(struct zfcp_adapter *adapter)
static int zfcp_reqlist_alloc(struct zfcp_adapter *adapter)
{
	int i;
	int idx;

	adapter->req_list = kcalloc(REQUEST_LIST_SIZE, sizeof(struct list_head),
				    GFP_KERNEL);

	if (!adapter->req_list)
		return -ENOMEM;

	for (i=0; i<REQUEST_LIST_SIZE; i++)
		INIT_LIST_HEAD(&adapter->req_list[i]);

	for (idx = 0; idx < REQUEST_LIST_SIZE; idx++)
		INIT_LIST_HEAD(&adapter->req_list[idx]);
	return 0;
}

static void zfcp_reqlist_free(struct zfcp_adapter *adapter)
{
	struct zfcp_fsf_req *request, *tmp;
	unsigned int i;

	for (i=0; i<REQUEST_LIST_SIZE; i++) {
		if (list_empty(&adapter->req_list[i]))
			continue;

		list_for_each_entry_safe(request, tmp,
					 &adapter->req_list[i], list)
			list_del(&request->list);
	}

	kfree(adapter->req_list);
}

void zfcp_reqlist_add(struct zfcp_adapter *adapter,
		      struct zfcp_fsf_req *fsf_req)
{
	unsigned int i;

	i = fsf_req->req_id % REQUEST_LIST_SIZE;
	list_add_tail(&fsf_req->list, &adapter->req_list[i]);
}

void zfcp_reqlist_remove(struct zfcp_adapter *adapter, unsigned long req_id)
{
	struct zfcp_fsf_req *request, *tmp;
	unsigned int i, counter;
	u64 dbg_tmp[2];

	i = req_id % REQUEST_LIST_SIZE;
	BUG_ON(list_empty(&adapter->req_list[i]));

	counter = 0;
	list_for_each_entry_safe(request, tmp, &adapter->req_list[i], list) {
		if (request->req_id == req_id) {
			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(&request->list);
			break;
		}
		counter++;
	}
}

struct zfcp_fsf_req *zfcp_reqlist_ismember(struct zfcp_adapter *adapter,
					   unsigned long req_id)
{
	struct zfcp_fsf_req *request, *tmp;
	unsigned int i;

	/* 0 is reserved as an invalid req_id */
	if (req_id == 0)
		return NULL;

	i = req_id % REQUEST_LIST_SIZE;

	list_for_each_entry_safe(request, tmp, &adapter->req_list[i], list)
		if (request->req_id == req_id)
			return request;

	return NULL;
}

int zfcp_reqlist_isempty(struct zfcp_adapter *adapter)
{
	unsigned int i;
	unsigned int idx;

	for (i=0; i<REQUEST_LIST_SIZE; i++)
		if (!list_empty(&adapter->req_list[i]))
	for (idx = 0; idx < REQUEST_LIST_SIZE; idx++)
		if (!list_empty(&adapter->req_list[idx]))
			return 0;

	return 1;
}

@@ -913,6 +848,8 @@ zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun)
	unit->sysfs_device.release = zfcp_sysfs_unit_release;
	dev_set_drvdata(&unit->sysfs_device, unit);

	init_waitqueue_head(&unit->scsi_scan_wq);

	/* mark unit unusable as long as sysfs registration is not complete */
	atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status);

@@ -1104,7 +1041,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)

	/* initialize list of fsf requests */
	spin_lock_init(&adapter->req_list_lock);
	retval = zfcp_reqlist_init(adapter);
	retval = zfcp_reqlist_alloc(adapter);
	if (retval) {
		ZFCP_LOG_INFO("request list initialization failed\n");
		goto failed_low_mem_buffers;
@@ -1165,6 +1102,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
	zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
 sysfs_failed:
	dev_set_drvdata(&ccw_device->dev, NULL);
	zfcp_reqlist_free(adapter);
 failed_low_mem_buffers:
	zfcp_free_low_mem_buffers(adapter);
	if (qdio_free(ccw_device) != 0)
@@ -1497,7 +1435,7 @@ zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter,

	if (!port || (port->wwpn != (*(wwn_t *) &els_plogi->serv_param.wwpn))) {
		ZFCP_LOG_DEBUG("ignored incoming PLOGI for nonexisting port "
			       "with d_id 0x%08x on adapter %s\n",
			       "with d_id 0x%06x on adapter %s\n",
			       status_buffer->d_id,
			       zfcp_get_busid_by_adapter(adapter));
	} else {
@@ -1522,7 +1460,7 @@ zfcp_fsf_incoming_els_logo(struct zfcp_adapter *adapter,

	if (!port || (port->wwpn != els_logo->nport_wwpn)) {
		ZFCP_LOG_DEBUG("ignored incoming LOGO for nonexisting port "
			       "with d_id 0x%08x on adapter %s\n",
			       "with d_id 0x%06x on adapter %s\n",
			       status_buffer->d_id,
			       zfcp_get_busid_by_adapter(adapter));
	} else {
@@ -1704,7 +1642,7 @@ static void zfcp_ns_gid_pn_handler(unsigned long data)
	/* looks like a valid d_id */
        port->d_id = ct_iu_resp->d_id & ZFCP_DID_MASK;
	atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status);
	ZFCP_LOG_DEBUG("adapter %s:  wwpn=0x%016Lx ---> d_id=0x%08x\n",
	ZFCP_LOG_DEBUG("adapter %s:  wwpn=0x%016Lx ---> d_id=0x%06x\n",
		       zfcp_get_busid_by_port(port), port->wwpn, port->d_id);
	goto out;

+41 −0
Original line number Diff line number Diff line
@@ -637,6 +637,7 @@ do { \
#define ZFCP_STATUS_UNIT_SHARED			0x00000004
#define ZFCP_STATUS_UNIT_READONLY		0x00000008
#define ZFCP_STATUS_UNIT_REGISTERED		0x00000010
#define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING	0x00000020

/* FSF request status (this does not have a common part) */
#define ZFCP_STATUS_FSFREQ_NOT_INIT		0x00000000
@@ -980,6 +981,10 @@ struct zfcp_unit {
        struct scsi_device     *device;        /* scsi device struct pointer */
	struct zfcp_erp_action erp_action;     /* pending error recovery */
        atomic_t               erp_counter;
	wait_queue_head_t      scsi_scan_wq;   /* can be used to wait until
						  all scsi_scan_target
						  requests have been
						  completed. */
};

/* FSF request */
@@ -1084,6 +1089,42 @@ extern void _zfcp_hex_dump(char *, int);
#define zfcp_get_busid_by_port(port) (zfcp_get_busid_by_adapter(port->adapter))
#define zfcp_get_busid_by_unit(unit) (zfcp_get_busid_by_port(unit->port))

/*
 * Helper functions for request ID management.
 */
static inline int zfcp_reqlist_hash(unsigned long req_id)
{
	return req_id % REQUEST_LIST_SIZE;
}

static inline void zfcp_reqlist_add(struct zfcp_adapter *adapter,
				    struct zfcp_fsf_req *fsf_req)
{
	unsigned int idx;

	idx = zfcp_reqlist_hash(fsf_req->req_id);
	list_add_tail(&fsf_req->list, &adapter->req_list[idx]);
}

static inline void zfcp_reqlist_remove(struct zfcp_adapter *adapter,
				       struct zfcp_fsf_req *fsf_req)
{
	list_del(&fsf_req->list);
}

static inline struct zfcp_fsf_req *
zfcp_reqlist_find(struct zfcp_adapter *adapter, unsigned long req_id)
{
	struct zfcp_fsf_req *request;
	unsigned int idx;

	idx = zfcp_reqlist_hash(req_id);
	list_for_each_entry(request, &adapter->req_list[idx], list)
		if (request->req_id == req_id)
			return request;
	return NULL;
}

/*
 *  functions needed for reference/usage counting
 */
+72 −17
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ static void zfcp_close_fsf(struct zfcp_adapter *adapter)
static void zfcp_fsf_request_timeout_handler(unsigned long data)
{
	struct zfcp_adapter *adapter = (struct zfcp_adapter *) data;
	zfcp_erp_adapter_reopen(adapter, 0);
	zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
}

void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, unsigned long timeout)
@@ -342,9 +342,9 @@ zfcp_erp_adisc(struct zfcp_port *port)
	adisc->wwpn = fc_host_port_name(adapter->scsi_host);
	adisc->wwnn = fc_host_node_name(adapter->scsi_host);
	adisc->nport_id = fc_host_port_id(adapter->scsi_host);
	ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x "
	ZFCP_LOG_INFO("ADISC request from s_id 0x%06x to d_id 0x%06x "
		      "(wwpn=0x%016Lx, wwnn=0x%016Lx, "
		      "hard_nport_id=0x%08x, nport_id=0x%08x)\n",
		      "hard_nport_id=0x%06x, nport_id=0x%06x)\n",
		      adisc->nport_id, send_els->d_id, (wwn_t) adisc->wwpn,
		      (wwn_t) adisc->wwnn, adisc->hard_nport_id,
		      adisc->nport_id);
@@ -352,7 +352,7 @@ zfcp_erp_adisc(struct zfcp_port *port)
	retval = zfcp_fsf_send_els(send_els);
	if (retval != 0) {
		ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port "
				"0x%08x on adapter %s\n", send_els->d_id,
				"0x%06x on adapter %s\n", send_els->d_id,
				zfcp_get_busid_by_adapter(adapter));
		goto freemem;
	}
@@ -398,7 +398,7 @@ zfcp_erp_adisc_handler(unsigned long data)
	if (send_els->status != 0) {
		ZFCP_LOG_NORMAL("ELS request rejected/timed out, "
				"force physical port reopen "
				"(adapter %s, port d_id=0x%08x)\n",
				"(adapter %s, port d_id=0x%06x)\n",
				zfcp_get_busid_by_adapter(adapter), d_id);
		debug_text_event(adapter->erp_dbf, 3, "forcreop");
		if (zfcp_erp_port_forced_reopen(port, 0))
@@ -411,9 +411,9 @@ zfcp_erp_adisc_handler(unsigned long data)

	adisc = zfcp_sg_to_address(send_els->resp);

	ZFCP_LOG_INFO("ADISC response from d_id 0x%08x to s_id "
		      "0x%08x (wwpn=0x%016Lx, wwnn=0x%016Lx, "
		      "hard_nport_id=0x%08x, nport_id=0x%08x)\n",
	ZFCP_LOG_INFO("ADISC response from d_id 0x%06x to s_id "
		      "0x%06x (wwpn=0x%016Lx, wwnn=0x%016Lx, "
		      "hard_nport_id=0x%06x, nport_id=0x%06x)\n",
		      d_id, fc_host_port_id(adapter->scsi_host),
		      (wwn_t) adisc->wwpn, (wwn_t) adisc->wwnn,
		      adisc->hard_nport_id, adisc->nport_id);
@@ -847,8 +847,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
	if (erp_action->fsf_req) {
		/* take lock to ensure that request is not deleted meanwhile */
		spin_lock(&adapter->req_list_lock);
		if (zfcp_reqlist_ismember(adapter,
					    erp_action->fsf_req->req_id)) {
		if (zfcp_reqlist_find(adapter, erp_action->fsf_req->req_id)) {
			/* fsf_req still exists */
			debug_text_event(adapter->erp_dbf, 3, "a_ca_req");
			debug_event(adapter->erp_dbf, 3, &erp_action->fsf_req,
@@ -1377,7 +1376,7 @@ zfcp_erp_port_failed(struct zfcp_port *port)

	if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status))
		ZFCP_LOG_NORMAL("port erp failed (adapter %s, "
				"port d_id=0x%08x)\n",
				"port d_id=0x%06x)\n",
				zfcp_get_busid_by_port(port), port->d_id);
	else
		ZFCP_LOG_NORMAL("port erp failed (adapter %s, wwpn=0x%016Lx)\n",
@@ -1591,6 +1590,62 @@ zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, int result)
	return result;
}

struct zfcp_erp_add_work {
	struct zfcp_unit  *unit;
	struct work_struct work;
};

/**
 * zfcp_erp_scsi_scan
 * @data: pointer to a struct zfcp_erp_add_work
 *
 * Registers a logical unit with the SCSI stack.
 */
static void zfcp_erp_scsi_scan(struct work_struct *work)
{
	struct zfcp_erp_add_work *p =
		container_of(work, struct zfcp_erp_add_work, work);
	struct zfcp_unit *unit = p->unit;
	struct fc_rport *rport = unit->port->rport;
	scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
			 unit->scsi_lun, 0);
	atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
	wake_up(&unit->scsi_scan_wq);
	zfcp_unit_put(unit);
	kfree(p);
}

/**
 * zfcp_erp_schedule_work
 * @unit: pointer to unit which should be registered with SCSI stack
 *
 * Schedules work which registers a unit with the SCSI stack
 */
static void
zfcp_erp_schedule_work(struct zfcp_unit *unit)
{
	struct zfcp_erp_add_work *p;

	p = kmalloc(sizeof(*p), GFP_KERNEL);
	if (!p) {
		ZFCP_LOG_NORMAL("error: Out of resources. Could not register "
				"the FCP-LUN 0x%Lx connected to "
				"the port with WWPN 0x%Lx connected to "
				"the adapter %s with the SCSI stack.\n",
				unit->fcp_lun,
				unit->port->wwpn,
				zfcp_get_busid_by_unit(unit));
		return;
	}

	zfcp_unit_get(unit);
	memset(p, 0, sizeof(*p));
	atomic_set_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
	INIT_WORK(&p->work, zfcp_erp_scsi_scan);
	p->unit = unit;
	schedule_work(&p->work);
}

/*
 * function:	
 *
@@ -2401,7 +2456,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
				retval = ZFCP_ERP_FAILED;
			}
		} else {
			ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%08x -> "
			ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%06x -> "
				       "trying open\n", port->wwpn, port->d_id);
			retval = zfcp_erp_port_strategy_open_port(erp_action);
		}
@@ -2441,7 +2496,7 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action)
	case ZFCP_ERP_STEP_UNINITIALIZED:
	case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
	case ZFCP_ERP_STEP_PORT_CLOSING:
		ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%08x -> trying open\n",
		ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%06x -> trying open\n",
			       port->wwpn, port->d_id);
		retval = zfcp_erp_port_strategy_open_port(erp_action);
		break;
@@ -3092,9 +3147,9 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
		    && port->rport) {
			atomic_set_mask(ZFCP_STATUS_UNIT_REGISTERED,
					&unit->status);
 			scsi_scan_target(&port->rport->dev, 0,
					 port->rport->scsi_target_id,
					 unit->scsi_lun, 0);
			if (atomic_test_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING,
					     &unit->status) == 0)
				zfcp_erp_schedule_work(unit);
		}
		zfcp_unit_put(unit);
		break;
@@ -3121,7 +3176,7 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
						zfcp_get_busid_by_port(port),
						port->wwpn);
			else {
				scsi_flush_work(adapter->scsi_host);
				scsi_target_unblock(&port->rport->dev);
				port->rport->maxframe_size = port->maxframe_size;
				port->rport->supported_classes =
					port->supported_classes;
Loading