All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Cc: Peng Fan <peng.fan@nxp.com>, Simon Glass <sjg@chromium.org>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Sean Anderson <seanga2@gmail.com>
Subject: [PATCH 1/4] mmc: sandbox: Initialize the status register
Date: Wed, 30 Mar 2022 12:54:43 -0400	[thread overview]
Message-ID: <20220330165446.438925-2-seanga2@gmail.com> (raw)
In-Reply-To: <20220330165446.438925-1-seanga2@gmail.com>

The send status command expects the status register to be returned as a
response. Without writing data back, whatever is on the stack will be
interpreted as the status register. There are a lot of fields in this
register, but fortunately all zeros is interpreted as "we don't support
anything."

Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

 drivers/mmc/sandbox_mmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/sandbox_mmc.c b/drivers/mmc/sandbox_mmc.c
index 451fe4a4e5..35159451e1 100644
--- a/drivers/mmc/sandbox_mmc.c
+++ b/drivers/mmc/sandbox_mmc.c
@@ -57,6 +57,7 @@ static int sandbox_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 		break;
 	case MMC_CMD_SEND_STATUS:
 		cmd->response[0] = MMC_STATUS_RDY_FOR_DATA;
+		memset(data->dest, '\0', data->blocks * data->blocksize);
 		break;
 	case MMC_CMD_SELECT_CARD:
 		break;
-- 
2.35.1


  reply	other threads:[~2022-03-30 16:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 16:54 [PATCH 0/4] mmc: sandbox: Some small fixes Sean Anderson
2022-03-30 16:54 ` Sean Anderson [this message]
2022-04-22 12:03   ` [PATCH 1/4] mmc: sandbox: Initialize the status register Jaehoon Chung
2022-04-26  7:56     ` Jaehoon Chung
2022-08-13 15:26       ` Sean Anderson
2022-09-08 11:38         ` Jaehoon Chung
2022-03-30 16:54 ` [PATCH 2/4] mmc: sandbox: Initialize backing buffer Sean Anderson
2022-04-22 12:03   ` Jaehoon Chung
2022-03-30 16:54 ` [PATCH 3/4] mmc: Import some defines for R1 responses Sean Anderson
2022-04-22 12:03   ` Jaehoon Chung
2022-03-30 16:54 ` [PATCH 4/4] mmc: sandbox: Set the response Sean Anderson
2022-04-22 12:03   ` Jaehoon Chung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220330165446.438925-2-seanga2@gmail.com \
    --to=seanga2@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=peng.fan@nxp.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.