linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Serge Semin <fancer.lancer@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Tudor Ambarus <tudor.ambarus@microchip.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: Limit the spi device max speed to controller's max speed
Date: Wed, 9 Dec 2020 23:30:42 +0300	[thread overview]
Message-ID: <20201209203042.oqbcijwaxqt5aa7b@mobilestation> (raw)
In-Reply-To: <20201209202552.GE4790@sirena.org.uk>

On Wed, Dec 09, 2020 at 08:25:52PM +0000, Mark Brown wrote:
> On Wed, Dec 09, 2020 at 11:15:35PM +0300, Serge Semin wrote:
> > On Wed, Dec 09, 2020 at 07:54:20PM +0000, Mark Brown wrote:
> 
> > > Right, in general we aim to do this sort of fixup on the transfers
> > > and messages rather than the devices, I guess we might be missing
> > > validation in some of the flash acceleration paths or was this an issue
> > > seen through inspection?
> 
> > In case of DW SPI driver we just make sure the SPI-client device
> > speed set in the max_speed_hz doesn't exceed the controller SPI-bus
> > clock frequency and clamp it if it does. So the driver is safe in that
> > matter.
> 

> Ideally the driver wouldn't have to check though (no harm in doing so of
> course).

If so then we'd need to have a dedicated speed-related field in the
spi_mem_op structure, which would be accordingly initialized by the
SPI-mem core.

-Sergey

  reply	other threads:[~2020-12-09 20:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 17:35 [PATCH] spi: Limit the spi device max speed to controller's max speed Tudor Ambarus
2020-12-09 19:46 ` Serge Semin
2020-12-09 19:54   ` Mark Brown
2020-12-09 20:15     ` Serge Semin
2020-12-09 20:25       ` Mark Brown
2020-12-09 20:30         ` Serge Semin [this message]
2020-12-10  8:58           ` Tudor.Ambarus
2020-12-10 15:33             ` Mark Brown
2020-12-10 16:32               ` Tudor.Ambarus
2020-12-10 18:16                 ` Mark Brown
2020-12-11 17:51 ` Mark Brown
2020-12-15 14:24   ` Geert Uytterhoeven
2020-12-16  8:25     ` Tudor.Ambarus

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=20201209203042.oqbcijwaxqt5aa7b@mobilestation \
    --to=fancer.lancer@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=tudor.ambarus@microchip.com \
    /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).