All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Ribalda Delgado <ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
Subject: Re: [PATCH 1/3] spi: xilinx: Detect stall with Unknown commands
Date: Wed, 22 Nov 2017 20:25:30 +0100	[thread overview]
Message-ID: <CAPybu_2MBMFOy+RDSSai1pGf_+A4AD6=gbyWbZSLEPQetjfBxA@mail.gmail.com> (raw)
In-Reply-To: <20171122111215.2isnpg3nfry3g3ll-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

Hi Mark


On Wed, Nov 22, 2017 at 12:12 PM, Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> On Tue, Nov 21, 2017 at 10:09:02AM +0100, Ricardo Ribalda Delgado wrote:
>
>> +             stalled = 10;
>>               while (rx_words) {
>> +                     if (rx_words == n_words && !(stalled--) &&
>> +                         !(sr & XSPI_SR_TX_EMPTY_MASK) &&
>> +                         (sr & XSPI_SR_RX_EMPTY_MASK)) {
>
> 10 seems like a small number for what is essentially just a busy spin -
> are we sure that we won't reasonably hit a case where the CPU is
> sufficiently fast and the bus sufficiently slow we falsely detect a
> stall?  Where did this number come from?

This code is executed after all the data has been pushed to the out
fifo. Since we are not inhibitng tx, the moment the empty mask is
evaluated,  at least one byte should be out.

After 1 day of use I have been able to locate one event when stalled
was two. So 10 is very conservative number.

In other words: 10 is one order of magnitude bigger than the worst
measured case.

Thanks for your review :)


-- 
Ricardo Ribalda
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-11-22 19:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21  9:09 [PATCH 1/3] spi: xilinx: Detect stall with Unknown commands Ricardo Ribalda Delgado
     [not found] ` <20171121090904.6901-1-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-21  9:09   ` [PATCH 2/3] spi: xilinx: Add support for xlnx,axi-quad-spi-1.00.a Ricardo Ribalda Delgado
     [not found]     ` <20171121090904.6901-2-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-21 18:38       ` Rob Herring
2017-11-27 18:54       ` Applied "spi: xilinx: Add support for xlnx,axi-quad-spi-1.00.a" to the spi tree Mark Brown
2017-11-27 18:54         ` Mark Brown
2017-11-21  9:09   ` [PATCH 3/3] MAINTAINERS: Add Ricardo Ribalda for spi-xilinx Ricardo Ribalda Delgado
2017-11-22 11:12   ` [PATCH 1/3] spi: xilinx: Detect stall with Unknown commands Mark Brown
     [not found]     ` <20171122111215.2isnpg3nfry3g3ll-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-11-22 19:25       ` Ricardo Ribalda Delgado [this message]
     [not found]         ` <CAPybu_2MBMFOy+RDSSai1pGf_+A4AD6=gbyWbZSLEPQetjfBxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-22 19:27           ` Ricardo Ribalda Delgado
2017-11-24 13:04   ` Applied "spi: xilinx: Detect stall with Unknown commands" to the spi tree Mark Brown

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='CAPybu_2MBMFOy+RDSSai1pGf_+A4AD6=gbyWbZSLEPQetjfBxA@mail.gmail.com' \
    --to=ricardo.ribalda-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@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 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.