From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaV7M-0008CL-AF for qemu-devel@nongnu.org; Tue, 13 Dec 2011 11:22:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaV7G-00017U-Gc for qemu-devel@nongnu.org; Tue, 13 Dec 2011 11:22:12 -0500 Received: from mail-qy0-f173.google.com ([209.85.216.173]:59863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaV7G-00017P-Ao for qemu-devel@nongnu.org; Tue, 13 Dec 2011 11:22:06 -0500 Received: by qcsd15 with SMTP id d15so5285328qcs.4 for ; Tue, 13 Dec 2011 08:22:05 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <1323672206-11891-1-git-send-email-e.voevodin@samsung.com> <1323672206-11891-13-git-send-email-e.voevodin@samsung.com> Date: Tue, 13 Dec 2011 16:22:05 +0000 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3 12/14] hw/sd.c, hw/sd.h: add receive ready query routine to SD/MMC API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Evgeny Voevodin Cc: m.kozlov@samsung.com, Mitsyanko Igor , qemu-devel@nongnu.org, d.solodkiy@samsung.com On 13 December 2011 15:11, Peter Maydell wrote: > On 12 December 2011 06:43, Evgeny Voevodin wrote: >> From: Mitsyanko Igor >> >> Data transfer direction between host controller and SD/MMC card is selected by >> host controller configuration registers, but whether we actually need or need >> not perform data transfer depends on type of last issued command. To avoid >> memorization of which type of command host controller issued the last time, we >> can use simple query procedures, to make sure that SD/MMC card is in the >> right state. The only query routine currently presented in SD/MMC card >> emulation is sd_data_ready(), this patch adds sd_receive_ready() routine. > > I've thought about this a bit more and spent some time poking through > the standards docs. I'm kind of suspicious of both this function and > the existing sd_data_ready(). Real hardware doesn't have these signals, > both ends of the sd-controller-to-card connection just do their thing > and trust that the other end is in the state it is supposed to be. > If you (in the controller model) don't already know whether you are > OK to send/receive data then you haven't modelled some part of the > controller's state properly. Having thought even more :-), sd_data_ready() is actually modelling a real hardware behaviour: "have we seen the start bit on the data line?". So it is justifiable. I still don't think sd_receive_ready() is, though. -- PMM