linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cooper <alcooperx@gmail.com>
To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
	Nicolas Saenz Julienne <nsaenz@kernel.org>,
	"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	DTML <devicetree@vger.kernel.org>,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	linux-rpi-kernel@lists.infradead.org,
	Florian Fainelli <f.fainelli@gmail.com>,
	phil@raspberrypi.com, Tim Gover <tim.gover@raspberrypi.com>,
	Scott Branden <sbranden@broadcom.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	": Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH 4/4] ARM: dts: Fix-up EMMC2 controller's frequency
Date: Wed, 7 Apr 2021 16:37:29 -0400	[thread overview]
Message-ID: <CAOGqxeWzjn70A_gP4Eh_ZLW0H3KkE_wA7QzeGRqU1u7xtJr-+Q@mail.gmail.com> (raw)
In-Reply-To: <4d4e3de99dbee711cf47878bf98a7cc34c3f1e65.camel@suse.de>

Nicolas,

I got a better description of the failure and it looks like the bus
clock needs to be limited to 300KHz for a 500MHz core clock.
What's happening is that an internal reset sequence is needed after a
command timeout and the reset signal needs to be asserted for at least
2 ticks of the bus clock. This is done using a 12 bit counter clocked
by the core clock. That means a 500MHz core clock produces a 122KHz
reset signal which is too fast for 2 ticks of the 200KHz bus clock
(100KHz) but is okay for the 300KHz (150Khz) bus clock.

Al

On Mon, Apr 5, 2021 at 4:45 AM Nicolas Saenz Julienne
<nsaenzjulienne@suse.de> wrote:
>
> Hi Alan,
>
> On Thu, 2021-04-01 at 11:23 -0400, Alan Cooper wrote:
> > Nicolas,
> >
> > Sorry, I just noticed this thread.
> > This is a known bug in some newer Arasan cores.
> > The problem happens when the difference between the core clock and the bus
> > clock is too great.
> > Limiting the clock to 200KHz minimum should be a good fix.
>
> Great, that's what I was hoping to hear :). Out of curiosity, can you share
> more details on how the failure occurs?
>
> > In my experience, it's only eMMC that needs the clock to be retried
>
> > below 400KHz and not SD or SDIO. That's because the CMD signal for
> > eMMC starts out as open-drain during identification and the size of
> > the pull-up on the CMD signal can require the <400KHz clock. Once eMMC
> > is out of identification mode the CMD signal is switched to push-pull
> > and can run at much higher clock rates.
>
> Fair enough, I need to do some tests, some of the compute modules use an eMMC.
>
> > I don't think that SD and SDIO have any open-drain signals, so they
> > shouldn't need to retry at slower clock speeds.
>
> Noted.
>
> > I'm trying to get more detail on the bug, like the exact ratio of core
> > clock to bus clock that causes the problem. When I first found this
> > bug I was told that the failure would not happen at 200KHz, but we
> > were using a 405MHz core clock.
>
> That would be nice to have.
>
> > One other question. Why are you using polling for the SD card, this
> > newer controller supports the interrupt driven "Card Inserted" signal
> > and avoids wasting time polling?
>
> I believe the line isn't routed on RPi4.
>
> > Al
>

  reply	other threads:[~2021-04-07 20:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 18:58 [PATCH 0/4] BCM2711's sdhci-iproc CMD timeouts Nicolas Saenz Julienne
2021-03-22 18:58 ` [PATCH 1/4] dt-bindings: mmc: iproc-sdhci: Convert to json-schema Nicolas Saenz Julienne
2021-03-22 19:11   ` Scott Branden
2021-03-22 19:16     ` Nicolas Saenz Julienne
2021-03-23 21:08     ` Rob Herring
2021-03-23 21:24       ` Nicolas Saenz Julienne
2021-03-24 16:27         ` Scott Branden
2021-03-24 16:35           ` Nicolas Saenz Julienne
2021-03-24 16:43             ` Scott Branden
2021-03-23 20:16   ` Rob Herring
2021-03-22 18:58 ` [PATCH 2/4] dt-bindings: mmc: iproc-sdhci: Add clock-frequency support Nicolas Saenz Julienne
2021-03-27 17:14   ` Rob Herring
2021-03-22 18:58 ` [PATCH 3/4] mmc: sdhci-iproc: Set clock frequency as per DT Nicolas Saenz Julienne
2021-03-22 18:58 ` [PATCH 4/4] ARM: dts: Fix-up EMMC2 controller's frequency Nicolas Saenz Julienne
2021-03-22 19:06   ` Scott Branden
2021-03-22 19:17     ` Nicolas Saenz Julienne
2021-03-24 15:16   ` Stefan Wahren
2021-03-24 15:34     ` Nicolas Saenz Julienne
2021-03-25 19:11       ` Stefan Wahren
2021-03-26 16:17         ` Nicolas Saenz Julienne
2021-03-26 16:42           ` Stefan Wahren
2021-04-01 15:23           ` Alan Cooper
2021-04-05  8:45             ` Nicolas Saenz Julienne
2021-04-07 20:37               ` Alan Cooper [this message]
2021-04-09  9:28                 ` Nicolas Saenz Julienne
2021-04-09 10:54                 ` Nicolas Saenz Julienne
2021-04-09 18:28                   ` Stefan Wahren

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=CAOGqxeWzjn70A_gP4Eh_ZLW0H3KkE_wA7QzeGRqU1u7xtJr-+Q@mail.gmail.com \
    --to=alcooperx@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=nsaenz@kernel.org \
    --cc=nsaenzjulienne@suse.de \
    --cc=phil@raspberrypi.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=stefan.wahren@i2se.com \
    --cc=tim.gover@raspberrypi.com \
    --cc=ulf.hansson@linaro.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).