@@ -532,7 +532,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
goto cmd_rel_host;
if (idata->ic.is_acmd) {
- err = mmc_app_cmd(card->host, card);
+ err = mmc_app_cmd(card->host, card, &cmd);
if (err)
goto cmd_rel_host;
}
@@ -22,7 +22,8 @@
#include "core.h"
#include "sd_ops.h"
-int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card)
+int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card,
+ struct mmc_command *next_cmd)
{
int err;
struct mmc_command cmd = {0};
@@ -30,6 +31,11 @@ int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card)
BUG_ON(!host);
BUG_ON(card && (card->host != host));
+ if (card && mmc_card_uhsii(card)) {
+ next_cmd->app_cmd = true;
+ return 0;
+ }
+
cmd.opcode = MMC_APP_CMD;
if (card) {
@@ -82,7 +88,7 @@ int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
* we cannot use the retries field in mmc_command.
*/
for (i = 0;i <= retries;i++) {
- err = mmc_app_cmd(host, card);
+ err = mmc_app_cmd(host, card, cmd);
if (err) {
/* no point in retrying; no APP commands allowed */
if (mmc_host_is_spi(host)) {
@@ -162,7 +168,8 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR;
for (i = 100; i; i--) {
- err = mmc_wait_for_app_cmd(host, NULL, &cmd, MMC_CMD_RETRIES);
+ err = mmc_wait_for_app_cmd(host, host->card,
+ &cmd, MMC_CMD_RETRIES);
if (err)
break;
@@ -260,7 +267,7 @@ int mmc_app_send_scr(struct mmc_card *card, u32 *scr)
/* NOTE: caller guarantees scr is heap-allocated */
- err = mmc_app_cmd(card->host, card);
+ err = mmc_app_cmd(card->host, card, &cmd);
if (err)
return err;
@@ -363,7 +370,7 @@ int mmc_app_sd_status(struct mmc_card *card, void *ssr)
/* NOTE: caller guarantees ssr is heap-allocated */
- err = mmc_app_cmd(card->host, card);
+ err = mmc_app_cmd(card->host, card, &cmd);
if (err)
return err;
@@ -235,7 +235,8 @@ extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
extern int mmc_interrupt_hpi(struct mmc_card *);
extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
-extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
+extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *,
+ struct mmc_command *);
extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
struct mmc_command *, int);
extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);