static void long_seq_test_free_end_io_fn(struct request *rq, int err) { struct test_request *test_rq; struct test_data *ptd = test_get_test_data(); if (rq) test_rq = (struct test_request *)rq->elv.priv[0]; else { test_pr_err("%s: error: NULL request", __func__); return; } BUG_ON(!test_rq); spin_lock_irq(&ptd->lock); ptd->dispatched_count--; list_del_init(&test_rq->queuelist); __blk_put_request(ptd->req_q, test_rq->rq); spin_unlock_irq(&ptd->lock); kfree(test_rq->bios_buffer); kfree(test_rq); utd->completed_req_count++; test_pr_err("%s: request %d completed, err=%d", __func__, test_rq->req_id, err); check_test_completion(); }
static bool ufs_data_integrity_completion(void) { struct test_data *ptd = test_get_test_data(); bool ret = false; if (!ptd->dispatched_count) { /* q is empty in this case */ if (!utd->queue_complete) { utd->queue_complete = true; wake_up(&utd->wait_q); } else { /* declare completion only on second time q is empty */ ret = true; } } return ret; }
static void long_seq_test_free_end_io_fn(struct request *rq, int err) { struct test_request *test_rq; struct test_data *ptd = test_get_test_data(); if (rq) { test_rq = (struct test_request *)rq->elv.priv[0]; } else { pr_err("%s: error: NULL request", __func__); return; } BUG_ON(!test_rq); spin_lock_irq(&ptd->lock); ptd->dispatched_count--; list_del_init(&test_rq->queuelist); __blk_put_request(ptd->req_q, test_rq->rq); spin_unlock_irq(&ptd->lock); if (utd->test_stage == UFS_TEST_LONG_SEQUENTIAL_MIXED_STAGE2 && rq_data_dir(rq) == READ && compare_buffer_to_pattern(test_rq)) { /* if the pattern does not match */ pr_err("%s: read pattern not as expected", __func__); utd->test_stage = UFS_TEST_ERROR; check_test_completion(); return; } kfree(test_rq->bios_buffer); kfree(test_rq); utd->completed_req_count++; if (err) pr_err("%s: request %d completed, err=%d", __func__, test_rq->req_id, err); check_test_completion(); }
static void scenario_free_end_io_fn(struct request *rq, int err) { struct test_request *test_rq; struct test_data *ptd = test_get_test_data(); BUG_ON(!rq); test_rq = (struct test_request *)rq->elv.priv[0]; BUG_ON(!test_rq); spin_lock_irq(&ptd->lock); ptd->dispatched_count--; list_del_init(&test_rq->queuelist); __blk_put_request(ptd->req_q, test_rq->rq); spin_unlock_irq(&ptd->lock); kfree(test_rq->bios_buffer); kfree(test_rq); if (err) pr_err("%s: request %d completed, err=%d", __func__, test_rq->req_id, err); check_test_completion(); }