All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard Purdie" <rpurdie@rpsys.net>
To: "Russell King" <rmk+lkml@arm.linux.org.uk>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Ian Molton" <spyro@f2s.com>
Subject: Re: MMC Driver RFC
Date: Wed, 12 Jan 2005 22:07:26 -0000	[thread overview]
Message-ID: <023c01c4f8f3$1d497030$0f01a8c0@max> (raw)
In-Reply-To: 20050112214345.D17131@flint.arm.linux.org.uk

Russell King:
>> The PXA code calls mmc_detect_change() whenever an interrupt is detected.
>> The MMC core then does a schedule_work(&host->detect). The problem is 
>> that
>> when the interrupt is generated, the card may not be 100% inserted or 
>> 100%
>> removed. Given the mechanical nature of insertions and removals, 
>> electrical
>> contact is possible for a while after removal has been started (and a 
>> while
>> before insertion is complete).
>
> If your socket works like that, you need to handle that by using a timer
> yourself.  It normally only affects removal rather than insertion.

It has only shown up on removal events *so far*. I know that the interrupt 
triggers before the card is fully seated in the slot upon insertion on this 
device as well and I'd imagine it does so on other devices given the 
physical design of the cards. Initalisation whilst the electrical contacts 
are still moving can't be a wise idea even if it hasn't bitten anyone yet.

I'm therefore asking if there is a general case for waiting a short while 
after any card insertion/removal event?

If not, I will just have to delay the interrupt on my hardware as you 
suggest. (A user isn't going to notice 0.25s delay in the grand scheme of 
things...). I suspect I'll not be the last person to have problems with this 
though.

>> 2. Card Initialisation Problems
>
> Different cards behave differently.  I suspect you have yet another
> quirky card.

What is the policy on handling this? Pin the error down, then see what can 
be done about it? I'll just have to move delays about until I find the one 
that helps guess.

I was wondering if there was some kind of timing specification somewhere as 
all these cards seem to work fine under other operating systems...

>> I suspect this is related to the 1ms wait that was added to mmc_setup() 
>> as
>> per comments. Is there any documentation which tells us exactly what 
>> timings
>> we should be aiming for here? Has anyone else has problems like this?
>
> There isn't any 1ms wait in mmc_setup().

I was referrng to the 1ms delay in mmc_idle_cards() which is called twice by 
mmc_setup(). There is a comment about it in mmc_setup(): "We wait 1ms to 
give cards time to respond.". Was this just derived from experimentation?

> People are nervous about SD support - the SD forum has been traditionally
> rather closed, and there is the perception that a SD card driver may not
> go down well.  I have even heard rumours of patent issues/IP issues in
> this area, and I don't wish to get stung.
>
> However, that said, the situation has improved recently - we've gone from
> no documentation to limited documentation.  However, this documentation
> still isn't sufficient to do the job - eg, the SD formats for the CID
> and CSD registers remain completely undocumented.

Looking at the code from hh.org, it could be (and probably has been) derived 
from the documentation available so I can't see a patent/IP problem although 
I understand the concern. I agree that lack of info about the formatting of 
CID and CSD registers is an issue although the hh.org code does seem to 
work. Is guessing what the values mean an IP/patent infringement?...

Richard 


  reply	other threads:[~2005-01-12 22:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-12 21:10 MMC Driver RFC Richard Purdie
2005-01-12 21:43 ` Russell King
2005-01-12 22:07   ` Richard Purdie [this message]
2005-01-12 22:17     ` Russell King
2005-01-12 23:23       ` Ian Molton
2005-01-12 23:58         ` Richard Purdie
2005-01-14 11:37         ` Pierre Ossman
2005-01-14 14:55           ` Ian Molton
2005-01-16 12:22             ` Pierre Ossman
2005-01-16 13:19               ` Ian Molton
2005-01-16 19:43                 ` Pierre Ossman
2005-01-16 23:17                   ` Richard Purdie
2005-01-16 22:33                     ` Alan Cox
2005-01-17  6:07                     ` Pierre Ossman
2005-01-17  9:53                       ` Richard Purdie
2005-01-17 11:59                         ` Pierre Ossman

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='023c01c4f8f3$1d497030$0f01a8c0@max' \
    --to=rpurdie@rpsys.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=spyro@f2s.com \
    /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.