From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAlmS-0005rG-OJ for qemu-devel@nongnu.org; Sun, 20 Dec 2015 16:44:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAlmR-0003Ht-TP for qemu-devel@nongnu.org; Sun, 20 Dec 2015 16:44:40 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:33899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAlmR-0003HG-JS for qemu-devel@nongnu.org; Sun, 20 Dec 2015 16:44:39 -0500 Received: by mail-wm0-x22c.google.com with SMTP id l126so46515710wml.1 for ; Sun, 20 Dec 2015 13:44:39 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1450295260-10980-3-git-send-email-Andrew.Baumann@microsoft.com> References: <1450295260-10980-1-git-send-email-Andrew.Baumann@microsoft.com> <1450295260-10980-3-git-send-email-Andrew.Baumann@microsoft.com> Date: Sun, 20 Dec 2015 13:44:38 -0800 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 2/3] sdhci: don't raise a command index error for an unexpected response List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Baumann Cc: Igor Mitsyanko , Peter Maydell , "qemu-devel@nongnu.org Developers" , Stefan Hajnoczi On Wed, Dec 16, 2015 at 11:47 AM, Andrew Baumann wrote: > This deletes a block of code that raised a command index error if a > command returned response data, but the guest did not set the > appropriate bits in the response register to handle such a response. I > cannot find any documentation that suggests the controller should > behave in this way, the error code doesn't make sense (command index > error is defined for the case where the index in a response does not > match that of the issued command), and in at least one case (CMD23 > issued by UEFI on Raspberry Pi 2), actual hardware does not do this. > > Signed-off-by: Andrew Baumann Reviewed-by: Peter Crosthwaite All I can think of, is the original author is assuming that any mismatch in response length can only occur on a mismatch of commands. If we really need _CMDIDX it should be done directly as a check of the command index in the response. Regards, Peter > --- > hw/sd/sdhci.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c > index bc39d48..dd83e89 100644 > --- a/hw/sd/sdhci.c > +++ b/hw/sd/sdhci.c > @@ -243,9 +243,6 @@ static void sdhci_send_command(SDHCIState *s) > (s->cmdreg & SDHC_CMD_RESPONSE) == SDHC_CMD_RSP_WITH_BUSY) { > s->norintsts |= SDHC_NIS_TRSCMP; > } > - } else if (rlen != 0 && (s->errintstsen & SDHC_EISEN_CMDIDX)) { > - s->errintsts |= SDHC_EIS_CMDIDX; > - s->norintsts |= SDHC_NIS_ERR; > } > > if (s->norintstsen & SDHC_NISEN_CMDCMP) { > -- > 2.5.3 >