mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "This is mostly update of the usual drivers: smarpqi, lpfc, qedi, megaraid_sas, libsas, zfcp, mpt3sas, hisi_sas. Additionally, we have a pile of annotation, unused variable and minor updates. The big API change is the updates for Christoph's DMA rework which include removing the DISABLE_CLUSTERING flag. And finally there are a couple of target tree updates" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (259 commits) scsi: isci: request: mark expected switch fall-through scsi: isci: remote_node_context: mark expected switch fall-throughs scsi: isci: remote_device: Mark expected switch fall-throughs scsi: isci: phy: Mark expected switch fall-through scsi: iscsi: Capture iscsi debug messages using tracepoints scsi: myrb: Mark expected switch fall-throughs scsi: megaraid: fix out-of-bound array accesses scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through scsi: fcoe: remove set but not used variable 'port' scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown() scsi: smartpqi: fix build warnings scsi: smartpqi: update driver version scsi: smartpqi: add ofa support scsi: smartpqi: increase fw status register read timeout scsi: smartpqi: bump driver version scsi: smartpqi: add smp_utils support scsi: smartpqi: correct lun reset issues scsi: smartpqi: correct volume status scsi: smartpqi: do not offline disks for transient did no connect conditions scsi: smartpqi: allow for larger raid maps ...
This commit is contained in:
31
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
Normal file
31
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
* Cadence Universal Flash Storage (UFS) Controller
|
||||
|
||||
UFS nodes are defined to describe on-chip UFS host controllers.
|
||||
Each UFS controller instance should have its own node.
|
||||
Please see the ufshcd-pltfrm.txt for a list of all available properties.
|
||||
|
||||
Required properties:
|
||||
- compatible : Compatible list, contains the following controller:
|
||||
"cdns,ufshc"
|
||||
complemented with the JEDEC version:
|
||||
"jedec,ufs-2.0"
|
||||
|
||||
- reg : Address and length of the UFS register set.
|
||||
- interrupts : One interrupt mapping.
|
||||
- freq-table-hz : Clock frequency table.
|
||||
See the ufshcd-pltfrm.txt for details.
|
||||
- clocks : List of phandle and clock specifier pairs.
|
||||
- clock-names : List of clock input name strings sorted in the same
|
||||
order as the clocks property. "core_clk" is mandatory.
|
||||
Depending on a type of a PHY,
|
||||
the "phy_clk" clock can also be added, if needed.
|
||||
|
||||
Example:
|
||||
ufs@fd030000 {
|
||||
compatible = "cdns,ufshc", "jedec,ufs-2.0";
|
||||
reg = <0xfd030000 0x10000>;
|
||||
interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
|
||||
freq-table-hz = <0 0>, <0 0>;
|
||||
clocks = <&ufs_core_clk>, <&ufs_phy_clk>;
|
||||
clock-names = "core_clk", "phy_clk";
|
||||
};
|
||||
@@ -33,6 +33,12 @@ Optional properties:
|
||||
- clocks : List of phandle and clock specifier pairs
|
||||
- clock-names : List of clock input name strings sorted in the same
|
||||
order as the clocks property.
|
||||
"ref_clk" indicates reference clock frequency.
|
||||
UFS host supplies reference clock to UFS device and UFS device
|
||||
specification allows host to provide one of the 4 frequencies (19.2 MHz,
|
||||
26 MHz, 38.4 MHz, 52MHz) for reference clock. This "ref_clk" entry is
|
||||
parsed and used to update the reference clock setting in device.
|
||||
Defaults to 26 MHz(as per specification) if not specified by host.
|
||||
- freq-table-hz : Array of <min max> operating frequencies stored in the same
|
||||
order as the clocks property. If this property is not
|
||||
defined or a value in the array is "0" then it is assumed
|
||||
|
||||
@@ -1098,8 +1098,6 @@ of interest:
|
||||
unchecked_isa_dma - 1=>only use bottom 16 MB of ram (ISA DMA addressing
|
||||
restriction), 0=>can use full 32 bit (or better) DMA
|
||||
address space
|
||||
use_clustering - 1=>SCSI commands in mid level's queue can be merged,
|
||||
0=>disallow SCSI command merging
|
||||
no_async_abort - 1=>Asynchronous aborts are not supported
|
||||
0=>Timed-out commands will be aborted asynchronously
|
||||
hostt - pointer to driver's struct scsi_host_template from which
|
||||
|
||||
@@ -347,7 +347,7 @@ static struct scsi_host_template driver_template = {
|
||||
.sg_tablesize = SG_ALL,
|
||||
.max_sectors = 1024,
|
||||
.cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN,
|
||||
.use_clustering = DISABLE_CLUSTERING,
|
||||
.dma_boundary = PAGE_SIZE - 1,
|
||||
};
|
||||
|
||||
static int __init
|
||||
|
||||
@@ -195,7 +195,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
|
||||
goto split;
|
||||
}
|
||||
|
||||
if (bvprvp && blk_queue_cluster(q)) {
|
||||
if (bvprvp) {
|
||||
if (seg_size + bv.bv_len > queue_max_segment_size(q))
|
||||
goto new_segment;
|
||||
if (!biovec_phys_mergeable(q, bvprvp, &bv))
|
||||
@@ -295,7 +295,7 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
|
||||
bool no_sg_merge)
|
||||
{
|
||||
struct bio_vec bv, bvprv = { NULL };
|
||||
int cluster, prev = 0;
|
||||
int prev = 0;
|
||||
unsigned int seg_size, nr_phys_segs;
|
||||
struct bio *fbio, *bbio;
|
||||
struct bvec_iter iter;
|
||||
@@ -313,7 +313,6 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
|
||||
}
|
||||
|
||||
fbio = bio;
|
||||
cluster = blk_queue_cluster(q);
|
||||
seg_size = 0;
|
||||
nr_phys_segs = 0;
|
||||
for_each_bio(bio) {
|
||||
@@ -325,7 +324,7 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
|
||||
if (no_sg_merge)
|
||||
goto new_segment;
|
||||
|
||||
if (prev && cluster) {
|
||||
if (prev) {
|
||||
if (seg_size + bv.bv_len
|
||||
> queue_max_segment_size(q))
|
||||
goto new_segment;
|
||||
@@ -395,9 +394,6 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
|
||||
{
|
||||
struct bio_vec end_bv = { NULL }, nxt_bv;
|
||||
|
||||
if (!blk_queue_cluster(q))
|
||||
return 0;
|
||||
|
||||
if (bio->bi_seg_back_size + nxt->bi_seg_front_size >
|
||||
queue_max_segment_size(q))
|
||||
return 0;
|
||||
@@ -414,12 +410,12 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
|
||||
static inline void
|
||||
__blk_segment_map_sg(struct request_queue *q, struct bio_vec *bvec,
|
||||
struct scatterlist *sglist, struct bio_vec *bvprv,
|
||||
struct scatterlist **sg, int *nsegs, int *cluster)
|
||||
struct scatterlist **sg, int *nsegs)
|
||||
{
|
||||
|
||||
int nbytes = bvec->bv_len;
|
||||
|
||||
if (*sg && *cluster) {
|
||||
if (*sg) {
|
||||
if ((*sg)->length + nbytes > queue_max_segment_size(q))
|
||||
goto new_segment;
|
||||
if (!biovec_phys_mergeable(q, bvprv, bvec))
|
||||
@@ -465,12 +461,12 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio,
|
||||
{
|
||||
struct bio_vec bvec, bvprv = { NULL };
|
||||
struct bvec_iter iter;
|
||||
int cluster = blk_queue_cluster(q), nsegs = 0;
|
||||
int nsegs = 0;
|
||||
|
||||
for_each_bio(bio)
|
||||
bio_for_each_segment(bvec, bio, iter)
|
||||
__blk_segment_map_sg(q, &bvec, sglist, &bvprv, sg,
|
||||
&nsegs, &cluster);
|
||||
&nsegs);
|
||||
|
||||
return nsegs;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ void blk_set_default_limits(struct queue_limits *lim)
|
||||
lim->alignment_offset = 0;
|
||||
lim->io_opt = 0;
|
||||
lim->misaligned = 0;
|
||||
lim->cluster = 1;
|
||||
lim->zoned = BLK_ZONED_NONE;
|
||||
}
|
||||
EXPORT_SYMBOL(blk_set_default_limits);
|
||||
@@ -547,8 +546,6 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
t->io_min = max(t->io_min, b->io_min);
|
||||
t->io_opt = lcm_not_zero(t->io_opt, b->io_opt);
|
||||
|
||||
t->cluster &= b->cluster;
|
||||
|
||||
/* Physical block size a multiple of the logical block size? */
|
||||
if (t->physical_block_size & (t->logical_block_size - 1)) {
|
||||
t->physical_block_size = t->logical_block_size;
|
||||
|
||||
@@ -132,10 +132,7 @@ static ssize_t queue_max_integrity_segments_show(struct request_queue *q, char *
|
||||
|
||||
static ssize_t queue_max_segment_size_show(struct request_queue *q, char *page)
|
||||
{
|
||||
if (blk_queue_cluster(q))
|
||||
return queue_var_show(queue_max_segment_size(q), (page));
|
||||
|
||||
return queue_var_show(PAGE_SIZE, (page));
|
||||
return queue_var_show(queue_max_segment_size(q), (page));
|
||||
}
|
||||
|
||||
static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page)
|
||||
|
||||
@@ -1610,7 +1610,6 @@ static struct scsi_host_template scsi_driver_template = {
|
||||
.eh_abort_handler = sbp2_scsi_abort,
|
||||
.this_id = -1,
|
||||
.sg_tablesize = SG_ALL,
|
||||
.use_clustering = ENABLE_CLUSTERING,
|
||||
.can_queue = 1,
|
||||
.sdev_attrs = sbp2_scsi_sysfs_attrs,
|
||||
};
|
||||
|
||||
@@ -997,7 +997,6 @@ static struct scsi_host_template iscsi_iser_sht = {
|
||||
.eh_device_reset_handler= iscsi_eh_device_reset,
|
||||
.eh_target_reset_handler = iscsi_eh_recover_target,
|
||||
.target_alloc = iscsi_target_alloc,
|
||||
.use_clustering = ENABLE_CLUSTERING,
|
||||
.slave_alloc = iscsi_iser_slave_alloc,
|
||||
.proc_name = "iscsi_iser",
|
||||
.this_id = -1,
|
||||
|
||||
@@ -3215,7 +3215,6 @@ static struct scsi_host_template srp_template = {
|
||||
.can_queue = SRP_DEFAULT_CMD_SQ_SIZE,
|
||||
.this_id = -1,
|
||||
.cmd_per_lun = SRP_DEFAULT_CMD_SQ_SIZE,
|
||||
.use_clustering = ENABLE_CLUSTERING,
|
||||
.shost_attrs = srp_host_attrs,
|
||||
.track_queue_depth = 1,
|
||||
};
|
||||
|
||||
@@ -3147,11 +3147,6 @@ static int srpt_check_false(struct se_portal_group *se_tpg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *srpt_get_fabric_name(void)
|
||||
{
|
||||
return "srpt";
|
||||
}
|
||||
|
||||
static struct srpt_port *srpt_tpg_to_sport(struct se_portal_group *tpg)
|
||||
{
|
||||
return tpg->se_tpg_wwn->priv;
|
||||
@@ -3678,8 +3673,7 @@ static struct configfs_attribute *srpt_wwn_attrs[] = {
|
||||
|
||||
static const struct target_core_fabric_ops srpt_template = {
|
||||
.module = THIS_MODULE,
|
||||
.name = "srpt",
|
||||
.get_fabric_name = srpt_get_fabric_name,
|
||||
.fabric_name = "srpt",
|
||||
.tpg_get_wwn = srpt_get_fabric_wwn,
|
||||
.tpg_get_tag = srpt_get_tag,
|
||||
.tpg_check_demo_mode = srpt_check_false,
|
||||
|
||||
@@ -129,7 +129,6 @@ static struct scsi_host_template mptfc_driver_template = {
|
||||
.sg_tablesize = MPT_SCSI_SG_DEPTH,
|
||||
.max_sectors = 8192,
|
||||
.cmd_per_lun = 7,
|
||||
.use_clustering = ENABLE_CLUSTERING,
|
||||
.shost_attrs = mptscsih_host_attrs,
|
||||
};
|
||||
|
||||
|
||||
@@ -1992,7 +1992,6 @@ static struct scsi_host_template mptsas_driver_template = {
|
||||
.sg_tablesize = MPT_SCSI_SG_DEPTH,
|
||||
.max_sectors = 8192,
|
||||
.cmd_per_lun = 7,
|
||||
.use_clustering = ENABLE_CLUSTERING,
|
||||
.shost_attrs = mptscsih_host_attrs,
|
||||
.no_write_same = 1,
|
||||
};
|
||||
|
||||
@@ -848,7 +848,6 @@ static struct scsi_host_template mptspi_driver_template = {
|
||||
.sg_tablesize = MPT_SCSI_SG_DEPTH,
|
||||
.max_sectors = 8192,
|
||||
.cmd_per_lun = 7,
|
||||
.use_clustering = ENABLE_CLUSTERING,
|
||||
.shost_attrs = mptscsih_host_attrs,
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Module interface and handling of zfcp data structures.
|
||||
*
|
||||
* Copyright IBM Corp. 2002, 2013
|
||||
* Copyright IBM Corp. 2002, 2017
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -124,6 +124,9 @@ static int __init zfcp_module_init(void)
|
||||
{
|
||||
int retval = -ENOMEM;
|
||||
|
||||
if (zfcp_experimental_dix)
|
||||
pr_warn("DIX is enabled. It is experimental and might cause problems\n");
|
||||
|
||||
zfcp_fsf_qtcb_cache = zfcp_cache_hw_align("zfcp_fsf_qtcb",
|
||||
sizeof(struct fsf_qtcb));
|
||||
if (!zfcp_fsf_qtcb_cache)
|
||||
@@ -248,43 +251,36 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter)
|
||||
|
||||
static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter)
|
||||
{
|
||||
if (adapter->pool.erp_req)
|
||||
mempool_destroy(adapter->pool.erp_req);
|
||||
if (adapter->pool.scsi_req)
|
||||
mempool_destroy(adapter->pool.scsi_req);
|
||||
if (adapter->pool.scsi_abort)
|
||||
mempool_destroy(adapter->pool.scsi_abort);
|
||||
if (adapter->pool.qtcb_pool)
|
||||
mempool_destroy(adapter->pool.qtcb_pool);
|
||||
if (adapter->pool.status_read_req)
|
||||
mempool_destroy(adapter->pool.status_read_req);
|
||||
if (adapter->pool.sr_data)
|
||||
mempool_destroy(adapter->pool.sr_data);
|
||||
if (adapter->pool.gid_pn)
|
||||
mempool_destroy(adapter->pool.gid_pn);
|
||||
mempool_destroy(adapter->pool.erp_req);
|
||||
mempool_destroy(adapter->pool.scsi_req);
|
||||
mempool_destroy(adapter->pool.scsi_abort);
|
||||
mempool_destroy(adapter->pool.qtcb_pool);
|
||||
mempool_destroy(adapter->pool.status_read_req);
|
||||
mempool_destroy(adapter->pool.sr_data);
|
||||
mempool_destroy(adapter->pool.gid_pn);
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_status_read_refill - refill the long running status_read_requests
|
||||
* @adapter: ptr to struct zfcp_adapter for which the buffers should be refilled
|
||||
*
|
||||
* Returns: 0 on success, 1 otherwise
|
||||
*
|
||||
* if there are 16 or more status_read requests missing an adapter_reopen
|
||||
* is triggered
|
||||
* Return:
|
||||
* * 0 on success meaning at least one status read is pending
|
||||
* * 1 if posting failed and not a single status read buffer is pending,
|
||||
* also triggers adapter reopen recovery
|
||||
*/
|
||||
int zfcp_status_read_refill(struct zfcp_adapter *adapter)
|
||||
{
|
||||
while (atomic_read(&adapter->stat_miss) > 0)
|
||||
while (atomic_add_unless(&adapter->stat_miss, -1, 0))
|
||||
if (zfcp_fsf_status_read(adapter->qdio)) {
|
||||
atomic_inc(&adapter->stat_miss); /* undo add -1 */
|
||||
if (atomic_read(&adapter->stat_miss) >=
|
||||
adapter->stat_read_buf_num) {
|
||||
zfcp_erp_adapter_reopen(adapter, 0, "axsref1");
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
} else
|
||||
atomic_dec(&adapter->stat_miss);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -542,45 +538,3 @@ err_out:
|
||||
zfcp_ccw_adapter_put(adapter);
|
||||
return ERR_PTR(retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_sg_free_table - free memory used by scatterlists
|
||||
* @sg: pointer to scatterlist
|
||||
* @count: number of scatterlist which are to be free'ed
|
||||
* the scatterlist are expected to reference pages always
|
||||
*/
|
||||
void zfcp_sg_free_table(struct scatterlist *sg, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++, sg++)
|
||||
if (sg)
|
||||
free_page((unsigned long) sg_virt(sg));
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_sg_setup_table - init scatterlist and allocate, assign buffers
|
||||
* @sg: pointer to struct scatterlist
|
||||
* @count: number of scatterlists which should be assigned with buffers
|
||||
* of size page
|
||||
*
|
||||
* Returns: 0 on success, -ENOMEM otherwise
|
||||
*/
|
||||
int zfcp_sg_setup_table(struct scatterlist *sg, int count)
|
||||
{
|
||||
void *addr;
|
||||
int i;
|
||||
|
||||
sg_init_table(sg, count);
|
||||
for (i = 0; i < count; i++, sg++) {
|
||||
addr = (void *) get_zeroed_page(GFP_KERNEL);
|
||||
if (!addr) {
|
||||
zfcp_sg_free_table(sg, i);
|
||||
return -ENOMEM;
|
||||
}
|
||||
sg_set_buf(sg, addr, PAGE_SIZE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,8 @@ void zfcp_dbf_pl_write(struct zfcp_dbf *dbf, void *data, u16 length, char *area,
|
||||
|
||||
/**
|
||||
* zfcp_dbf_hba_fsf_res - trace event for fsf responses
|
||||
* @tag: tag indicating which kind of unsolicited status has been received
|
||||
* @tag: tag indicating which kind of FSF response has been received
|
||||
* @level: trace level to be used for event
|
||||
* @req: request for which a response was received
|
||||
*/
|
||||
void zfcp_dbf_hba_fsf_res(char *tag, int level, struct zfcp_fsf_req *req)
|
||||
@@ -81,8 +82,8 @@ void zfcp_dbf_hba_fsf_res(char *tag, int level, struct zfcp_fsf_req *req)
|
||||
rec->id = ZFCP_DBF_HBA_RES;
|
||||
rec->fsf_req_id = req->req_id;
|
||||
rec->fsf_req_status = req->status;
|
||||
rec->fsf_cmd = req->fsf_command;
|
||||
rec->fsf_seq_no = req->seq_no;
|
||||
rec->fsf_cmd = q_head->fsf_command;
|
||||
rec->fsf_seq_no = q_pref->req_seq_no;
|
||||
rec->u.res.req_issued = req->issued;
|
||||
rec->u.res.prot_status = q_pref->prot_status;
|
||||
rec->u.res.fsf_status = q_head->fsf_status;
|
||||
@@ -94,7 +95,7 @@ void zfcp_dbf_hba_fsf_res(char *tag, int level, struct zfcp_fsf_req *req)
|
||||
memcpy(rec->u.res.fsf_status_qual, &q_head->fsf_status_qual,
|
||||
FSF_STATUS_QUALIFIER_SIZE);
|
||||
|
||||
if (req->fsf_command != FSF_QTCB_FCP_CMND) {
|
||||
if (q_head->fsf_command != FSF_QTCB_FCP_CMND) {
|
||||
rec->pl_len = q_head->log_length;
|
||||
zfcp_dbf_pl_write(dbf, (char *)q_pref + q_head->log_start,
|
||||
rec->pl_len, "fsf_res", req->req_id);
|
||||
@@ -127,7 +128,7 @@ void zfcp_dbf_hba_fsf_uss(char *tag, struct zfcp_fsf_req *req)
|
||||
rec->id = ZFCP_DBF_HBA_USS;
|
||||
rec->fsf_req_id = req->req_id;
|
||||
rec->fsf_req_status = req->status;
|
||||
rec->fsf_cmd = req->fsf_command;
|
||||
rec->fsf_cmd = FSF_QTCB_UNSOLICITED_STATUS;
|
||||
|
||||
if (!srb)
|
||||
goto log;
|
||||
@@ -153,7 +154,7 @@ log:
|
||||
|
||||
/**
|
||||
* zfcp_dbf_hba_bit_err - trace event for bit error conditions
|
||||
* @tag: tag indicating which kind of unsolicited status has been received
|
||||
* @tag: tag indicating which kind of bit error unsolicited status was received
|
||||
* @req: request which caused the bit_error condition
|
||||
*/
|
||||
void zfcp_dbf_hba_bit_err(char *tag, struct zfcp_fsf_req *req)
|
||||
@@ -174,7 +175,7 @@ void zfcp_dbf_hba_bit_err(char *tag, struct zfcp_fsf_req *req)
|
||||
rec->id = ZFCP_DBF_HBA_BIT;
|
||||
rec->fsf_req_id = req->req_id;
|
||||
rec->fsf_req_status = req->status;
|
||||
rec->fsf_cmd = req->fsf_command;
|
||||
rec->fsf_cmd = FSF_QTCB_UNSOLICITED_STATUS;
|
||||
memcpy(&rec->u.be, &sr_buf->payload.bit_error,
|
||||
sizeof(struct fsf_bit_error_payload));
|
||||
|
||||
@@ -224,6 +225,7 @@ void zfcp_dbf_hba_def_err(struct zfcp_adapter *adapter, u64 req_id, u16 scount,
|
||||
|
||||
/**
|
||||
* zfcp_dbf_hba_basic - trace event for basic adapter events
|
||||
* @tag: identifier for event
|
||||
* @adapter: pointer to struct zfcp_adapter
|
||||
*/
|
||||
void zfcp_dbf_hba_basic(char *tag, struct zfcp_adapter *adapter)
|
||||
@@ -357,7 +359,7 @@ void zfcp_dbf_rec_run_lvl(int level, char *tag, struct zfcp_erp_action *erp)
|
||||
rec->u.run.fsf_req_id = erp->fsf_req_id;
|
||||
rec->u.run.rec_status = erp->status;
|
||||
rec->u.run.rec_step = erp->step;
|
||||
rec->u.run.rec_action = erp->action;
|
||||
rec->u.run.rec_action = erp->type;
|
||||
|
||||
if (erp->sdev)
|
||||
rec->u.run.rec_count =
|
||||
@@ -478,7 +480,8 @@ out:
|
||||
/**
|
||||
* zfcp_dbf_san_req - trace event for issued SAN request
|
||||
* @tag: identifier for event
|
||||
* @fsf_req: request containing issued CT data
|
||||
* @fsf: request containing issued CT or ELS data
|
||||
* @d_id: N_Port_ID where SAN request is sent to
|
||||
* d_id: destination ID
|
||||
*/
|
||||
void zfcp_dbf_san_req(char *tag, struct zfcp_fsf_req *fsf, u32 d_id)
|
||||
@@ -560,7 +563,7 @@ static u16 zfcp_dbf_san_res_cap_len_if_gpn_ft(char *tag,
|
||||
/**
|
||||
* zfcp_dbf_san_res - trace event for received SAN request
|
||||
* @tag: identifier for event
|
||||
* @fsf_req: request containing issued CT data
|
||||
* @fsf: request containing received CT or ELS data
|
||||
*/
|
||||
void zfcp_dbf_san_res(char *tag, struct zfcp_fsf_req *fsf)
|
||||
{
|
||||
@@ -580,7 +583,7 @@ void zfcp_dbf_san_res(char *tag, struct zfcp_fsf_req *fsf)
|
||||
/**
|
||||
* zfcp_dbf_san_in_els - trace event for incoming ELS
|
||||
* @tag: identifier for event
|
||||
* @fsf_req: request containing issued CT data
|
||||
* @fsf: request containing received ELS data
|
||||
*/
|
||||
void zfcp_dbf_san_in_els(char *tag, struct zfcp_fsf_req *fsf)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,8 @@ struct zfcp_dbf_rec_trigger {
|
||||
* @fsf_req_id: request id for fsf requests
|
||||
* @rec_status: status of the fsf request
|
||||
* @rec_step: current step of the recovery action
|
||||
* rec_count: recovery counter
|
||||
* @rec_action: ERP action type
|
||||
* @rec_count: recoveries including retries for particular @rec_action
|
||||
*/
|
||||
struct zfcp_dbf_rec_running {
|
||||
u64 fsf_req_id;
|
||||
@@ -72,6 +73,7 @@ enum zfcp_dbf_rec_id {
|
||||
* @adapter_status: current status of the adapter
|
||||
* @port_status: current status of the port
|
||||
* @lun_status: current status of the lun
|
||||
* @u: record type specific data
|
||||
* @u.trig: structure zfcp_dbf_rec_trigger
|
||||
* @u.run: structure zfcp_dbf_rec_running
|
||||
*/
|
||||
@@ -126,6 +128,8 @@ struct zfcp_dbf_san {
|
||||
* @prot_status_qual: protocol status qualifier
|
||||
* @fsf_status: fsf status
|
||||
* @fsf_status_qual: fsf status qualifier
|
||||
* @port_handle: handle for port
|
||||
* @lun_handle: handle for LUN
|
||||
*/
|
||||
struct zfcp_dbf_hba_res {
|
||||
u64 req_issued;
|
||||
@@ -158,6 +162,7 @@ struct zfcp_dbf_hba_uss {
|
||||
* @ZFCP_DBF_HBA_RES: response trace record
|
||||
* @ZFCP_DBF_HBA_USS: unsolicited status trace record
|
||||
* @ZFCP_DBF_HBA_BIT: bit error trace record
|
||||
* @ZFCP_DBF_HBA_BASIC: basic adapter event, only trace tag, no other data
|
||||
*/
|
||||
enum zfcp_dbf_hba_id {
|
||||
ZFCP_DBF_HBA_RES = 1,
|
||||
@@ -176,6 +181,9 @@ enum zfcp_dbf_hba_id {
|
||||
* @fsf_seq_no: fsf sequence number
|
||||
* @pl_len: length of payload stored as zfcp_dbf_pay
|
||||
* @u: record type specific data
|
||||
* @u.res: data for fsf responses
|
||||
* @u.uss: data for unsolicited status buffer
|
||||
* @u.be: data for bit error unsolicited status buffer
|
||||
*/
|
||||
struct zfcp_dbf_hba {
|
||||
u8 id;
|
||||
@@ -339,8 +347,8 @@ void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req)
|
||||
zfcp_dbf_hba_fsf_resp_suppress(req)
|
||||
? 5 : 1, req);
|
||||
|
||||
} else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) ||
|
||||
(req->fsf_command == FSF_QTCB_OPEN_LUN)) {
|
||||
} else if ((qtcb->header.fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) ||
|
||||
(qtcb->header.fsf_command == FSF_QTCB_OPEN_LUN)) {
|
||||
zfcp_dbf_hba_fsf_resp("fs_open", 4, req);
|
||||
|
||||
} else if (qtcb->header.log_length) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Global definitions for the zfcp device driver.
|
||||
*
|
||||
* Copyright IBM Corp. 2002, 2010
|
||||
* Copyright IBM Corp. 2002, 2017
|
||||
*/
|
||||
|
||||
#ifndef ZFCP_DEF_H
|
||||
@@ -41,24 +41,16 @@
|
||||
#include "zfcp_fc.h"
|
||||
#include "zfcp_qdio.h"
|
||||
|
||||
struct zfcp_reqlist;
|
||||
|
||||
/********************* SCSI SPECIFIC DEFINES *********************************/
|
||||
#define ZFCP_SCSI_ER_TIMEOUT (10*HZ)
|
||||
|
||||
/********************* FSF SPECIFIC DEFINES *********************************/
|
||||
|
||||
/* ATTENTION: value must not be used by hardware */
|
||||
#define FSF_QTCB_UNSOLICITED_STATUS 0x6305
|
||||
|
||||
/* timeout value for "default timer" for fsf requests */
|
||||
#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ)
|
||||
|
||||
/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/
|
||||
|
||||
/*
|
||||
* Note, the leftmost status byte is common among adapter, port
|
||||
* and unit
|
||||
* Note, the leftmost 12 status bits (3 nibbles) are common among adapter, port
|
||||
* and unit. This is a mask for bitwise 'and' with status values.
|
||||
*/
|
||||
#define ZFCP_COMMON_FLAGS 0xfff00000
|
||||
|
||||
@@ -97,7 +89,49 @@ struct zfcp_reqlist;
|
||||
|
||||
/************************* STRUCTURE DEFINITIONS *****************************/
|
||||
|
||||
struct zfcp_fsf_req;
|
||||
/**
|
||||
* enum zfcp_erp_act_type - Type of ERP action object.
|
||||
* @ZFCP_ERP_ACTION_REOPEN_LUN: LUN recovery.
|
||||
* @ZFCP_ERP_ACTION_REOPEN_PORT: Port recovery.
|
||||
* @ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: Forced port recovery.
|
||||
* @ZFCP_ERP_ACTION_REOPEN_ADAPTER: Adapter recovery.
|
||||
*
|
||||
* Values must fit into u8 because of code dependencies:
|
||||
* zfcp_dbf_rec_trig(), &zfcp_dbf_rec_trigger.want, &zfcp_dbf_rec_trigger.need;
|
||||
* zfcp_dbf_rec_run_lvl(), zfcp_dbf_rec_run(), &zfcp_dbf_rec_running.rec_action.
|
||||
*/
|
||||
enum zfcp_erp_act_type {
|
||||
ZFCP_ERP_ACTION_REOPEN_LUN = 1,
|
||||
ZFCP_ERP_ACTION_REOPEN_PORT = 2,
|
||||
ZFCP_ERP_ACTION_REOPEN_PORT_FORCED = 3,
|
||||
ZFCP_ERP_ACTION_REOPEN_ADAPTER = 4,
|
||||
};
|
||||
|
||||
/*
|
||||
* Values must fit into u16 because of code dependencies:
|
||||
* zfcp_dbf_rec_run_lvl(), zfcp_dbf_rec_run(), zfcp_dbf_rec_run_wka(),
|
||||
* &zfcp_dbf_rec_running.rec_step.
|
||||
*/
|
||||
enum zfcp_erp_steps {
|
||||
ZFCP_ERP_STEP_UNINITIALIZED = 0x0000,
|
||||
ZFCP_ERP_STEP_PHYS_PORT_CLOSING = 0x0010,
|
||||
ZFCP_ERP_STEP_PORT_CLOSING = 0x0100,
|
||||
ZFCP_ERP_STEP_PORT_OPENING = 0x0800,
|
||||
ZFCP_ERP_STEP_LUN_CLOSING = 0x1000,
|
||||
ZFCP_ERP_STEP_LUN_OPENING = 0x2000,
|
||||
};
|
||||
|
||||
struct zfcp_erp_action {
|
||||
struct list_head list;
|
||||
enum zfcp_erp_act_type type; /* requested action code */
|
||||
struct zfcp_adapter *adapter; /* device which should be recovered */
|
||||
struct zfcp_port *port;
|
||||
struct scsi_device *sdev;
|
||||
u32 status; /* recovery status */
|
||||
enum zfcp_erp_steps step; /* active step of this erp action */
|
||||
unsigned long fsf_req_id;
|
||||
struct timer_list timer;
|
||||
};
|
||||
|
||||
/* holds various memory pools of an adapter */
|
||||
struct zfcp_adapter_mempool {
|
||||
@@ -111,37 +145,6 @@ struct zfcp_adapter_mempool {
|
||||
mempool_t *qtcb_pool;
|
||||
};
|
||||
|
||||
struct zfcp_erp_action {
|
||||
struct list_head list;
|
||||
int action; /* requested action code */
|
||||
struct zfcp_adapter *adapter; /* device which should be recovered */
|
||||
struct zfcp_port *port;
|
||||
struct scsi_device *sdev;
|
||||
u32 status; /* recovery status */
|
||||
u32 step; /* active step of this erp action */
|
||||
unsigned long fsf_req_id;
|
||||
struct timer_list timer;
|
||||
};
|
||||
|
||||
struct fsf_latency_record {
|
||||
u32 min;
|
||||
u32 max;
|
||||
u64 sum;
|
||||
};
|
||||
|
||||
struct latency_cont {
|
||||
struct fsf_latency_record channel;
|
||||
struct fsf_latency_record fabric;
|
||||
u64 counter;
|
||||
};
|
||||
|
||||
struct zfcp_latencies {
|
||||
struct latency_cont read;
|
||||
struct latency_cont write;
|
||||
struct latency_cont cmd;
|
||||
spinlock_t lock;
|
||||
};
|
||||
|
||||
struct zfcp_adapter {
|
||||
struct kref ref;
|
||||
u64 peer_wwnn; /* P2P peer WWNN */
|
||||
@@ -220,6 +223,25 @@ struct zfcp_port {
|
||||
unsigned int starget_id;
|
||||
};
|
||||
|
||||
struct zfcp_latency_record {
|
||||
u32 min;
|
||||
u32 max;
|
||||
u64 sum;
|
||||
};
|
||||
|
||||
struct zfcp_latency_cont {
|
||||
struct zfcp_latency_record channel;
|
||||
struct zfcp_latency_record fabric;
|
||||
u64 counter;
|
||||
};
|
||||
|
||||
struct zfcp_latencies {
|
||||
struct zfcp_latency_cont read;
|
||||
struct zfcp_latency_cont write;
|
||||
struct zfcp_latency_cont cmd;
|
||||
spinlock_t lock;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct zfcp_unit - LUN configured via zfcp sysfs
|
||||
* @dev: struct device for sysfs representation and reference counting
|
||||
@@ -287,9 +309,7 @@ static inline u64 zfcp_scsi_dev_lun(struct scsi_device *sdev)
|
||||
* @qdio_req: qdio queue related values
|
||||
* @completion: used to signal the completion of the request
|
||||
* @status: status of the request
|
||||
* @fsf_command: FSF command issued
|
||||
* @qtcb: associated QTCB
|
||||
* @seq_no: sequence number of this request
|
||||
* @data: private data
|
||||
* @timer: timer data of this request
|
||||
* @erp_action: reference to erp action if request issued on behalf of ERP
|
||||
@@ -304,9 +324,7 @@ struct zfcp_fsf_req {
|
||||
struct zfcp_qdio_req qdio_req;
|
||||
struct completion completion;
|
||||
u32 status;
|
||||
u32 fsf_command;
|
||||
struct fsf_qtcb *qtcb;
|
||||
u32 seq_no;
|
||||
void *data;
|
||||
struct timer_list timer;
|
||||
struct zfcp_erp_action *erp_action;
|
||||
@@ -321,4 +339,9 @@ int zfcp_adapter_multi_buffer_active(struct zfcp_adapter *adapter)
|
||||
return atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_MB_ACT;
|
||||
}
|
||||
|
||||
static inline bool zfcp_fsf_req_is_status_read_buffer(struct zfcp_fsf_req *req)
|
||||
{
|
||||
return req->qtcb == NULL;
|
||||
}
|
||||
|
||||
#endif /* ZFCP_DEF_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -59,14 +59,15 @@ extern void zfcp_dbf_scsi_eh(char *tag, struct zfcp_adapter *adapter,
|
||||
/* zfcp_erp.c */
|
||||
extern void zfcp_erp_set_adapter_status(struct zfcp_adapter *, u32);
|
||||
extern void zfcp_erp_clear_adapter_status(struct zfcp_adapter *, u32);
|
||||
extern void zfcp_erp_port_forced_no_port_dbf(char *id,
|
||||
extern void zfcp_erp_port_forced_no_port_dbf(char *dbftag,
|
||||
struct zfcp_adapter *adapter,
|
||||
u64 port_name, u32 port_id);
|
||||
extern void zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, char *);
|
||||
extern void zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int, char *);
|
||||
extern void zfcp_erp_set_port_status(struct zfcp_port *, u32);
|
||||
extern void zfcp_erp_clear_port_status(struct zfcp_port *, u32);
|
||||
extern void zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id);
|
||||
extern void zfcp_erp_port_reopen(struct zfcp_port *port, int clear,
|
||||
char *dbftag);
|
||||
extern void zfcp_erp_port_shutdown(struct zfcp_port *, int, char *);
|
||||
extern void zfcp_erp_port_forced_reopen(struct zfcp_port *, int, char *);
|
||||
extern void zfcp_erp_set_lun_status(struct scsi_device *, u32);
|
||||
@@ -79,7 +80,8 @@ extern void zfcp_erp_thread_kill(struct zfcp_adapter *);
|
||||
extern void zfcp_erp_wait(struct zfcp_adapter *);
|
||||
extern void zfcp_erp_notify(struct zfcp_erp_action *, unsigned long);
|
||||
extern void zfcp_erp_timeout_handler(struct timer_list *t);
|
||||
extern void zfcp_erp_adapter_reset_sync(struct zfcp_adapter *adapter, char *id);
|
||||
extern void zfcp_erp_adapter_reset_sync(struct zfcp_adapter *adapter,
|
||||
char *dbftag);
|
||||
|
||||
/* zfcp_fc.c */
|
||||
extern struct kmem_cache *zfcp_fc_req_cache;
|
||||
@@ -144,6 +146,7 @@ extern void zfcp_qdio_close(struct zfcp_qdio *);
|
||||
extern void zfcp_qdio_siosl(struct zfcp_adapter *);
|
||||
|
||||
/* zfcp_scsi.c */
|
||||
extern bool zfcp_experimental_dix;
|
||||
extern struct scsi_transport_template *zfcp_scsi_transport_template;
|
||||
extern int zfcp_scsi_adapter_register(struct zfcp_adapter *);
|
||||
extern void zfcp_scsi_adapter_unregister(struct zfcp_adapter *);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user