mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "This consists of the usual driver updates (ufs, target, tcmu, smartpqi, lpfc, zfcp, qla2xxx, mpt3sas, pm80xx). The major core change is using a sbitmap instead of an atomic for queue tracking" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (412 commits) scsi: target: tcm_fc: Fix a kernel-doc header scsi: target: Shorten ALUA error messages scsi: target: Fix two format specifiers scsi: target: Compare explicitly with SAM_STAT_GOOD scsi: sd: Introduce a new local variable in sd_check_events() scsi: dc395x: Open-code status_byte(u8) calls scsi: 53c700: Open-code status_byte(u8) calls scsi: smartpqi: Remove unused functions scsi: qla4xxx: Remove an unused function scsi: myrs: Remove unused functions scsi: myrb: Remove unused functions scsi: mpt3sas: Fix two kernel-doc headers scsi: fcoe: Suppress a compiler warning scsi: libfc: Fix a format specifier scsi: aacraid: Remove an unused function scsi: core: Introduce enum scsi_disposition scsi: core: Modify the scsi_send_eh_cmnd() return value for the SDEV_BLOCK case scsi: core: Rename scsi_softirq_done() into scsi_complete() scsi: core: Remove an incorrect comment scsi: core: Make the scsi_alloc_sgtables() documentation more accurate ...
This commit is contained in:
@@ -14,6 +14,8 @@ Required properties:
|
||||
"qcom,msm8998-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
|
||||
"qcom,sdm845-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
|
||||
"qcom,sm8150-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
|
||||
"qcom,sm8250-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
|
||||
"qcom,sm8350-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
|
||||
- interrupts : <interrupt mapping for UFS host controller IRQ>
|
||||
- reg : <registers mapping>
|
||||
|
||||
|
||||
+13
-4
@@ -132,6 +132,7 @@ static int __blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
|
||||
|
||||
do {
|
||||
struct request *rq;
|
||||
int budget_token;
|
||||
|
||||
if (e->type->ops.has_work && !e->type->ops.has_work(hctx))
|
||||
break;
|
||||
@@ -141,12 +142,13 @@ static int __blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!blk_mq_get_dispatch_budget(q))
|
||||
budget_token = blk_mq_get_dispatch_budget(q);
|
||||
if (budget_token < 0)
|
||||
break;
|
||||
|
||||
rq = e->type->ops.dispatch_request(hctx);
|
||||
if (!rq) {
|
||||
blk_mq_put_dispatch_budget(q);
|
||||
blk_mq_put_dispatch_budget(q, budget_token);
|
||||
/*
|
||||
* We're releasing without dispatching. Holding the
|
||||
* budget could have blocked any "hctx"s with the
|
||||
@@ -158,6 +160,8 @@ static int __blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
|
||||
break;
|
||||
}
|
||||
|
||||
blk_mq_set_rq_budget_token(rq, budget_token);
|
||||
|
||||
/*
|
||||
* Now this rq owns the budget which has to be released
|
||||
* if this rq won't be queued to driver via .queue_rq()
|
||||
@@ -231,6 +235,8 @@ static int blk_mq_do_dispatch_ctx(struct blk_mq_hw_ctx *hctx)
|
||||
struct request *rq;
|
||||
|
||||
do {
|
||||
int budget_token;
|
||||
|
||||
if (!list_empty_careful(&hctx->dispatch)) {
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
@@ -239,12 +245,13 @@ static int blk_mq_do_dispatch_ctx(struct blk_mq_hw_ctx *hctx)
|
||||
if (!sbitmap_any_bit_set(&hctx->ctx_map))
|
||||
break;
|
||||
|
||||
if (!blk_mq_get_dispatch_budget(q))
|
||||
budget_token = blk_mq_get_dispatch_budget(q);
|
||||
if (budget_token < 0)
|
||||
break;
|
||||
|
||||
rq = blk_mq_dequeue_from_ctx(hctx, ctx);
|
||||
if (!rq) {
|
||||
blk_mq_put_dispatch_budget(q);
|
||||
blk_mq_put_dispatch_budget(q, budget_token);
|
||||
/*
|
||||
* We're releasing without dispatching. Holding the
|
||||
* budget could have blocked any "hctx"s with the
|
||||
@@ -256,6 +263,8 @@ static int blk_mq_do_dispatch_ctx(struct blk_mq_hw_ctx *hctx)
|
||||
break;
|
||||
}
|
||||
|
||||
blk_mq_set_rq_budget_token(rq, budget_token);
|
||||
|
||||
/*
|
||||
* Now this rq owns the budget which has to be released
|
||||
* if this rq won't be queued to driver via .queue_rq()
|
||||
|
||||
+26
-12
@@ -1278,10 +1278,15 @@ static enum prep_dispatch blk_mq_prep_dispatch_rq(struct request *rq,
|
||||
bool need_budget)
|
||||
{
|
||||
struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
|
||||
int budget_token = -1;
|
||||
|
||||
if (need_budget && !blk_mq_get_dispatch_budget(rq->q)) {
|
||||
blk_mq_put_driver_tag(rq);
|
||||
return PREP_DISPATCH_NO_BUDGET;
|
||||
if (need_budget) {
|
||||
budget_token = blk_mq_get_dispatch_budget(rq->q);
|
||||
if (budget_token < 0) {
|
||||
blk_mq_put_driver_tag(rq);
|
||||
return PREP_DISPATCH_NO_BUDGET;
|
||||
}
|
||||
blk_mq_set_rq_budget_token(rq, budget_token);
|
||||
}
|
||||
|
||||
if (!blk_mq_get_driver_tag(rq)) {
|
||||
@@ -1298,7 +1303,7 @@ static enum prep_dispatch blk_mq_prep_dispatch_rq(struct request *rq,
|
||||
* together during handling partial dispatch
|
||||
*/
|
||||
if (need_budget)
|
||||
blk_mq_put_dispatch_budget(rq->q);
|
||||
blk_mq_put_dispatch_budget(rq->q, budget_token);
|
||||
return PREP_DISPATCH_NO_TAG;
|
||||
}
|
||||
}
|
||||
@@ -1308,12 +1313,16 @@ static enum prep_dispatch blk_mq_prep_dispatch_rq(struct request *rq,
|
||||
|
||||
/* release all allocated budgets before calling to blk_mq_dispatch_rq_list */
|
||||
static void blk_mq_release_budgets(struct request_queue *q,
|
||||
unsigned int nr_budgets)
|
||||
struct list_head *list)
|
||||
{
|
||||
int i;
|
||||
struct request *rq;
|
||||
|
||||
for (i = 0; i < nr_budgets; i++)
|
||||
blk_mq_put_dispatch_budget(q);
|
||||
list_for_each_entry(rq, list, queuelist) {
|
||||
int budget_token = blk_mq_get_rq_budget_token(rq);
|
||||
|
||||
if (budget_token >= 0)
|
||||
blk_mq_put_dispatch_budget(q, budget_token);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1411,7 +1420,8 @@ out:
|
||||
(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED);
|
||||
bool no_budget_avail = prep == PREP_DISPATCH_NO_BUDGET;
|
||||
|
||||
blk_mq_release_budgets(q, nr_budgets);
|
||||
if (nr_budgets)
|
||||
blk_mq_release_budgets(q, list);
|
||||
|
||||
spin_lock(&hctx->lock);
|
||||
list_splice_tail_init(list, &hctx->dispatch);
|
||||
@@ -2011,6 +2021,7 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
|
||||
{
|
||||
struct request_queue *q = rq->q;
|
||||
bool run_queue = true;
|
||||
int budget_token;
|
||||
|
||||
/*
|
||||
* RCU or SRCU read lock is needed before checking quiesced flag.
|
||||
@@ -2028,11 +2039,14 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
|
||||
if (q->elevator && !bypass_insert)
|
||||
goto insert;
|
||||
|
||||
if (!blk_mq_get_dispatch_budget(q))
|
||||
budget_token = blk_mq_get_dispatch_budget(q);
|
||||
if (budget_token < 0)
|
||||
goto insert;
|
||||
|
||||
blk_mq_set_rq_budget_token(rq, budget_token);
|
||||
|
||||
if (!blk_mq_get_driver_tag(rq)) {
|
||||
blk_mq_put_dispatch_budget(q);
|
||||
blk_mq_put_dispatch_budget(q, budget_token);
|
||||
goto insert;
|
||||
}
|
||||
|
||||
@@ -2704,7 +2718,7 @@ blk_mq_alloc_hctx(struct request_queue *q, struct blk_mq_tag_set *set,
|
||||
goto free_cpumask;
|
||||
|
||||
if (sbitmap_init_node(&hctx->ctx_map, nr_cpu_ids, ilog2(8),
|
||||
gfp, node))
|
||||
gfp, node, false, false))
|
||||
goto free_ctxs;
|
||||
hctx->nr_ctx = 0;
|
||||
|
||||
|
||||
+21
-4
@@ -187,17 +187,34 @@ unsigned int blk_mq_in_flight(struct request_queue *q,
|
||||
void blk_mq_in_flight_rw(struct request_queue *q, struct block_device *part,
|
||||
unsigned int inflight[2]);
|
||||
|
||||
static inline void blk_mq_put_dispatch_budget(struct request_queue *q)
|
||||
static inline void blk_mq_put_dispatch_budget(struct request_queue *q,
|
||||
int budget_token)
|
||||
{
|
||||
if (q->mq_ops->put_budget)
|
||||
q->mq_ops->put_budget(q);
|
||||
q->mq_ops->put_budget(q, budget_token);
|
||||
}
|
||||
|
||||
static inline bool blk_mq_get_dispatch_budget(struct request_queue *q)
|
||||
static inline int blk_mq_get_dispatch_budget(struct request_queue *q)
|
||||
{
|
||||
if (q->mq_ops->get_budget)
|
||||
return q->mq_ops->get_budget(q);
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void blk_mq_set_rq_budget_token(struct request *rq, int token)
|
||||
{
|
||||
if (token < 0)
|
||||
return;
|
||||
|
||||
if (rq->q->mq_ops->set_rq_budget_token)
|
||||
rq->q->mq_ops->set_rq_budget_token(rq, token);
|
||||
}
|
||||
|
||||
static inline int blk_mq_get_rq_budget_token(struct request *rq)
|
||||
{
|
||||
if (rq->q->mq_ops->get_rq_budget_token)
|
||||
return rq->q->mq_ops->get_rq_budget_token(rq);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline void __blk_mq_inc_active_requests(struct blk_mq_hw_ctx *hctx)
|
||||
|
||||
@@ -478,7 +478,8 @@ static int kyber_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
|
||||
|
||||
for (i = 0; i < KYBER_NUM_DOMAINS; i++) {
|
||||
if (sbitmap_init_node(&khd->kcq_map[i], hctx->nr_ctx,
|
||||
ilog2(8), GFP_KERNEL, hctx->numa_node)) {
|
||||
ilog2(8), GFP_KERNEL, hctx->numa_node,
|
||||
false, false)) {
|
||||
while (--i >= 0)
|
||||
sbitmap_free(&khd->kcq_map[i]);
|
||||
goto err_kcqs;
|
||||
|
||||
@@ -1599,7 +1599,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
|
||||
}
|
||||
|
||||
if (qc->flags & ATA_QCFLAG_SENSE_VALID) {
|
||||
int ret = scsi_check_sense(qc->scsicmd);
|
||||
enum scsi_disposition ret = scsi_check_sense(qc->scsicmd);
|
||||
/*
|
||||
* SUCCESS here means that the sense code could be
|
||||
* evaluated and should be passed to the upper layers
|
||||
|
||||
@@ -1528,16 +1528,20 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
|
||||
goto busy;
|
||||
}
|
||||
|
||||
rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb,
|
||||
&send_ioctx->sense_data[0],
|
||||
scsilun_to_int(&srp_cmd->lun), data_len,
|
||||
TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF,
|
||||
sg, sg_cnt, NULL, 0, NULL, 0);
|
||||
rc = target_init_cmd(cmd, ch->sess, &send_ioctx->sense_data[0],
|
||||
scsilun_to_int(&srp_cmd->lun), data_len,
|
||||
TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF);
|
||||
if (rc != 0) {
|
||||
pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc,
|
||||
srp_cmd->tag);
|
||||
goto busy;
|
||||
}
|
||||
|
||||
if (target_submit_prep(cmd, srp_cmd->cdb, sg, sg_cnt, NULL, 0, NULL, 0,
|
||||
GFP_KERNEL))
|
||||
return;
|
||||
|
||||
target_submit(cmd);
|
||||
return;
|
||||
|
||||
busy:
|
||||
|
||||
@@ -424,8 +424,8 @@ typedef struct _SGE_TRANSACTION32
|
||||
U8 ContextSize;
|
||||
U8 DetailsLength;
|
||||
U8 Flags;
|
||||
U32 TransactionContext[1];
|
||||
U32 TransactionDetails[1];
|
||||
U32 TransactionContext;
|
||||
U32 TransactionDetails[];
|
||||
} SGE_TRANSACTION32, MPI_POINTER PTR_SGE_TRANSACTION32,
|
||||
SGETransaction32_t, MPI_POINTER pSGETransaction32_t;
|
||||
|
||||
|
||||
@@ -448,7 +448,7 @@ typedef struct _MSG_EVENT_NOTIFY_REPLY
|
||||
U32 IOCLogInfo; /* 10h */
|
||||
U32 Event; /* 14h */
|
||||
U32 EventContext; /* 18h */
|
||||
U32 Data[1]; /* 1Ch */
|
||||
U32 Data[]; /* 1Ch */
|
||||
} MSG_EVENT_NOTIFY_REPLY, MPI_POINTER PTR_MSG_EVENT_NOTIFY_REPLY,
|
||||
EventNotificationReply_t, MPI_POINTER pEventNotificationReply_t;
|
||||
|
||||
|
||||
@@ -3084,7 +3084,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
|
||||
int req_sz;
|
||||
int reply_sz;
|
||||
int sz;
|
||||
u32 status, vv;
|
||||
u32 vv;
|
||||
u8 shiftFactor=1;
|
||||
|
||||
/* IOC *must* NOT be in RESET state! */
|
||||
@@ -3142,7 +3142,6 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
|
||||
facts->IOCExceptions = le16_to_cpu(facts->IOCExceptions);
|
||||
facts->IOCStatus = le16_to_cpu(facts->IOCStatus);
|
||||
facts->IOCLogInfo = le32_to_cpu(facts->IOCLogInfo);
|
||||
status = le16_to_cpu(facts->IOCStatus) & MPI_IOCSTATUS_MASK;
|
||||
/* CHECKME! IOCStatus, IOCLogInfo */
|
||||
|
||||
facts->ReplyQueueDepth = le16_to_cpu(facts->ReplyQueueDepth);
|
||||
@@ -4974,7 +4973,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
|
||||
|
||||
if (hdr.PageLength > 0) {
|
||||
data_sz = hdr.PageLength * 4;
|
||||
ppage0_alloc = (LANPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
|
||||
ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
|
||||
rc = -ENOMEM;
|
||||
if (ppage0_alloc) {
|
||||
memset((u8 *)ppage0_alloc, 0, data_sz);
|
||||
@@ -5020,7 +5019,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
|
||||
|
||||
data_sz = hdr.PageLength * 4;
|
||||
rc = -ENOMEM;
|
||||
ppage1_alloc = (LANPage1_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
|
||||
ppage1_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
|
||||
if (ppage1_alloc) {
|
||||
memset((u8 *)ppage1_alloc, 0, data_sz);
|
||||
cfg.physAddr = page1_dma;
|
||||
@@ -5321,7 +5320,7 @@ GetIoUnitPage2(MPT_ADAPTER *ioc)
|
||||
/* Read the config page */
|
||||
data_sz = hdr.PageLength * 4;
|
||||
rc = -ENOMEM;
|
||||
ppage_alloc = (IOUnitPage2_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
|
||||
ppage_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
|
||||
if (ppage_alloc) {
|
||||
memset((u8 *)ppage_alloc, 0, data_sz);
|
||||
cfg.physAddr = page_dma;
|
||||
|
||||
@@ -274,7 +274,7 @@ typedef union _MPT_FRAME_TRACKER {
|
||||
} linkage;
|
||||
/*
|
||||
* NOTE: When request frames are free, on the linkage structure
|
||||
* contets are valid. All other values are invalid.
|
||||
* contents are valid. All other values are invalid.
|
||||
* In particular, do NOT reply on offset [2]
|
||||
* (in words) being the * message context.
|
||||
* The message context must be reset (computed via base address
|
||||
|
||||
@@ -321,7 +321,6 @@ mptctl_do_taskmgmt(MPT_ADAPTER *ioc, u8 tm_type, u8 bus_id, u8 target_id)
|
||||
int ii;
|
||||
int retval;
|
||||
unsigned long timeout;
|
||||
unsigned long time_count;
|
||||
u16 iocstatus;
|
||||
|
||||
|
||||
@@ -383,7 +382,6 @@ mptctl_do_taskmgmt(MPT_ADAPTER *ioc, u8 tm_type, u8 bus_id, u8 target_id)
|
||||
ioc->name, tm_type, timeout));
|
||||
|
||||
INITIALIZE_MGMT_STATUS(ioc->taskmgmt_cmds.status)
|
||||
time_count = jiffies;
|
||||
if ((ioc->facts.IOCCapabilities & MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q) &&
|
||||
(ioc->facts.MsgVersion >= MPI_VERSION_01_05))
|
||||
mpt_put_msg_frame_hi_pri(mptctl_taskmgmt_id, ioc, mf);
|
||||
@@ -1369,7 +1367,6 @@ mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg)
|
||||
int lun;
|
||||
int maxWordsLeft;
|
||||
int numBytes;
|
||||
u8 port;
|
||||
struct scsi_device *sdev;
|
||||
|
||||
if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) {
|
||||
@@ -1381,13 +1378,8 @@ mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg)
|
||||
|
||||
dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n",
|
||||
ioc->name));
|
||||
/* Get the port number and set the maximum number of bytes
|
||||
* in the returned structure.
|
||||
* Ignore the port setting.
|
||||
*/
|
||||
numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header);
|
||||
maxWordsLeft = numBytes/sizeof(int);
|
||||
port = karg.hdr.port;
|
||||
|
||||
if (maxWordsLeft <= 0) {
|
||||
printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo() - no memory available!\n",
|
||||
|
||||
@@ -67,12 +67,13 @@
|
||||
|
||||
#ifdef CONFIG_FUSION_LOGGING
|
||||
#define MPT_CHECK_LOGGING(IOC, CMD, BITS) \
|
||||
{ \
|
||||
do { \
|
||||
if (IOC->debug_level & BITS) \
|
||||
CMD; \
|
||||
}
|
||||
} while (0)
|
||||
#else
|
||||
#define MPT_CHECK_LOGGING(IOC, CMD, BITS)
|
||||
#define MPT_CHECK_LOGGING(IOC, CMD, BITS) \
|
||||
do { } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -72,9 +72,6 @@ MODULE_VERSION(my_VERSION);
|
||||
#define MPT_LAN_RECEIVE_POST_REQUEST_SIZE \
|
||||
(sizeof(LANReceivePostRequest_t) - sizeof(SGE_MPI_UNION))
|
||||
|
||||
#define MPT_LAN_TRANSACTION32_SIZE \
|
||||
(sizeof(SGETransaction32_t) - sizeof(u32))
|
||||
|
||||
/*
|
||||
* Fusion MPT LAN private structures
|
||||
*/
|
||||
@@ -745,7 +742,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
|
||||
pTrans->ContextSize = sizeof(u32);
|
||||
pTrans->DetailsLength = 2 * sizeof(u32);
|
||||
pTrans->Flags = 0;
|
||||
pTrans->TransactionContext[0] = cpu_to_le32(ctx);
|
||||
pTrans->TransactionContext = cpu_to_le32(ctx);
|
||||
|
||||
// dioprintk((KERN_INFO MYNAM ": %s/%s: BC = %08x, skb = %p, buff = %p\n",
|
||||
// IOC_AND_NETDEV_NAMES_s_s(dev),
|
||||
@@ -1159,7 +1156,7 @@ mpt_lan_post_receive_buckets(struct mpt_lan_priv *priv)
|
||||
__func__, buckets, curr));
|
||||
|
||||
max = (mpt_dev->req_sz - MPT_LAN_RECEIVE_POST_REQUEST_SIZE) /
|
||||
(MPT_LAN_TRANSACTION32_SIZE + sizeof(SGESimple64_t));
|
||||
(sizeof(SGETransaction32_t) + sizeof(SGESimple64_t));
|
||||
|
||||
while (buckets) {
|
||||
mf = mpt_get_msg_frame(LanCtx, mpt_dev);
|
||||
@@ -1234,7 +1231,7 @@ mpt_lan_post_receive_buckets(struct mpt_lan_priv *priv)
|
||||
pTrans->ContextSize = sizeof(u32);
|
||||
pTrans->DetailsLength = 0;
|
||||
pTrans->Flags = 0;
|
||||
pTrans->TransactionContext[0] = cpu_to_le32(ctx);
|
||||
pTrans->TransactionContext = cpu_to_le32(ctx);
|
||||
|
||||
pSimple = (SGESimple64_t *) pTrans->TransactionDetails;
|
||||
|
||||
|
||||
@@ -780,13 +780,11 @@ static void
|
||||
mptsas_add_device_component_starget(MPT_ADAPTER *ioc,
|
||||
struct scsi_target *starget)
|
||||
{
|
||||
VirtTarget *vtarget;
|
||||
struct sas_rphy *rphy;
|
||||
struct mptsas_phyinfo *phy_info = NULL;
|
||||
struct mptsas_enclosure enclosure_info;
|
||||
|
||||
rphy = dev_to_rphy(starget->dev.parent);
|
||||
vtarget = starget->hostdata;
|
||||
phy_info = mptsas_find_phyinfo_by_sas_address(ioc,
|
||||
rphy->identify.sas_address);
|
||||
if (!phy_info)
|
||||
@@ -3442,14 +3440,12 @@ mptsas_expander_event_add(MPT_ADAPTER *ioc,
|
||||
__le64 sas_address;
|
||||
|
||||
port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL);
|
||||
if (!port_info)
|
||||
BUG();
|
||||
BUG_ON(!port_info);
|
||||
port_info->num_phys = (expander_data->NumPhys) ?
|
||||
expander_data->NumPhys : 1;
|
||||
port_info->phy_info = kcalloc(port_info->num_phys,
|
||||
sizeof(struct mptsas_phyinfo), GFP_KERNEL);
|
||||
if (!port_info->phy_info)
|
||||
BUG();
|
||||
BUG_ON(!port_info->phy_info);
|
||||
memcpy(&sas_address, &expander_data->SASAddress, sizeof(__le64));
|
||||
for (i = 0; i < port_info->num_phys; i++) {
|
||||
port_info->phy_info[i].portinfo = port_info;
|
||||
@@ -3781,7 +3777,7 @@ mptsas_send_link_status_event(struct fw_event_work *fw_event)
|
||||
printk(MYIOC_s_DEBUG_FMT
|
||||
"SDEV OUTSTANDING CMDS"
|
||||
"%d\n", ioc->name,
|
||||
atomic_read(&sdev->device_busy)));
|
||||
scsi_device_busy(sdev)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -413,12 +413,8 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device)
|
||||
|
||||
dev_set_drvdata(&ccw_device->dev, adapter);
|
||||
|
||||
if (sysfs_create_group(&ccw_device->dev.kobj,
|
||||
&zfcp_sysfs_adapter_attrs))
|
||||
goto failed;
|
||||
|
||||
if (zfcp_diag_sysfs_setup(adapter))
|
||||
goto failed;
|
||||
if (device_add_groups(&ccw_device->dev, zfcp_sysfs_adapter_attr_groups))
|
||||
goto err_sysfs;
|
||||
|
||||
/* report size limit per scatter-gather segment */
|
||||
adapter->ccw_device->dev.dma_parms = &adapter->dma_parms;
|
||||
@@ -427,8 +423,23 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device)
|
||||
|
||||
return adapter;
|
||||
|
||||
err_sysfs:
|
||||
failed:
|
||||
zfcp_adapter_unregister(adapter);
|
||||
/* TODO: make this more fine-granular */
|
||||
cancel_delayed_work_sync(&adapter->scan_work);
|
||||
cancel_work_sync(&adapter->stat_work);
|
||||
cancel_work_sync(&adapter->ns_up_work);
|
||||
cancel_work_sync(&adapter->version_change_lost_work);
|
||||
zfcp_destroy_adapter_work_queue(adapter);
|
||||
|
||||
zfcp_fc_wka_ports_force_offline(adapter->gs);
|
||||
zfcp_scsi_adapter_unregister(adapter);
|
||||
|
||||
zfcp_erp_thread_kill(adapter);
|
||||
zfcp_dbf_adapter_unregister(adapter);
|
||||
zfcp_qdio_destroy(adapter->qdio);
|
||||
|
||||
zfcp_ccw_adapter_put(adapter); /* final put to release */
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
@@ -444,8 +455,7 @@ void zfcp_adapter_unregister(struct zfcp_adapter *adapter)
|
||||
|
||||
zfcp_fc_wka_ports_force_offline(adapter->gs);
|
||||
zfcp_scsi_adapter_unregister(adapter);
|
||||
zfcp_diag_sysfs_destroy(adapter);
|
||||
sysfs_remove_group(&cdev->dev.kobj, &zfcp_sysfs_adapter_attrs);
|
||||
device_remove_groups(&cdev->dev, zfcp_sysfs_adapter_attr_groups);
|
||||
|
||||
zfcp_erp_thread_kill(adapter);
|
||||
zfcp_dbf_adapter_unregister(adapter);
|
||||
|
||||
@@ -156,7 +156,7 @@ struct zfcp_adapter {
|
||||
u32 fsf_lic_version;
|
||||
u32 adapter_features; /* FCP channel features */
|
||||
u32 connection_features; /* host connection features */
|
||||
u32 hardware_version; /* of FCP channel */
|
||||
u32 hardware_version; /* of FCP channel */
|
||||
u32 fc_security_algorithms; /* of FCP channel */
|
||||
u32 fc_security_algorithms_old; /* of FCP channel */
|
||||
u16 timer_ticks; /* time int for a tick */
|
||||
@@ -180,7 +180,7 @@ struct zfcp_adapter {
|
||||
rwlock_t erp_lock;
|
||||
wait_queue_head_t erp_done_wqh;
|
||||
struct zfcp_erp_action erp_action; /* pending error recovery */
|
||||
atomic_t erp_counter;
|
||||
atomic_t erp_counter;
|
||||
u32 erp_total_count; /* total nr of enqueued erp
|
||||
actions */
|
||||
u32 erp_low_mem_count; /* nr of erp actions waiting
|
||||
@@ -217,7 +217,7 @@ struct zfcp_port {
|
||||
u32 d_id; /* D_ID */
|
||||
u32 handle; /* handle assigned by FSF */
|
||||
struct zfcp_erp_action erp_action; /* pending error recovery */
|
||||
atomic_t erp_counter;
|
||||
atomic_t erp_counter;
|
||||
u32 maxframe_size;
|
||||
u32 supported_classes;
|
||||
u32 connection_info;
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/kernfs.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
@@ -79,46 +77,6 @@ void zfcp_diag_adapter_free(struct zfcp_adapter *const adapter)
|
||||
adapter->diagnostics = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_diag_sysfs_setup() - Setup the sysfs-group for adapter-diagnostics.
|
||||
* @adapter: target adapter to which the group should be added.
|
||||
*
|
||||
* Return: 0 on success; Something else otherwise (see sysfs_create_group()).
|
||||
*/
|
||||
int zfcp_diag_sysfs_setup(struct zfcp_adapter *const adapter)
|
||||
{
|
||||
int rc = sysfs_create_group(&adapter->ccw_device->dev.kobj,
|
||||
&zfcp_sysfs_diag_attr_group);
|
||||
if (rc == 0)
|
||||
adapter->diagnostics->sysfs_established = 1;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_diag_sysfs_destroy() - Remove the sysfs-group for adapter-diagnostics.
|
||||
* @adapter: target adapter from which the group should be removed.
|
||||
*/
|
||||
void zfcp_diag_sysfs_destroy(struct zfcp_adapter *const adapter)
|
||||
{
|
||||
if (adapter->diagnostics == NULL ||
|
||||
!adapter->diagnostics->sysfs_established)
|
||||
return;
|
||||
|
||||
/*
|
||||
* We need this state-handling so we can prevent warnings being printed
|
||||
* on the kernel-console in case we have to abort a halfway done
|
||||
* zfcp_adapter_enqueue(), in which the sysfs-group was not yet
|
||||
* established. sysfs_remove_group() does this checking as well, but
|
||||
* still prints a warning in case we try to remove a group that has not
|
||||
* been established before
|
||||
*/
|
||||
adapter->diagnostics->sysfs_established = 0;
|
||||
sysfs_remove_group(&adapter->ccw_device->dev.kobj,
|
||||
&zfcp_sysfs_diag_attr_group);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* zfcp_diag_update_xdata() - Update a diagnostics buffer.
|
||||
* @hdr: the meta data to update.
|
||||
|
||||
@@ -40,8 +40,6 @@ struct zfcp_diag_header {
|
||||
/**
|
||||
* struct zfcp_diag_adapter - central storage for all diagnostics concerning an
|
||||
* adapter.
|
||||
* @sysfs_established: flag showing that the associated sysfs-group was created
|
||||
* during run of zfcp_adapter_enqueue().
|
||||
* @max_age: maximum age of data in diagnostic buffers before they need to be
|
||||
* refreshed (in ms).
|
||||
* @port_data: data retrieved using exchange port data.
|
||||
@@ -52,8 +50,6 @@ struct zfcp_diag_header {
|
||||
* @config_data.data: cached QTCB Bottom of command exchange config data.
|
||||
*/
|
||||
struct zfcp_diag_adapter {
|
||||
u64 sysfs_established :1;
|
||||
|
||||
unsigned long max_age;
|
||||
|
||||
struct zfcp_diag_adapter_port_data {
|
||||
@@ -69,9 +65,6 @@ struct zfcp_diag_adapter {
|
||||
int zfcp_diag_adapter_setup(struct zfcp_adapter *const adapter);
|
||||
void zfcp_diag_adapter_free(struct zfcp_adapter *const adapter);
|
||||
|
||||
int zfcp_diag_sysfs_setup(struct zfcp_adapter *const adapter);
|
||||
void zfcp_diag_sysfs_destroy(struct zfcp_adapter *const adapter);
|
||||
|
||||
void zfcp_diag_update_xdata(struct zfcp_diag_header *const hdr,
|
||||
const void *const data, const bool incomplete);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define ZFCP_EXT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <scsi/fc/fc_els.h>
|
||||
#include "zfcp_def.h"
|
||||
#include "zfcp_fc.h"
|
||||
@@ -179,13 +180,12 @@ extern void zfcp_scsi_shost_update_port_data(
|
||||
const struct fsf_qtcb_bottom_port *const bottom);
|
||||
|
||||
/* zfcp_sysfs.c */
|
||||
extern const struct attribute_group *zfcp_sysfs_adapter_attr_groups[];
|
||||
extern const struct attribute_group *zfcp_unit_attr_groups[];
|
||||
extern struct attribute_group zfcp_sysfs_adapter_attrs;
|
||||
extern const struct attribute_group *zfcp_port_attr_groups[];
|
||||
extern struct mutex zfcp_sysfs_port_units_mutex;
|
||||
extern struct device_attribute *zfcp_sysfs_sdev_attrs[];
|
||||
extern struct device_attribute *zfcp_sysfs_shost_attrs[];
|
||||
extern const struct attribute_group zfcp_sysfs_diag_attr_group;
|
||||
bool zfcp_sysfs_port_is_removing(const struct zfcp_port *const port);
|
||||
|
||||
/* zfcp_unit.c */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user