linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus-mmc-p3sGCRWkH8CeZLLa646FqQ@public.gmane.org>
To: "hartleys" <hartleys-3FF4nKcrg1dE2c76skzGb0EOCMrvLtNR@public.gmane.org>
Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: mmc_spi.c driver
Date: Thu, 24 Apr 2008 14:05:41 +0200	[thread overview]
Message-ID: <20080424140541.773f6e6b@mjolnir.drzeus.cx> (raw)
In-Reply-To: <1CF6EDDF0820924DA43C9A52FE7325950A89DA47-3jZfQB9DylyX6QUl2nWcdlaTQe2KTcn/@public.gmane.org>

On Tue, 15 Apr 2008 15:26:54 -0400
"hartleys" <hartleys@visionengravers.com> wrote:

> I do get the IRQ on every card insertion and removal. Actually if I boot
> the system with the card removed I end up getting a:
> 
> mmc0: error -22 whilst initialising SDIO card  

This is a bit odd. It shouldn't have gone down that route unless it is
sure it's an SDIO card it is dealing with.

> If I then insert the card I get the IRQ and:
> 
> mmc0: new MMC card on SPI
> mmcblk0: mmc0:0001 SDM064 62720KiB
>  mmcblk0: p1 p2 p3 p4
> 
> So it appears the initial card detect does work. But for some reason
> it's not seeing the removal of the card or the insertion of a new card.
> 
> Any ideas?  

Without debugging info it's impossible to tell if it's the driver or the core that's doing something wrong. Have you checked that interrupts keep coming?

> 
> New issue. All of my testing so far has been with MMC cards. All of them
> have worked so far. I just tried a couple of SD cards and none of them
> work with the driver, they do work fine on my host system.
> 
> One of the cards actually produces a "Division by zero in kernel." error.
> It appears to happen in the mmc_set_data_timeout() function. I added a
> printk to the function and get the following when the card is inserted.
> 
> mmc_set_data_timeout  timeout_ns:0  timeout_clks:0  ios.clock:400000
> mmc_set_data_timeout  timeout_ns:-589934592  timeout_clks:0  ios.clock:400000
> mmc0: new SD card on SPI
> mmcblk0: mmc0:0000       29888KiB
>  mmcblk0:mmc_set_data_timeout  timeout_ns:-589934592  timeout_clks:0  ios.clock:0
> Division by zero in kernel.

Ouch.

> 
> For some reason the card->host->ios.clock value is getting changed to 0 on
> the third call to the function. I haven't been able to trace down where/why
> this would happen. Any idea on that one?
> 

Not the slightest. It should never be set to zero except when powering
down, which it only does when there is no card attached.

> I didn't think of checking dmesg before, here's the actual dump after I
> insert
> the SD card:

My guess would be transfer problems that causes the core to believe the
card cannot handle a higher speed. We should of course have a check
that we don't compute a too low speed, but that's not the root of the
problem.

Have you disabled the CRC checks?

I guess I'll have to warm up my old SPI test board and get it updated.
David, I don't suppose you've checked if you can reproduce this?

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

  parent reply	other threads:[~2008-04-24 12:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03 22:35 mmc_spi.c driver hartleys
     [not found] ` <1CF6EDDF0820924DA43C9A52FE7325950A27D544-3jZfQB9DylyX6QUl2nWcdlaTQe2KTcn/@public.gmane.org>
2008-04-15 18:37   ` David Brownell
     [not found]     ` <1CF6EDDF0820924DA43C9A52FE7325950A89D882@MI8NYCMAIL17.Mi8.com>
     [not found]       ` <1CF6EDDF0820924DA43C9A52FE7325950A89D882-3jZfQB9DylyX6QUl2nWcdlaTQe2KTcn/@public.gmane.org>
2008-04-15 19:04         ` David Brownell
     [not found]           ` <1CF6EDDF0820924DA43C9A52FE7325950A89DA47@MI8NYCMAIL17.Mi8.com>
     [not found]             ` <1CF6EDDF0820924DA43C9A52FE7325950A89DA47-3jZfQB9DylyX6QUl2nWcdlaTQe2KTcn/@public.gmane.org>
2008-04-15 19:44               ` David Brownell
     [not found]                 ` <200804151244.34171.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-04-16  1:58                   ` hartleys
2008-04-24 12:05               ` Pierre Ossman [this message]
     [not found]                 ` <20080424140541.773f6e6b-OhHrUh4vRMSnewYJFaQfwJ5kstrrjoWp@public.gmane.org>
2008-04-30  0:08                   ` David Brownell
     [not found]                     ` <200804291708.09424.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-04-30  0:38                       ` David Brownell
     [not found]                         ` <200804291738.34965.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-04-30 21:35                           ` [PATCH] Add card detect switch sensing during mmc_rescan hartleys
     [not found]                 ` <1CF6EDDF0820924DA43C9A52FE7325950ADABC65@MI8NYCMAIL17.Mi8.com>
     [not found]                   ` <1CF6EDDF0820924DA43C9A52FE7325950ADABC65-3jZfQB9DylyX6QUl2nWcdlaTQe2KTcn/@public.gmane.org>
2008-05-07 18:37                     ` mmc_spi.c driver Pierre Ossman
     [not found]                       ` <1CF6EDDF0820924DA43C9A52FE7325950B4DAA8C@MI8NYCMAIL17.Mi8.com>
     [not found]                         ` <1CF6EDDF0820924DA43C9A52FE7325950B4DAA8C-3jZfQB9DylyX6QUl2nWcdlaTQe2KTcn/@public.gmane.org>
2008-05-09 19:28                           ` Pierre Ossman
     [not found]                             ` <20080509212858.7220f665-OhHrUh4vRMSnewYJFaQfwJ5kstrrjoWp@public.gmane.org>
2008-10-30 22:46                               ` hartleys
     [not found]                                 ` <BD79186B4FD85F4B8E60E381CAEE1909C28EE4-KURmP/Qoe8Pmp66j18f85VaTQe2KTcn/@public.gmane.org>
2008-10-31  7:02                                   ` Pierre Ossman
     [not found]                                     ` <20081031080254.54b22b82-OhHrUh4vRMSnewYJFaQfwJ5kstrrjoWp@public.gmane.org>
2008-10-31 18:12                                       ` hartleys
     [not found]                                         ` <BD79186B4FD85F4B8E60E381CAEE1909C2914D-KURmP/Qoe8Pmp66j18f85VaTQe2KTcn/@public.gmane.org>
2008-10-31 18:32                                           ` David Brownell
     [not found]                                             ` <200810311132.26213.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-10-31 18:46                                               ` hartleys
     [not found]                                                 ` <BD79186B4FD85F4B8E60E381CAEE1909C29174-KURmP/Qoe8Pmp66j18f85VaTQe2KTcn/@public.gmane.org>
2008-10-31 18:47                                                   ` David Brownell
     [not found]                                                     ` <200810311147.45945.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-10-31 18:51                                                       ` hartleys
     [not found]                                                         ` <BD79186B4FD85F4B8E60E381CAEE1909C2917A-KURmP/Qoe8Pmp66j18f85VaTQe2KTcn/@public.gmane.org>
2008-10-31 19:23                                                           ` David Brownell
     [not found]                                                             ` <200810311223.16647.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-10-31 20:23                                                               ` hartleys
2008-10-31  7:59                                   ` David Brownell

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=20080424140541.773f6e6b@mjolnir.drzeus.cx \
    --to=drzeus-mmc-p3sgcrwkh8cezlla646fqq@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=hartleys-3FF4nKcrg1dE2c76skzGb0EOCMrvLtNR@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).