Skip to content

Commit d72cd4a

Browse files
committed
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 ...
2 parents 238da4d + 7a3beea commit d72cd4a

File tree

256 files changed

+7213
-5353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+7213
-5353
lines changed

Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Required properties:
1414
"qcom,msm8998-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
1515
"qcom,sdm845-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
1616
"qcom,sm8150-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
17+
"qcom,sm8250-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
18+
"qcom,sm8350-ufshc", "qcom,ufshc", "jedec,ufs-2.0"
1719
- interrupts : <interrupt mapping for UFS host controller IRQ>
1820
- reg : <registers mapping>
1921

block/blk-mq-sched.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ static int __blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
132132

133133
do {
134134
struct request *rq;
135+
int budget_token;
135136

136137
if (e->type->ops.has_work && !e->type->ops.has_work(hctx))
137138
break;
@@ -141,12 +142,13 @@ static int __blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
141142
break;
142143
}
143144

144-
if (!blk_mq_get_dispatch_budget(q))
145+
budget_token = blk_mq_get_dispatch_budget(q);
146+
if (budget_token < 0)
145147
break;
146148

147149
rq = e->type->ops.dispatch_request(hctx);
148150
if (!rq) {
149-
blk_mq_put_dispatch_budget(q);
151+
blk_mq_put_dispatch_budget(q, budget_token);
150152
/*
151153
* We're releasing without dispatching. Holding the
152154
* 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)
158160
break;
159161
}
160162

163+
blk_mq_set_rq_budget_token(rq, budget_token);
164+
161165
/*
162166
* Now this rq owns the budget which has to be released
163167
* 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)
231235
struct request *rq;
232236

233237
do {
238+
int budget_token;
239+
234240
if (!list_empty_careful(&hctx->dispatch)) {
235241
ret = -EAGAIN;
236242
break;
@@ -239,12 +245,13 @@ static int blk_mq_do_dispatch_ctx(struct blk_mq_hw_ctx *hctx)
239245
if (!sbitmap_any_bit_set(&hctx->ctx_map))
240246
break;
241247

242-
if (!blk_mq_get_dispatch_budget(q))
248+
budget_token = blk_mq_get_dispatch_budget(q);
249+
if (budget_token < 0)
243250
break;
244251

245252
rq = blk_mq_dequeue_from_ctx(hctx, ctx);
246253
if (!rq) {
247-
blk_mq_put_dispatch_budget(q);
254+
blk_mq_put_dispatch_budget(q, budget_token);
248255
/*
249256
* We're releasing without dispatching. Holding the
250257
* 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)
256263
break;
257264
}
258265

266+
blk_mq_set_rq_budget_token(rq, budget_token);
267+
259268
/*
260269
* Now this rq owns the budget which has to be released
261270
* if this rq won't be queued to driver via .queue_rq()

block/blk-mq.c

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,10 +1278,15 @@ static enum prep_dispatch blk_mq_prep_dispatch_rq(struct request *rq,
12781278
bool need_budget)
12791279
{
12801280
struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
1281+
int budget_token = -1;
12811282

1282-
if (need_budget && !blk_mq_get_dispatch_budget(rq->q)) {
1283-
blk_mq_put_driver_tag(rq);
1284-
return PREP_DISPATCH_NO_BUDGET;
1283+
if (need_budget) {
1284+
budget_token = blk_mq_get_dispatch_budget(rq->q);
1285+
if (budget_token < 0) {
1286+
blk_mq_put_driver_tag(rq);
1287+
return PREP_DISPATCH_NO_BUDGET;
1288+
}
1289+
blk_mq_set_rq_budget_token(rq, budget_token);
12851290
}
12861291

12871292
if (!blk_mq_get_driver_tag(rq)) {
@@ -1298,7 +1303,7 @@ static enum prep_dispatch blk_mq_prep_dispatch_rq(struct request *rq,
12981303
* together during handling partial dispatch
12991304
*/
13001305
if (need_budget)
1301-
blk_mq_put_dispatch_budget(rq->q);
1306+
blk_mq_put_dispatch_budget(rq->q, budget_token);
13021307
return PREP_DISPATCH_NO_TAG;
13031308
}
13041309
}
@@ -1308,12 +1313,16 @@ static enum prep_dispatch blk_mq_prep_dispatch_rq(struct request *rq,
13081313

13091314
/* release all allocated budgets before calling to blk_mq_dispatch_rq_list */
13101315
static void blk_mq_release_budgets(struct request_queue *q,
1311-
unsigned int nr_budgets)
1316+
struct list_head *list)
13121317
{
1313-
int i;
1318+
struct request *rq;
13141319

1315-
for (i = 0; i < nr_budgets; i++)
1316-
blk_mq_put_dispatch_budget(q);
1320+
list_for_each_entry(rq, list, queuelist) {
1321+
int budget_token = blk_mq_get_rq_budget_token(rq);
1322+
1323+
if (budget_token >= 0)
1324+
blk_mq_put_dispatch_budget(q, budget_token);
1325+
}
13171326
}
13181327

13191328
/*
@@ -1411,7 +1420,8 @@ bool blk_mq_dispatch_rq_list(struct blk_mq_hw_ctx *hctx, struct list_head *list,
14111420
(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED);
14121421
bool no_budget_avail = prep == PREP_DISPATCH_NO_BUDGET;
14131422

1414-
blk_mq_release_budgets(q, nr_budgets);
1423+
if (nr_budgets)
1424+
blk_mq_release_budgets(q, list);
14151425

14161426
spin_lock(&hctx->lock);
14171427
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,
20112021
{
20122022
struct request_queue *q = rq->q;
20132023
bool run_queue = true;
2024+
int budget_token;
20142025

20152026
/*
20162027
* 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,
20282039
if (q->elevator && !bypass_insert)
20292040
goto insert;
20302041

2031-
if (!blk_mq_get_dispatch_budget(q))
2042+
budget_token = blk_mq_get_dispatch_budget(q);
2043+
if (budget_token < 0)
20322044
goto insert;
20332045

2046+
blk_mq_set_rq_budget_token(rq, budget_token);
2047+
20342048
if (!blk_mq_get_driver_tag(rq)) {
2035-
blk_mq_put_dispatch_budget(q);
2049+
blk_mq_put_dispatch_budget(q, budget_token);
20362050
goto insert;
20372051
}
20382052

@@ -2704,7 +2718,7 @@ blk_mq_alloc_hctx(struct request_queue *q, struct blk_mq_tag_set *set,
27042718
goto free_cpumask;
27052719

27062720
if (sbitmap_init_node(&hctx->ctx_map, nr_cpu_ids, ilog2(8),
2707-
gfp, node))
2721+
gfp, node, false, false))
27082722
goto free_ctxs;
27092723
hctx->nr_ctx = 0;
27102724

block/blk-mq.h

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,34 @@ unsigned int blk_mq_in_flight(struct request_queue *q,
187187
void blk_mq_in_flight_rw(struct request_queue *q, struct block_device *part,
188188
unsigned int inflight[2]);
189189

190-
static inline void blk_mq_put_dispatch_budget(struct request_queue *q)
190+
static inline void blk_mq_put_dispatch_budget(struct request_queue *q,
191+
int budget_token)
191192
{
192193
if (q->mq_ops->put_budget)
193-
q->mq_ops->put_budget(q);
194+
q->mq_ops->put_budget(q, budget_token);
194195
}
195196

196-
static inline bool blk_mq_get_dispatch_budget(struct request_queue *q)
197+
static inline int blk_mq_get_dispatch_budget(struct request_queue *q)
197198
{
198199
if (q->mq_ops->get_budget)
199200
return q->mq_ops->get_budget(q);
200-
return true;
201+
return 0;
202+
}
203+
204+
static inline void blk_mq_set_rq_budget_token(struct request *rq, int token)
205+
{
206+
if (token < 0)
207+
return;
208+
209+
if (rq->q->mq_ops->set_rq_budget_token)
210+
rq->q->mq_ops->set_rq_budget_token(rq, token);
211+
}
212+
213+
static inline int blk_mq_get_rq_budget_token(struct request *rq)
214+
{
215+
if (rq->q->mq_ops->get_rq_budget_token)
216+
return rq->q->mq_ops->get_rq_budget_token(rq);
217+
return -1;
201218
}
202219

203220
static inline void __blk_mq_inc_active_requests(struct blk_mq_hw_ctx *hctx)

block/kyber-iosched.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ static int kyber_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
478478

479479
for (i = 0; i < KYBER_NUM_DOMAINS; i++) {
480480
if (sbitmap_init_node(&khd->kcq_map[i], hctx->nr_ctx,
481-
ilog2(8), GFP_KERNEL, hctx->numa_node)) {
481+
ilog2(8), GFP_KERNEL, hctx->numa_node,
482+
false, false)) {
482483
while (--i >= 0)
483484
sbitmap_free(&khd->kcq_map[i]);
484485
goto err_kcqs;

drivers/ata/libata-eh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
15991599
}
16001600

16011601
if (qc->flags & ATA_QCFLAG_SENSE_VALID) {
1602-
int ret = scsi_check_sense(qc->scsicmd);
1602+
enum scsi_disposition ret = scsi_check_sense(qc->scsicmd);
16031603
/*
16041604
* SUCCESS here means that the sense code could be
16051605
* evaluated and should be passed to the upper layers

drivers/infiniband/ulp/srpt/ib_srpt.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,16 +1528,20 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch,
15281528
goto busy;
15291529
}
15301530

1531-
rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb,
1532-
&send_ioctx->sense_data[0],
1533-
scsilun_to_int(&srp_cmd->lun), data_len,
1534-
TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF,
1535-
sg, sg_cnt, NULL, 0, NULL, 0);
1531+
rc = target_init_cmd(cmd, ch->sess, &send_ioctx->sense_data[0],
1532+
scsilun_to_int(&srp_cmd->lun), data_len,
1533+
TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF);
15361534
if (rc != 0) {
15371535
pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc,
15381536
srp_cmd->tag);
15391537
goto busy;
15401538
}
1539+
1540+
if (target_submit_prep(cmd, srp_cmd->cdb, sg, sg_cnt, NULL, 0, NULL, 0,
1541+
GFP_KERNEL))
1542+
return;
1543+
1544+
target_submit(cmd);
15411545
return;
15421546

15431547
busy:

drivers/message/fusion/lsi/mpi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ typedef struct _SGE_TRANSACTION32
424424
U8 ContextSize;
425425
U8 DetailsLength;
426426
U8 Flags;
427-
U32 TransactionContext[1];
428-
U32 TransactionDetails[1];
427+
U32 TransactionContext;
428+
U32 TransactionDetails[];
429429
} SGE_TRANSACTION32, MPI_POINTER PTR_SGE_TRANSACTION32,
430430
SGETransaction32_t, MPI_POINTER pSGETransaction32_t;
431431

drivers/message/fusion/lsi/mpi_ioc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ typedef struct _MSG_EVENT_NOTIFY_REPLY
448448
U32 IOCLogInfo; /* 10h */
449449
U32 Event; /* 14h */
450450
U32 EventContext; /* 18h */
451-
U32 Data[1]; /* 1Ch */
451+
U32 Data[]; /* 1Ch */
452452
} MSG_EVENT_NOTIFY_REPLY, MPI_POINTER PTR_MSG_EVENT_NOTIFY_REPLY,
453453
EventNotificationReply_t, MPI_POINTER pEventNotificationReply_t;
454454

drivers/message/fusion/mptbase.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3084,7 +3084,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
30843084
int req_sz;
30853085
int reply_sz;
30863086
int sz;
3087-
u32 status, vv;
3087+
u32 vv;
30883088
u8 shiftFactor=1;
30893089

30903090
/* IOC *must* NOT be in RESET state! */
@@ -3142,7 +3142,6 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
31423142
facts->IOCExceptions = le16_to_cpu(facts->IOCExceptions);
31433143
facts->IOCStatus = le16_to_cpu(facts->IOCStatus);
31443144
facts->IOCLogInfo = le32_to_cpu(facts->IOCLogInfo);
3145-
status = le16_to_cpu(facts->IOCStatus) & MPI_IOCSTATUS_MASK;
31463145
/* CHECKME! IOCStatus, IOCLogInfo */
31473146

31483147
facts->ReplyQueueDepth = le16_to_cpu(facts->ReplyQueueDepth);
@@ -4974,7 +4973,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
49744973

49754974
if (hdr.PageLength > 0) {
49764975
data_sz = hdr.PageLength * 4;
4977-
ppage0_alloc = (LANPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
4976+
ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
49784977
rc = -ENOMEM;
49794978
if (ppage0_alloc) {
49804979
memset((u8 *)ppage0_alloc, 0, data_sz);
@@ -5020,7 +5019,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
50205019

50215020
data_sz = hdr.PageLength * 4;
50225021
rc = -ENOMEM;
5023-
ppage1_alloc = (LANPage1_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
5022+
ppage1_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
50245023
if (ppage1_alloc) {
50255024
memset((u8 *)ppage1_alloc, 0, data_sz);
50265025
cfg.physAddr = page1_dma;
@@ -5321,7 +5320,7 @@ GetIoUnitPage2(MPT_ADAPTER *ioc)
53215320
/* Read the config page */
53225321
data_sz = hdr.PageLength * 4;
53235322
rc = -ENOMEM;
5324-
ppage_alloc = (IOUnitPage2_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
5323+
ppage_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
53255324
if (ppage_alloc) {
53265325
memset((u8 *)ppage_alloc, 0, data_sz);
53275326
cfg.physAddr = page_dma;

0 commit comments

Comments
 (0)