Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: core: Remove code no longer needed after the switch to blk-mq

Remove code no longer needed after the switch to blk-mq.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Adrian Hunter and committed by
Ulf Hansson
126b6270 0fbfd125

+1 -200
-2
drivers/mmc/core/bus.c
··· 351 351 #ifdef CONFIG_DEBUG_FS 352 352 mmc_add_card_debugfs(card); 353 353 #endif 354 - mmc_init_context_info(card->host); 355 - 356 354 card->dev.of_node = mmc_of_find_child_device(card->host, 0); 357 355 358 356 device_enable_async_suspend(&card->dev);
+1 -182
drivers/mmc/core/core.c
··· 363 363 } 364 364 EXPORT_SYMBOL(mmc_start_request); 365 365 366 - /* 367 - * mmc_wait_data_done() - done callback for data request 368 - * @mrq: done data request 369 - * 370 - * Wakes up mmc context, passed as a callback to host controller driver 371 - */ 372 - static void mmc_wait_data_done(struct mmc_request *mrq) 373 - { 374 - struct mmc_context_info *context_info = &mrq->host->context_info; 375 - 376 - context_info->is_done_rcv = true; 377 - wake_up_interruptible(&context_info->wait); 378 - } 379 - 380 366 static void mmc_wait_done(struct mmc_request *mrq) 381 367 { 382 368 complete(&mrq->completion); ··· 378 392 */ 379 393 if (ongoing_mrq && !completion_done(&ongoing_mrq->cmd_completion)) 380 394 wait_for_completion(&ongoing_mrq->cmd_completion); 381 - } 382 - 383 - /* 384 - *__mmc_start_data_req() - starts data request 385 - * @host: MMC host to start the request 386 - * @mrq: data request to start 387 - * 388 - * Sets the done callback to be called when request is completed by the card. 389 - * Starts data mmc request execution 390 - * If an ongoing transfer is already in progress, wait for the command line 391 - * to become available before sending another command. 392 - */ 393 - static int __mmc_start_data_req(struct mmc_host *host, struct mmc_request *mrq) 394 - { 395 - int err; 396 - 397 - mmc_wait_ongoing_tfr_cmd(host); 398 - 399 - mrq->done = mmc_wait_data_done; 400 - mrq->host = host; 401 - 402 - err = mmc_start_request(host, mrq); 403 - if (err) { 404 - mrq->cmd->error = err; 405 - mmc_complete_cmd(mrq); 406 - mmc_wait_data_done(mrq); 407 - } 408 - 409 - return err; 410 395 } 411 396 412 397 static int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq) ··· 605 648 */ 606 649 bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq) 607 650 { 608 - if (host->areq) 609 - return host->context_info.is_done_rcv; 610 - else 611 - return completion_done(&mrq->completion); 651 + return completion_done(&mrq->completion); 612 652 } 613 653 EXPORT_SYMBOL(mmc_is_req_done); 614 - 615 - /** 616 - * mmc_finalize_areq() - finalize an asynchronous request 617 - * @host: MMC host to finalize any ongoing request on 618 - * 619 - * Returns the status of the ongoing asynchronous request, but 620 - * MMC_BLK_SUCCESS if no request was going on. 621 - */ 622 - static enum mmc_blk_status mmc_finalize_areq(struct mmc_host *host) 623 - { 624 - struct mmc_context_info *context_info = &host->context_info; 625 - enum mmc_blk_status status; 626 - 627 - if (!host->areq) 628 - return MMC_BLK_SUCCESS; 629 - 630 - while (1) { 631 - wait_event_interruptible(context_info->wait, 632 - (context_info->is_done_rcv || 633 - context_info->is_new_req)); 634 - 635 - if (context_info->is_done_rcv) { 636 - struct mmc_command *cmd; 637 - 638 - context_info->is_done_rcv = false; 639 - cmd = host->areq->mrq->cmd; 640 - 641 - if (!cmd->error || !cmd->retries || 642 - mmc_card_removed(host->card)) { 643 - status = host->areq->err_check(host->card, 644 - host->areq); 645 - break; /* return status */ 646 - } else { 647 - mmc_retune_recheck(host); 648 - pr_info("%s: req failed (CMD%u): %d, retrying...\n", 649 - mmc_hostname(host), 650 - cmd->opcode, cmd->error); 651 - cmd->retries--; 652 - cmd->error = 0; 653 - __mmc_start_request(host, host->areq->mrq); 654 - continue; /* wait for done/new event again */ 655 - } 656 - } 657 - 658 - return MMC_BLK_NEW_REQUEST; 659 - } 660 - 661 - mmc_retune_release(host); 662 - 663 - /* 664 - * Check BKOPS urgency for each R1 response 665 - */ 666 - if (host->card && mmc_card_mmc(host->card) && 667 - ((mmc_resp_type(host->areq->mrq->cmd) == MMC_RSP_R1) || 668 - (mmc_resp_type(host->areq->mrq->cmd) == MMC_RSP_R1B)) && 669 - (host->areq->mrq->cmd->resp[0] & R1_EXCEPTION_EVENT)) { 670 - mmc_start_bkops(host->card, true); 671 - } 672 - 673 - return status; 674 - } 675 - 676 - /** 677 - * mmc_start_areq - start an asynchronous request 678 - * @host: MMC host to start command 679 - * @areq: asynchronous request to start 680 - * @ret_stat: out parameter for status 681 - * 682 - * Start a new MMC custom command request for a host. 683 - * If there is on ongoing async request wait for completion 684 - * of that request and start the new one and return. 685 - * Does not wait for the new request to complete. 686 - * 687 - * Returns the completed request, NULL in case of none completed. 688 - * Wait for the an ongoing request (previoulsy started) to complete and 689 - * return the completed request. If there is no ongoing request, NULL 690 - * is returned without waiting. NULL is not an error condition. 691 - */ 692 - struct mmc_async_req *mmc_start_areq(struct mmc_host *host, 693 - struct mmc_async_req *areq, 694 - enum mmc_blk_status *ret_stat) 695 - { 696 - enum mmc_blk_status status; 697 - int start_err = 0; 698 - struct mmc_async_req *previous = host->areq; 699 - 700 - /* Prepare a new request */ 701 - if (areq) 702 - mmc_pre_req(host, areq->mrq); 703 - 704 - /* Finalize previous request */ 705 - status = mmc_finalize_areq(host); 706 - if (ret_stat) 707 - *ret_stat = status; 708 - 709 - /* The previous request is still going on... */ 710 - if (status == MMC_BLK_NEW_REQUEST) 711 - return NULL; 712 - 713 - /* Fine so far, start the new request! */ 714 - if (status == MMC_BLK_SUCCESS && areq) 715 - start_err = __mmc_start_data_req(host, areq->mrq); 716 - 717 - /* Postprocess the old request at this point */ 718 - if (host->areq) 719 - mmc_post_req(host, host->areq->mrq, 0); 720 - 721 - /* Cancel a prepared request if it was not started. */ 722 - if ((status != MMC_BLK_SUCCESS || start_err) && areq) 723 - mmc_post_req(host, areq->mrq, -EINVAL); 724 - 725 - if (status != MMC_BLK_SUCCESS) 726 - host->areq = NULL; 727 - else 728 - host->areq = areq; 729 - 730 - return previous; 731 - } 732 - EXPORT_SYMBOL(mmc_start_areq); 733 654 734 655 /** 735 656 * mmc_wait_for_req - start a request and wait for completion ··· 2795 2960 unregister_pm_notifier(&host->pm_notify); 2796 2961 } 2797 2962 #endif 2798 - 2799 - /** 2800 - * mmc_init_context_info() - init synchronization context 2801 - * @host: mmc host 2802 - * 2803 - * Init struct context_info needed to implement asynchronous 2804 - * request mechanism, used by mmc core, host driver and mmc requests 2805 - * supplier. 2806 - */ 2807 - void mmc_init_context_info(struct mmc_host *host) 2808 - { 2809 - host->context_info.is_new_req = false; 2810 - host->context_info.is_done_rcv = false; 2811 - host->context_info.is_waiting_last_req = false; 2812 - init_waitqueue_head(&host->context_info.wait); 2813 - } 2814 2963 2815 2964 static int __init mmc_init(void) 2816 2965 {
-8
drivers/mmc/core/core.h
··· 89 89 void mmc_add_card_debugfs(struct mmc_card *card); 90 90 void mmc_remove_card_debugfs(struct mmc_card *card); 91 91 92 - void mmc_init_context_info(struct mmc_host *host); 93 - 94 92 int mmc_execute_tuning(struct mmc_card *card); 95 93 int mmc_hs200_to_hs400(struct mmc_card *card); 96 94 int mmc_hs400_to_hs200(struct mmc_card *card); ··· 105 107 bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq); 106 108 107 109 int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq); 108 - 109 - struct mmc_async_req; 110 - 111 - struct mmc_async_req *mmc_start_areq(struct mmc_host *host, 112 - struct mmc_async_req *areq, 113 - enum mmc_blk_status *ret_stat); 114 110 115 111 int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, 116 112 unsigned int arg);
-5
drivers/mmc/core/host.h
··· 79 79 return card->host->ios.enhanced_strobe; 80 80 } 81 81 82 - static inline bool mmc_host_use_blk_mq(struct mmc_host *host) 83 - { 84 - return true; 85 - } 86 - 87 82 #endif 88 83
-3
include/linux/mmc/host.h
··· 424 424 425 425 struct dentry *debugfs_root; 426 426 427 - struct mmc_async_req *areq; /* active async req */ 428 - struct mmc_context_info context_info; /* async synchronization info */ 429 - 430 427 /* Ongoing data transfer that allows commands during transfer */ 431 428 struct mmc_request *ongoing_mrq; 432 429