File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -853,6 +853,11 @@ static void msdc_prepare_data(struct msdc_host *host, struct mmc_data *data)
853
853
}
854
854
}
855
855
856
+ static bool msdc_data_prepared (struct mmc_data * data )
857
+ {
858
+ return data -> host_cookie & MSDC_PREPARE_FLAG ;
859
+ }
860
+
856
861
static void msdc_unprepare_data (struct msdc_host * host , struct mmc_data * data )
857
862
{
858
863
if (data -> host_cookie & MSDC_ASYNC_FLAG )
@@ -1484,8 +1489,18 @@ static void msdc_ops_request(struct mmc_host *mmc, struct mmc_request *mrq)
1484
1489
WARN_ON (!host -> hsq_en && host -> mrq );
1485
1490
host -> mrq = mrq ;
1486
1491
1487
- if (mrq -> data )
1492
+ if (mrq -> data ) {
1488
1493
msdc_prepare_data (host , mrq -> data );
1494
+ if (!msdc_data_prepared (mrq -> data )) {
1495
+ /*
1496
+ * Failed to prepare DMA area, fail fast before
1497
+ * starting any commands.
1498
+ */
1499
+ mrq -> cmd -> error = - ENOSPC ;
1500
+ mmc_request_done (mmc_from_priv (host ), mrq );
1501
+ return ;
1502
+ }
1503
+ }
1489
1504
1490
1505
/* if SBC is required, we have HW option and SW option.
1491
1506
* if HW option is enabled, and SBC does not have "special" flags,
You can’t perform that action at this time.
0 commit comments