All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mitsyanko Igor <i.mitsyanko@samsung.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 12/14] hw/sd.c, hw/sd.h: add receive ready query routine to SD/MMC API
Date: Wed, 14 Dec 2011 12:29:01 +0400	[thread overview]
Message-ID: <4EE85E4D.6030006@samsung.com> (raw)
In-Reply-To: <CAFEAcA-c_tf=HBEwidy5-QHvr3_V6uV7xpjM9fDg2rSem__cnQ@mail.gmail.com>

On 12/13/2011 08:22 PM, Peter Maydell wrote:
> On 13 December 2011 15:11, Peter Maydell<peter.maydell@linaro.org>  wrote:
>> On 12 December 2011 06:43, Evgeny Voevodin<e.voevodin@samsung.com>  wrote:
>>> From: Mitsyanko Igor<i.mitsyanko@samsung.com>
>>>
>>> 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
>
>

I thought it's a good idea to protect user data from corruption because 
of inappropriate driver behaviour, even though it's obviously not a 
controller's concern. But after your comment about start bit it started 
to make sense to me that sd_data_ready() exists in current 
implementation, while other query functions don't :)

  reply	other threads:[~2011-12-14  8:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12  6:43 [Qemu-devel] [PATCH v3 00/14] ARM: Samsung Exynos4210-based boards support Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 01/14] ARM: Samsung exynos4210-based boards emulation Evgeny Voevodin
2011-12-12 22:17   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 02/14] ARM: exynos4210: CMU support Evgeny Voevodin
2011-12-12 22:44   ` Peter Maydell
2011-12-14 12:10     ` Maksim E. Kozlov
2011-12-14 11:43       ` Peter Maydell
2011-12-14 17:08     ` Maksim E. Kozlov
2011-12-14 16:25       ` Peter Maydell
2011-12-15  7:11     ` Dmitry Solodkiy
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 03/14] ARM: exynos4210: UART support Evgeny Voevodin
2011-12-12 22:55   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 04/14] hw/sysbus.h: Increase maximum number of device IRQs Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 05/14] ARM: exynos4210: IRQ subsystem support Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 06/14] ARM: exynos4210: PWM support Evgeny Voevodin
2011-12-13 10:51   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 07/14] hw/arm_boot.c: Add new secondary CPU bootloader Evgeny Voevodin
2011-12-13 11:28   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 08/14] ARM: exynos4210: MCT support Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 09/14] hw/exynos4210.c: Boot secondary CPU Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 10/14] hw/lan9118: Add basic 16-bit mode support Evgeny Voevodin
2011-12-13 11:54   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 11/14] hw/exynos4210.c: Add LAN support for SMDKC210 Evgeny Voevodin
2011-12-13 12:01   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 12/14] hw/sd.c, hw/sd.h: add receive ready query routine to SD/MMC API Evgeny Voevodin
2011-12-13 15:11   ` Peter Maydell
2011-12-13 16:22     ` Peter Maydell
2011-12-14  8:29       ` Mitsyanko Igor [this message]
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 13/14] ARM: exynos4210: added SD/MMC host controller Evgeny Voevodin
2011-12-13 14:56   ` Peter Maydell
2011-12-13 16:23     ` Mitsyanko Igor
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 14/14] ARM: exynos4210: added display controller implementation Evgeny Voevodin
2011-12-12  7:22 ` [Qemu-devel] [PATCH v3 00/14] ARM: Samsung Exynos4210-based boards support Stefan Weil
2011-12-13 10:14 ` Peter Maydell
2011-12-13 10:37   ` Dmitry Solodkiy
2011-12-13 10:59     ` Peter Maydell

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=4EE85E4D.6030006@samsung.com \
    --to=i.mitsyanko@samsung.com \
    --cc=qemu-devel@nongnu.org \
    /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.