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 @@ -783,6 +783,11 @@ static void msdc_prepare_data(struct msdc_host *host, struct mmc_data *data)
783
783
}
784
784
}
785
785
786
+ static bool msdc_data_prepared (struct mmc_data * data )
787
+ {
788
+ return data -> host_cookie & MSDC_PREPARE_FLAG ;
789
+ }
790
+
786
791
static void msdc_unprepare_data (struct msdc_host * host , struct mmc_data * data )
787
792
{
788
793
if (data -> host_cookie & MSDC_ASYNC_FLAG )
@@ -1346,8 +1351,18 @@ static void msdc_ops_request(struct mmc_host *mmc, struct mmc_request *mrq)
1346
1351
WARN_ON (host -> mrq );
1347
1352
host -> mrq = mrq ;
1348
1353
1349
- if (mrq -> data )
1354
+ if (mrq -> data ) {
1350
1355
msdc_prepare_data (host , mrq -> data );
1356
+ if (!msdc_data_prepared (mrq -> data )) {
1357
+ /*
1358
+ * Failed to prepare DMA area, fail fast before
1359
+ * starting any commands.
1360
+ */
1361
+ mrq -> cmd -> error = - ENOSPC ;
1362
+ mmc_request_done (mmc_from_priv (host ), mrq );
1363
+ return ;
1364
+ }
1365
+ }
1351
1366
1352
1367
/* if SBC is required, we have HW option and SW option.
1353
1368
* if HW option is enabled, and SBC does not have "special" flags,
You can’t perform that action at this time.
0 commit comments