@@ -368,11 +368,11 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
368
368
c |= TRANSFER_MULTI ;
369
369
370
370
/*
371
- * Disable auto CMD12 at IO_RW_EXTENDED when
372
- * multiple block transfer
371
+ * Disable auto CMD12 at IO_RW_EXTENDED and SET_BLOCK_COUNT
372
+ * when doing multiple block transfer
373
373
*/
374
374
if ((host -> pdata -> flags & TMIO_MMC_HAVE_CMD12_CTRL ) &&
375
- (cmd -> opcode == SD_IO_RW_EXTENDED ))
375
+ (cmd -> opcode == SD_IO_RW_EXTENDED || host -> mrq -> sbc ))
376
376
c |= NO_CMD12_ISSUE ;
377
377
}
378
378
if (data -> flags & MMC_DATA_READ )
@@ -549,7 +549,7 @@ void tmio_mmc_do_data_irq(struct tmio_mmc_host *host)
549
549
host -> mrq );
550
550
}
551
551
552
- if (stop ) {
552
+ if (stop && ! host -> mrq -> sbc ) {
553
553
if (stop -> opcode != MMC_STOP_TRANSMISSION || stop -> arg )
554
554
dev_err (& host -> pdev -> dev , "unsupported stop: CMD%u,0x%x. We did CMD12,0\n" ,
555
555
stop -> opcode , stop -> arg );
@@ -857,15 +857,21 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
857
857
858
858
static void tmio_process_mrq (struct tmio_mmc_host * host , struct mmc_request * mrq )
859
859
{
860
+ struct mmc_command * cmd ;
860
861
int ret ;
861
862
862
- if (mrq -> data ) {
863
- ret = tmio_mmc_start_data (host , mrq -> data );
864
- if (ret )
865
- goto fail ;
863
+ if (mrq -> sbc && host -> cmd != mrq -> sbc ) {
864
+ cmd = mrq -> sbc ;
865
+ } else {
866
+ cmd = mrq -> cmd ;
867
+ if (mrq -> data ) {
868
+ ret = tmio_mmc_start_data (host , mrq -> data );
869
+ if (ret )
870
+ goto fail ;
871
+ }
866
872
}
867
873
868
- ret = tmio_mmc_start_command (host , mrq -> cmd );
874
+ ret = tmio_mmc_start_command (host , cmd );
869
875
if (ret )
870
876
goto fail ;
871
877
@@ -920,13 +926,16 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
920
926
return ;
921
927
}
922
928
923
- host -> cmd = NULL ;
924
- host -> data = NULL ;
925
- host -> force_pio = false;
929
+ /* If not SET_BLOCK_COUNT, clear old data */
930
+ if (host -> cmd != mrq -> sbc ) {
931
+ host -> cmd = NULL ;
932
+ host -> data = NULL ;
933
+ host -> force_pio = false;
934
+ host -> mrq = NULL ;
935
+ }
926
936
927
937
cancel_delayed_work (& host -> delayed_reset_work );
928
938
929
- host -> mrq = NULL ;
930
939
spin_unlock_irqrestore (& host -> lock , flags );
931
940
932
941
if (mrq -> cmd -> error || (mrq -> data && mrq -> data -> error ))
@@ -935,6 +944,12 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
935
944
if (host -> check_scc_error )
936
945
host -> check_scc_error (host );
937
946
947
+ /* If SET_BLOCK_COUNT, continue with main command */
948
+ if (host -> mrq ) {
949
+ tmio_process_mrq (host , mrq );
950
+ return ;
951
+ }
952
+
938
953
mmc_request_done (host -> mmc , mrq );
939
954
}
940
955
0 commit comments