From: Arend Van Spriel <arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
To: Adrian Hunter
<adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org,
"open list:ARM/Rockchip SoC..."
<linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Double Lo <double.lo-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
Brian Norris
<briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
linux-wireless
<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Naveen Gupta
<naveen.gupta-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
Madhan Mohan R
<madhanmohan.r-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
Matthias Kaehlcke <mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Wright Feng <wright.feng-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
Chi-Hsien Lin
<chi-hsien.lin-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
netdev <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
brcm80211-dev-list
<brcm80211-dev-list-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Franky Lin <franky.lin-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Hante Meuleman <hante.meuleman@broadcom.>
Subject: Re: [PATCH v2 3/3] brcmfmac: sdio: Disable auto-tuning around commands expected to fail
Date: Fri, 07 Jun 2019 15:32:20 +0200 [thread overview]
Message-ID: <16b3223dea0.2764.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> (raw)
In-Reply-To: <ff0e7b7a-6a58-8bec-b182-944a8b64236d-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
On June 7, 2019 2:40:04 PM Adrian Hunter <adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> On 7/06/19 8:12 AM, Arend Van Spriel wrote:
>> On June 6, 2019 11:37:22 PM Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>>>
>>> In the case of dw_mmc, which I'm most familiar with, we don't have any
>>> sort of automated or timed-based retuning. ...so we'll only re-tune
>>> when we see the CRC error. If I'm understanding things correctly then
>>> that for dw_mmc my solution and yours behave the same. That means the
>>> difference is how we deal with other retuning requests, either ones
>>> that come about because of an interrupt that the host controller
>>> provided or because of a timer. Did I get that right?
>>
>> Right.
>>
>>> ...and I guess the reason we have to deal specially with these cases
>>> is because any time that SDIO card is "sleeping" we don't want to
>>> retune because it won't work. Right? NOTE: the solution that would
>>> come to my mind first to solve this would be to hold the retuning for
>>> the whole time that the card was sleeping and then release it once the
>>> card was awake again. ...but I guess we don't truly need to do that
>>> because tuning only happens as a side effect of sending a command to
>>> the card and the only command we send to the card is the "wake up"
>>> command. That's why your solution to hold tuning while sending the
>>> "wake up" command works, right?
>>
>> Yup.
>>
>>> ---
>>>
>>> OK, so assuming all the above is correct, I feel like we're actually
>>> solving two problems and in fact I believe we actually need both our
>>> approaches to solve everything correctly. With just your patch in
>>> place there's a problem because we will clobber any external retuning
>>> requests that happened while we were waking up the card. AKA, imagine
>>> this:
>>>
>>> A) brcmf_sdio_kso_control(on=True) gets called; need_retune starts as 0
>>>
>>> B) We call sdio_retune_hold_now()
>>>
>>> C) A retuning timer goes off or the SD Host controller tells us to retune
>>>
>>> D) We get to the end of brcmf_sdio_kso_control() and clear the "retune
>>> needed" since need_retune was 0 at the start.
>>>
>>> ...so we dropped the retuning request from C), right?
>>>
>>>
>>> What we truly need is:
>>>
>>> 1. CRC errors shouldn't trigger a retuning request when we're in
>>> brcmf_sdio_kso_control()
>>>
>>> 2. A separate patch that holds any retuning requests while the SDIO
>>> card is off. This patch _shouldn't_ do any clearing of retuning
>>> requests, just defer them.
>>>
>>>
>>> Does that make sense to you? If so, I can try to code it up...
>>
>> FWIW it does make sense to me. However, I am still not sure if our sdio
>> hardware supports retuning. Have to track down an asic designer who can tell
>> or dive into vhdl myself.
>
> The card supports re-tuning if is handles CMD19, which it does. It is not
> the card that does any tuning, only the host. The card just helps by
> providing a known data pattern in response to CMD19. It can be that a card
> provides good enough signals that the host should not need to re-tune. I
> don't know if that can be affected by the board design though.
Right. I know it supports initial tuning, but I'm not sure about subsequent
retuning initiated by the host controller.
Regards,
Arend
next prev parent reply other threads:[~2019-06-07 13:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-03 18:37 [PATCH v2 0/3] brcmfmac: sdio: Deal better w/ transmission errors waking from idle Douglas Anderson
2019-06-03 18:37 ` [PATCH v2 1/3] Revert "brcmfmac: disable command decode in sdio_aos" Douglas Anderson
[not found] ` <20190603183740.239031-1-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2019-06-03 18:37 ` [PATCH v2 2/3] mmc: core: API for temporarily disabling auto-retuning due to errors Douglas Anderson
2019-06-05 7:54 ` Arend Van Spriel
[not found] ` <25fe1725-76fa-2739-1427-b0e8823ea4ae-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2019-06-05 22:51 ` Doug Anderson
2019-06-03 18:37 ` [PATCH v2 3/3] brcmfmac: sdio: Disable auto-tuning around commands expected to fail Douglas Anderson
[not found] ` <20190603183740.239031-4-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2019-06-06 13:59 ` Adrian Hunter
2019-06-06 21:37 ` Doug Anderson
2019-06-07 5:12 ` Arend Van Spriel
2019-06-07 12:38 ` Adrian Hunter
[not found] ` <ff0e7b7a-6a58-8bec-b182-944a8b64236d-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-06-07 13:32 ` Arend Van Spriel [this message]
[not found] ` <16b3223dea0.2764.9b12b7fc0a3841636cfb5e919b41b954-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2019-06-07 18:06 ` Doug Anderson
[not found] ` <CAD=FV=XVmCYWe9rtTFakq8yu67R-97EPyAHWck+o3dRXzHCchQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-07 18:56 ` Arend Van Spriel
2019-06-07 12:28 ` Adrian Hunter
2019-06-07 18:00 ` Doug Anderson
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=16b3223dea0.2764.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com \
--to=arend.vanspriel-dy08kvg/lbpwk0htik3j/w@public.gmane.org \
--cc=adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=brcm80211-dev-list-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org \
--cc=brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=chi-hsien.lin-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=double.lo-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org \
--cc=franky.lin-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=hante.meuleman@broadcom. \
--cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=madhanmohan.r-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org \
--cc=mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=naveen.gupta-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=wright.feng-+wT8y+m8/X5BDgjK7y7TUQ@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