mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
for-linus-20180616
-----BEGIN PGP SIGNATURE-----
iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAlslJkoQHGF4Ym9lQGtl
cm5lbC5kawAKCRD301j7KXHgpi3READZgtKEaixC4EMLNH/7WqVLC5XxsIpuV3N7
kxaV2KoJ/zJbBPqE+WIW/UasuTRkIFQpmXp3aYw879FZfCq1sN7K9yyzY2i7qvuG
l8WRPWFc2SMfMrXb3pctGiNyYhTIZrOOzPmKAwlNinyyr7tlan2Ha4z5XHOJon9O
uVk252kTlBqvTEX4nZKN2x6UiI9RaVegbOV6lthm3lQZF+25C6kN/8emdkhDIkjG
mOI8MaHp6iDbpIBWBziEpkvGxvxO4PAaESldyJH6Fg+uzmNEDEwp6jvFBmlCiQIE
wdt5Swsl2zKk8g/tBHeDSDK0inHnP5xho4tC68rDtLrgxyLeBuVjyLMItkYJdTqh
s8B5gdCs3SS41aXMk+w3BnLBIRRMrByGiY2Nx23Si6KZU8pT5sM0dGGOTGCma1dy
NNitIRbePyrajV2p/xqnMeiGvxqnCckRRYr0uV2KPJzqwwMoZvNsnS+XL2KqdgCY
ndK5Nda5oRb+yDDlPKlRvY8cKh1N8GWdoFIGbfrMIYJcGiUXBoX7UoA/DKKbnY2o
p+TE3t9RGz9UPwxHqSMTXRV+xs4X3lgWf4sA/ciGGPeuAgwdOoGJnfn4kY7AIPq8
LYXj8K4rx3cRA+l7Y4DCppPQEl8bxKXhFFccKsXToFITW+PNdCuM7FDugOHdzwQE
QlesAkLV+w==
=gyaY
-----END PGP SIGNATURE-----
Merge tag 'for-linus-20180616' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
"A collection of fixes that should go into -rc1. This contains:
- bsg_open vs bsg_unregister race fix (Anatoliy)
- NVMe pull request from Christoph, with fixes for regressions in
this window, FC connect/reconnect path code unification, and a
trace point addition.
- timeout fix (Christoph)
- remove a few unused functions (Christoph)
- blk-mq tag_set reinit fix (Roman)"
* tag 'for-linus-20180616' of git://git.kernel.dk/linux-block:
bsg: fix race of bsg_open and bsg_unregister
block: remov blk_queue_invalidate_tags
nvme-fabrics: fix and refine state checks in __nvmf_check_ready
nvme-fabrics: handle the admin-only case properly in nvmf_check_ready
nvme-fabrics: refactor queue ready check
blk-mq: remove blk_mq_tagset_iter
nvme: remove nvme_reinit_tagset
nvme-fc: fix nulling of queue data on reconnect
nvme-fc: remove reinit_request routine
blk-mq: don't time out requests again that are in the timeout handler
nvme-fc: change controllers first connect to use reconnect path
nvme: don't rely on the changed namespace list log
nvmet: free smart-log buffer after use
nvme-rdma: fix error flow during mapping request data
nvme: add bio remapping tracepoint
nvme: fix NULL pointer dereference in nvme_init_subsystem
blk-mq: reinit q->tag_set_list entry only after grace period
This commit is contained in:
commit
265c5596da
16 changed files with 174 additions and 275 deletions
|
|
@ -311,35 +311,6 @@ void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
|
|||
}
|
||||
EXPORT_SYMBOL(blk_mq_tagset_busy_iter);
|
||||
|
||||
int blk_mq_tagset_iter(struct blk_mq_tag_set *set, void *data,
|
||||
int (fn)(void *, struct request *))
|
||||
{
|
||||
int i, j, ret = 0;
|
||||
|
||||
if (WARN_ON_ONCE(!fn))
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < set->nr_hw_queues; i++) {
|
||||
struct blk_mq_tags *tags = set->tags[i];
|
||||
|
||||
if (!tags)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < tags->nr_tags; j++) {
|
||||
if (!tags->static_rqs[j])
|
||||
continue;
|
||||
|
||||
ret = fn(data, tags->static_rqs[j]);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_mq_tagset_iter);
|
||||
|
||||
void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn,
|
||||
void *priv)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -671,6 +671,7 @@ static void __blk_mq_requeue_request(struct request *rq)
|
|||
|
||||
if (blk_mq_request_started(rq)) {
|
||||
WRITE_ONCE(rq->state, MQ_RQ_IDLE);
|
||||
rq->rq_flags &= ~RQF_TIMED_OUT;
|
||||
if (q->dma_drain_size && blk_rq_bytes(rq))
|
||||
rq->nr_phys_segments--;
|
||||
}
|
||||
|
|
@ -770,6 +771,7 @@ EXPORT_SYMBOL(blk_mq_tag_to_rq);
|
|||
|
||||
static void blk_mq_rq_timed_out(struct request *req, bool reserved)
|
||||
{
|
||||
req->rq_flags |= RQF_TIMED_OUT;
|
||||
if (req->q->mq_ops->timeout) {
|
||||
enum blk_eh_timer_return ret;
|
||||
|
||||
|
|
@ -779,6 +781,7 @@ static void blk_mq_rq_timed_out(struct request *req, bool reserved)
|
|||
WARN_ON_ONCE(ret != BLK_EH_RESET_TIMER);
|
||||
}
|
||||
|
||||
req->rq_flags &= ~RQF_TIMED_OUT;
|
||||
blk_add_timer(req);
|
||||
}
|
||||
|
||||
|
|
@ -788,6 +791,8 @@ static bool blk_mq_req_expired(struct request *rq, unsigned long *next)
|
|||
|
||||
if (blk_mq_rq_state(rq) != MQ_RQ_IN_FLIGHT)
|
||||
return false;
|
||||
if (rq->rq_flags & RQF_TIMED_OUT)
|
||||
return false;
|
||||
|
||||
deadline = blk_rq_deadline(rq);
|
||||
if (time_after_eq(jiffies, deadline))
|
||||
|
|
@ -2349,7 +2354,6 @@ static void blk_mq_del_queue_tag_set(struct request_queue *q)
|
|||
|
||||
mutex_lock(&set->tag_list_lock);
|
||||
list_del_rcu(&q->tag_set_list);
|
||||
INIT_LIST_HEAD(&q->tag_set_list);
|
||||
if (list_is_singular(&set->tag_list)) {
|
||||
/* just transitioned to unshared */
|
||||
set->flags &= ~BLK_MQ_F_TAG_SHARED;
|
||||
|
|
@ -2357,8 +2361,8 @@ static void blk_mq_del_queue_tag_set(struct request_queue *q)
|
|||
blk_mq_update_tag_set_depth(set, false);
|
||||
}
|
||||
mutex_unlock(&set->tag_list_lock);
|
||||
|
||||
synchronize_rcu();
|
||||
INIT_LIST_HEAD(&q->tag_set_list);
|
||||
}
|
||||
|
||||
static void blk_mq_add_queue_tag_set(struct blk_mq_tag_set *set,
|
||||
|
|
|
|||
|
|
@ -188,7 +188,6 @@ int blk_queue_init_tags(struct request_queue *q, int depth,
|
|||
*/
|
||||
q->queue_tags = tags;
|
||||
queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, q);
|
||||
INIT_LIST_HEAD(&q->tag_busy_list);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(blk_queue_init_tags);
|
||||
|
|
@ -374,27 +373,6 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
|
|||
rq->tag = tag;
|
||||
bqt->tag_index[tag] = rq;
|
||||
blk_start_request(rq);
|
||||
list_add(&rq->queuelist, &q->tag_busy_list);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(blk_queue_start_tag);
|
||||
|
||||
/**
|
||||
* blk_queue_invalidate_tags - invalidate all pending tags
|
||||
* @q: the request queue for the device
|
||||
*
|
||||
* Description:
|
||||
* Hardware conditions may dictate a need to stop all pending requests.
|
||||
* In this case, we will safely clear the block side of the tag queue and
|
||||
* readd all requests to the request queue in the right order.
|
||||
**/
|
||||
void blk_queue_invalidate_tags(struct request_queue *q)
|
||||
{
|
||||
struct list_head *tmp, *n;
|
||||
|
||||
lockdep_assert_held(q->queue_lock);
|
||||
|
||||
list_for_each_safe(tmp, n, &q->tag_busy_list)
|
||||
blk_requeue_request(q, list_entry_rq(tmp));
|
||||
}
|
||||
EXPORT_SYMBOL(blk_queue_invalidate_tags);
|
||||
|
|
|
|||
22
block/bsg.c
22
block/bsg.c
|
|
@ -693,6 +693,8 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
|
|||
struct bsg_device *bd;
|
||||
unsigned char buf[32];
|
||||
|
||||
lockdep_assert_held(&bsg_mutex);
|
||||
|
||||
if (!blk_get_queue(rq))
|
||||
return ERR_PTR(-ENXIO);
|
||||
|
||||
|
|
@ -707,14 +709,12 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
|
|||
bsg_set_block(bd, file);
|
||||
|
||||
atomic_set(&bd->ref_count, 1);
|
||||
mutex_lock(&bsg_mutex);
|
||||
hlist_add_head(&bd->dev_list, bsg_dev_idx_hash(iminor(inode)));
|
||||
|
||||
strncpy(bd->name, dev_name(rq->bsg_dev.class_dev), sizeof(bd->name) - 1);
|
||||
bsg_dbg(bd, "bound to <%s>, max queue %d\n",
|
||||
format_dev_t(buf, inode->i_rdev), bd->max_queue);
|
||||
|
||||
mutex_unlock(&bsg_mutex);
|
||||
return bd;
|
||||
}
|
||||
|
||||
|
|
@ -722,7 +722,7 @@ static struct bsg_device *__bsg_get_device(int minor, struct request_queue *q)
|
|||
{
|
||||
struct bsg_device *bd;
|
||||
|
||||
mutex_lock(&bsg_mutex);
|
||||
lockdep_assert_held(&bsg_mutex);
|
||||
|
||||
hlist_for_each_entry(bd, bsg_dev_idx_hash(minor), dev_list) {
|
||||
if (bd->queue == q) {
|
||||
|
|
@ -732,7 +732,6 @@ static struct bsg_device *__bsg_get_device(int minor, struct request_queue *q)
|
|||
}
|
||||
bd = NULL;
|
||||
found:
|
||||
mutex_unlock(&bsg_mutex);
|
||||
return bd;
|
||||
}
|
||||
|
||||
|
|
@ -746,17 +745,18 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file)
|
|||
*/
|
||||
mutex_lock(&bsg_mutex);
|
||||
bcd = idr_find(&bsg_minor_idr, iminor(inode));
|
||||
mutex_unlock(&bsg_mutex);
|
||||
|
||||
if (!bcd)
|
||||
return ERR_PTR(-ENODEV);
|
||||
if (!bcd) {
|
||||
bd = ERR_PTR(-ENODEV);
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
bd = __bsg_get_device(iminor(inode), bcd->queue);
|
||||
if (bd)
|
||||
return bd;
|
||||
|
||||
bd = bsg_add_device(inode, bcd->queue, file);
|
||||
if (!bd)
|
||||
bd = bsg_add_device(inode, bcd->queue, file);
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&bsg_mutex);
|
||||
return bd;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue