From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48649 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsWHR-00018i-VE for qemu-devel@nongnu.org; Thu, 24 Feb 2011 03:10:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsWBX-0007Xk-J6 for qemu-devel@nongnu.org; Thu, 24 Feb 2011 03:04:28 -0500 Received: from hall.aurel32.net ([88.191.126.93]:42878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsWBX-0007XS-ES for qemu-devel@nongnu.org; Thu, 24 Feb 2011 03:04:27 -0500 Date: Thu, 24 Feb 2011 09:03:53 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] hw/sd.c: Add missing state change for SD_STATUS, SEND_NUM_WR_BLOCKS Message-ID: <20110224080353.GA4459@volta.aurel32.net> References: <1298036340-11363-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1298036340-11363-1-git-send-email-peter.maydell@linaro.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, patches@linaro.org On Fri, Feb 18, 2011 at 01:39:00PM +0000, Peter Maydell wrote: > The SD_STATUS and SEND_NUM_WR_BLOCKS commands are supposed to cause > the card to send data back to the host. However sd.c was missing the > state change to sd_sendingdata_state for these commands, with the effect > that the Linux driver would either hang indefinitely waiting for > nonexistent data (pl181) or read zeroes and provoke a qemu warning > message (omap). > > Signed-off-by: Peter Maydell > --- > hw/sd.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) Thanks, applied. > diff --git a/hw/sd.c b/hw/sd.c > index 789ca84..5e29752 100644 > --- a/hw/sd.c > +++ b/hw/sd.c > @@ -1168,6 +1168,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, > case 13: /* ACMD13: SD_STATUS */ > switch (sd->state) { > case sd_transfer_state: > + sd->state = sd_sendingdata_state; > sd->data_start = 0; > sd->data_offset = 0; > return sd_r1; > @@ -1182,6 +1183,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, > case sd_transfer_state: > *(uint32_t *) sd->data = sd->blk_written; > > + sd->state = sd_sendingdata_state; > sd->data_start = 0; > sd->data_offset = 0; > return sd_r1; > -- > 1.7.1 > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net