linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Mark Brown <broonie@kernel.org>
Cc: Tudor Ambarus <tudor.ambarus@linaro.org>,
	linux-spi@vger.kernel.org,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	linux-arm-kernel@lists.infradead.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] spi: atmel: Prevent false timeouts on long transfers
Date: Fri, 16 Jun 2023 19:53:51 +0200	[thread overview]
Message-ID: <20230616195351.4976b702@xps-13> (raw)
In-Reply-To: <71245a47-5c7e-4ff4-80c3-3b2b4d3642db@sirena.org.uk>

Hi Mark,

broonie@kernel.org wrote on Fri, 16 Jun 2023 18:43:51 +0100:

> On Fri, Jun 16, 2023 at 06:59:06PM +0200, Miquel Raynal wrote:
> > broonie@kernel.org wrote on Fri, 16 Jun 2023 17:43:06 +0100:  
> > > On Fri, Jun 16, 2023 at 06:15:35PM +0200, Miquel Raynal wrote:  
> > > > broonie@kernel.org wrote on Fri, 16 Jun 2023 15:20:27 +0100:    
> 
> > > Like I say we should know the transfer speed so we can do better than
> > > 4ms/10k - we know how long it takes to clock out each byte, we can just
> > > multiply that by the size of the transfer then add some fudge factor for
> > > setup/teardown overhead.  1s feels pretty generous too.  The sun6i
> > > driver for example does   
> 
> > >    max(tfr->len * 8 * 2 / (tfr->speed_hz / 1000), 100U)  
> 
> > > and just doubles the length based timeout with a minimum of 100ms which
> > > seems reasonable.  
> 
> > I already had issues with ~0.1s timeouts on NAND controllers, just
> > because the machine was heavily loaded. I believe we should avoid too
> > small timeouts, it does not make sense and make things worse under load.  
> 
> Well, we can raise that minimum if it's causing issues - 500ms say?  1s
> does feel a bit extreme for short transfers (and note that we'll use
> more than 100ms for long enough transfers).

Sounds reasonable. I believe it's worth the try.

Cheers,
Miquèl

      reply	other threads:[~2023-06-16 17:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 14:12 [PATCH] spi: atmel: Prevent false timeouts on long transfers Miquel Raynal
2023-06-16 14:20 ` Mark Brown
2023-06-16 16:15   ` Miquel Raynal
2023-06-16 16:43     ` Mark Brown
2023-06-16 16:59       ` Miquel Raynal
2023-06-16 17:43         ` Mark Brown
2023-06-16 17:53           ` Miquel Raynal [this message]

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=20230616195351.4976b702@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tudor.ambarus@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).