@@ -506,56 +506,6 @@ static int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq)
506
506
return err ;
507
507
}
508
508
509
- /*
510
- * mmc_wait_for_data_req_done() - wait for request completed
511
- * @host: MMC host to prepare the command.
512
- * @mrq: MMC request to wait for
513
- *
514
- * Blocks MMC context till host controller will ack end of data request
515
- * execution or new request notification arrives from the block layer.
516
- * Handles command retries.
517
- *
518
- * Returns enum mmc_blk_status after checking errors.
519
- */
520
- static enum mmc_blk_status mmc_wait_for_data_req_done (struct mmc_host * host ,
521
- struct mmc_request * mrq )
522
- {
523
- struct mmc_command * cmd ;
524
- struct mmc_context_info * context_info = & host -> context_info ;
525
- enum mmc_blk_status status ;
526
-
527
- while (1 ) {
528
- wait_event_interruptible (context_info -> wait ,
529
- (context_info -> is_done_rcv ||
530
- context_info -> is_new_req ));
531
-
532
- if (context_info -> is_done_rcv ) {
533
- context_info -> is_done_rcv = false;
534
- cmd = mrq -> cmd ;
535
-
536
- if (!cmd -> error || !cmd -> retries ||
537
- mmc_card_removed (host -> card )) {
538
- status = host -> areq -> err_check (host -> card ,
539
- host -> areq );
540
- break ; /* return status */
541
- } else {
542
- mmc_retune_recheck (host );
543
- pr_info ("%s: req failed (CMD%u): %d, retrying...\n" ,
544
- mmc_hostname (host ),
545
- cmd -> opcode , cmd -> error );
546
- cmd -> retries -- ;
547
- cmd -> error = 0 ;
548
- __mmc_start_request (host , mrq );
549
- continue ; /* wait for done/new event again */
550
- }
551
- }
552
-
553
- return MMC_BLK_NEW_REQUEST ;
554
- }
555
- mmc_retune_release (host );
556
- return status ;
557
- }
558
-
559
509
void mmc_wait_for_req_done (struct mmc_host * host , struct mmc_request * mrq )
560
510
{
561
511
struct mmc_command * cmd ;
@@ -660,14 +610,44 @@ static void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq,
660
610
*/
661
611
static enum mmc_blk_status mmc_finalize_areq (struct mmc_host * host )
662
612
{
613
+ struct mmc_context_info * context_info = & host -> context_info ;
663
614
enum mmc_blk_status status ;
664
615
665
616
if (!host -> areq )
666
617
return MMC_BLK_SUCCESS ;
667
618
668
- status = mmc_wait_for_data_req_done (host , host -> areq -> mrq );
669
- if (status == MMC_BLK_NEW_REQUEST )
670
- return status ;
619
+ while (1 ) {
620
+ wait_event_interruptible (context_info -> wait ,
621
+ (context_info -> is_done_rcv ||
622
+ context_info -> is_new_req ));
623
+
624
+ if (context_info -> is_done_rcv ) {
625
+ struct mmc_command * cmd ;
626
+
627
+ context_info -> is_done_rcv = false;
628
+ cmd = host -> areq -> mrq -> cmd ;
629
+
630
+ if (!cmd -> error || !cmd -> retries ||
631
+ mmc_card_removed (host -> card )) {
632
+ status = host -> areq -> err_check (host -> card ,
633
+ host -> areq );
634
+ break ; /* return status */
635
+ } else {
636
+ mmc_retune_recheck (host );
637
+ pr_info ("%s: req failed (CMD%u): %d, retrying...\n" ,
638
+ mmc_hostname (host ),
639
+ cmd -> opcode , cmd -> error );
640
+ cmd -> retries -- ;
641
+ cmd -> error = 0 ;
642
+ __mmc_start_request (host , host -> areq -> mrq );
643
+ continue ; /* wait for done/new event again */
644
+ }
645
+ }
646
+
647
+ return MMC_BLK_NEW_REQUEST ;
648
+ }
649
+
650
+ mmc_retune_release (host );
671
651
672
652
/*
673
653
* Check BKOPS urgency for each R1 response
0 commit comments