public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: "André Przywara" <andre.przywara-5wv7dgnIgG8@public.gmane.org>
To: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	Hans De Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/5] drivers: mmc: sunxi: fix A64 calibration routine
Date: Sun, 8 Jan 2017 23:56:49 +0000	[thread overview]
Message-ID: <95b2e25c-da97-4136-3c49-ff8ecf011c14@arm.com> (raw)
In-Reply-To: <20170105174725.kmr25iodjnjozqjm@lukather>

On 05/01/17 17:47, Maxime Ripard wrote:

Hi,

> On Mon, Jan 02, 2017 at 11:03:42PM +0000, Andre Przywara wrote:
>> The calibration facility in the A64 MMC block seems to have been
>> misunderstood: the result value is not the value to program into the
>> delay bits, but is the number of delay cells that result in a full clock
>> cycle delay. So this value has to be scaled by the desired phase, which
>> we still have to know and program.
>> Change the calibration routine to take a phase parameter and scale the
>> calibration value accordingly.
>> Also introduce sun50i-a64 delay parameters to store the required phase.
>> Looking at the BSP kernel the sample delay for anything below HS200 is
>> 0, so we go with that value.
>> Once the driver supports HS200 and faster modes, we can enter confirmed
>> working values in there.
>>
>> Signed-off-by: Andre Przywara <andre.przywara-5wv7dgnIgG8@public.gmane.org>
> 
> Exactly how that works hasn't been confirmed, and the only thing that
> this patch actually do is... nothing, since the delay is always 0. If
> and when we get HS400 to work and we know for a fact how the
> calibration works, then we'll be able to use it. Until then, we can
> just clear those bits.

Fair enough, though I am a bit puzzled as what to do here now:

Dropping this patch here entirely causes the wrong calibration settings
to degrade the BananaPi eMMC performance by up to 50% (20 MB/s vs.
40MB/s in hdparm, and 25% longer execution time for a "find / -type f |
xargs md5sum > /dev/null" run). So this is not an option.

1) Shall I simply revert Icenowy's original patch that introduced the
calibration function? That should leave the values at their reset value
of 0.  But do we want to make sure that these values are set to 0 by
explicitly zeroing the bits?
Also I guess your HS-400 support will need to write some values in
there, so we will need some code later again?

2) Changing the calibration function to don't do any calibration really
and just write 0 into the delay bits seems like an option, but looks a
bit weird. Also I guess your faster transfer modes support will need to
write _something_, though I don't know what those values are and where
they will come from.

So I am leaning towards 1) for now, unless you send your MMC patches and
we at least merge the patch dealing with the calibration part for the
next release.

Any recommendations? I would love to see the MMC support go into 4.11.

Cheers,
Andre.

  reply	other threads:[~2017-01-08 23:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02 23:03 [PATCH 0/5] arm64: sunxi: A64: enable MMC support Andre Przywara
     [not found] ` <1483398226-29321-1-git-send-email-andre.przywara-5wv7dgnIgG8@public.gmane.org>
2017-01-02 23:03   ` [PATCH 1/5] drivers: mmc: sunxi: fix A64 calibration routine Andre Przywara
     [not found]     ` <1483398226-29321-2-git-send-email-andre.przywara-5wv7dgnIgG8@public.gmane.org>
2017-01-05 17:47       ` Maxime Ripard
2017-01-08 23:56         ` André Przywara [this message]
2017-01-02 23:03   ` [PATCH 2/5] drivers: mmc: sunxi: limit A64 MMC2 to 8K DMA buffer Andre Przywara
     [not found]     ` <1483398226-29321-3-git-send-email-andre.przywara-5wv7dgnIgG8@public.gmane.org>
2017-01-04 14:07       ` Rob Herring
2017-01-05 17:57         ` Maxime Ripard
2017-01-05 23:33           ` André Przywara
     [not found]             ` <87b26848-4f86-f2d2-3f82-db0937c572e2-5wv7dgnIgG8@public.gmane.org>
2017-01-10 14:06               ` Maxime Ripard
2017-01-02 23:03   ` [PATCH 3/5] arm64: dts: sun50i: add MMC nodes Andre Przywara
     [not found]     ` <1483398226-29321-4-git-send-email-andre.przywara-5wv7dgnIgG8@public.gmane.org>
2017-01-03  2:52       ` Chen-Yu Tsai
     [not found]         ` <CAGb2v65GJFTnQZtWHCS7CAtA+Dry94o77aakPLr938BpQksLog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-03 10:48           ` André Przywara
     [not found]             ` <d4c2233c-95aa-4d72-1501-9ecb62f6cd82-5wv7dgnIgG8@public.gmane.org>
2017-01-03 13:28               ` Chen-Yu Tsai
     [not found]                 ` <CAGb2v65GAvyDn1oMXy2cpOD5PFRoYYOk-VbsMPAX3SNFz2ukLg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-04  0:22                   ` André Przywara
     [not found]                     ` <6e90ad76-8f25-538a-433e-ab31e8fab526-5wv7dgnIgG8@public.gmane.org>
2017-01-04  2:37                       ` Chen-Yu Tsai
2017-01-15 15:59         ` Dropping device tree pinmux nodes for GPIO usage (Was: [PATCH 3/5] arm64: dts: sun50i: add MMC nodes) Rask Ingemann Lambertsen
2017-01-17  8:33           ` Maxime Ripard
2017-01-05 17:50       ` [PATCH 3/5] arm64: dts: sun50i: add MMC nodes Maxime Ripard
2017-01-02 23:03   ` [PATCH 4/5] arm64: dts: Pine64: add MMC support Andre Przywara
2017-01-02 23:03   ` [PATCH 5/5] arm64: dts: add BananaPi-M64 support Andre Przywara
     [not found]     ` <1483398226-29321-6-git-send-email-andre.przywara-5wv7dgnIgG8@public.gmane.org>
2017-01-05 17:36       ` Maxime Ripard

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=95b2e25c-da97-4136-3c49-ff8ecf011c14@arm.com \
    --to=andre.przywara-5wv7dgnigg8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=icenowy-ymACFijhrKM@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@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