public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] spi: orion.c: Add direct access mode
Date: Wed, 23 Mar 2016 20:51:18 +0100	[thread overview]
Message-ID: <12458203.7DzKuGjIvi@wuerfel> (raw)
In-Reply-To: <20160323135606.GE19953@lunn.ch>

On Wednesday 23 March 2016 14:56:06 Andrew Lunn wrote:
> On Wed, Mar 23, 2016 at 01:36:12PM +0000, Mark Brown wrote:
> > On Wed, Mar 23, 2016 at 02:26:37PM +0100, Andrew Lunn wrote:
> > 
> > > The number of windows is limited. On i think the Armada XP, if you put
> > > a PCIe device on every available PCIe bus, you can run out of
> > > windows. This is why Thomas implemented dynamic allocation of the
> > > Windows, so that only those that are needed are used.
> > 
> > > So i would not statically and globally allocate as many windows as
> > > possible SPI devices.
> > 
> > > The fact that SPI can fall back to another mechanism if there are no
> > > available windows, were as PCIe cannot, suggests that SPI should
> > > dynamically allocate a window, and be prepared for it to fail.
> > 
> > > Since only one SPI device can be active at once on a SPI bus, one
> > > window per bus makes sense, and keeps the required number of windows
> > > to a minimum.
> > 
> > If we're under pressure for windows I'd go further and say that we
> > should be dynamically allocating the windows only when they're actually
> > in use (and modifying other drivers to do the same if that makes sense
> > for them), unless it's somehow expensive to allocate windows that means
> > that we should reduce the overall pressure.
> 
> Hi Mark
> 
> We are only under pressure in the extremes, i.e 10 PCIe busses in
> use. Only allocating PCIe Windows when needed means in practice, we
> have not had issues. We need to be mindful, and don't waste them, but
> we don't need to consider them a scarce resource.
> 
> I don't see it being an issue for the SPI driver to allocate one on
> probe and keeping it until release. I probably would object to it
> allocating one per chip select line.

I agree. We had a very long debate about this when we first added
the support for MBus, and not much has changed. As far as I'm concerned,
this is where we're at:

The binding defines a reasonable set of default settings for each
device that uses MBus, and the OS can use them, or define its own.
Coming up with an algorithm to do this right however is very hard
and not really worth it, as defining the defaults works well enough.

Ideally we'd let the boot loader set up the windows statically and
have the DT describe what they are, but unfortunately that is not
what boot loaders in the field do.

The method that was picked for MBus is similar to how we typically
handle PCI host bridges that have the same problem: you can set up
translation windows between CPU addresses and the various PCI
address spaces (I/O, mem, prefetchable, config, ...) in all sorts
of ways, with various tradeoffs, but instead we just pick a
reasonable default and describe it in the DT, because the kernel
has no good generic way of picking a particular setting over another.

	Arnd

  reply	other threads:[~2016-03-23 19:51 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 16:24 [PATCH v2] spi: orion.c: Add direct access mode Stefan Roese
2016-03-22 16:35 ` Thomas Petazzoni
2016-03-22 16:44   ` Stefan Roese
2016-03-23 11:33     ` Mark Brown
2016-03-23 11:59       ` Stefan Roese
2016-03-23 12:54         ` Mark Brown
2016-03-23 13:10           ` Stefan Roese
2016-03-23 13:26             ` Andrew Lunn
2016-03-23 13:36               ` Mark Brown
2016-03-23 13:56                 ` Andrew Lunn
2016-03-23 19:51                   ` Arnd Bergmann [this message]
2016-03-24  7:22                     ` Stefan Roese
2016-03-24 12:42                       ` Arnd Bergmann
2016-03-24 16:15                         ` Stefan Roese
2016-03-24 16:42                           ` Arnd Bergmann
2016-03-24 17:30                             ` Stefan Roese
2016-03-24 16:48                           ` Arnd Bergmann
2016-03-24 17:51                             ` Stefan Roese
2016-03-24 20:07                               ` Arnd Bergmann
2016-03-25 10:32                                 ` Mark Brown
2016-03-25 15:11                                   ` Arnd Bergmann
2016-03-25 15:50                                     ` Mark Brown
2016-03-25 20:58                                       ` Arnd Bergmann
2016-03-25 22:39                                         ` Mark Brown
2016-03-29 12:39                                           ` Arnd Bergmann
2016-03-29 16:47                                             ` Mark Brown
2016-03-29 19:49                                               ` Arnd Bergmann
2016-03-29 19:52                                                 ` Mark Brown
2016-03-29 20:04                                                   ` Arnd Bergmann
2016-03-29 21:00                                                     ` Mark Brown
2016-03-29 21:08                                                       ` Arnd Bergmann
2016-03-29 21:28                                                         ` Mark Brown
2016-03-29 22:04                                                           ` Arnd Bergmann
2016-04-05  7:11                                                             ` Stefan Roese
2016-04-05 13:15                                                               ` Andrew Lunn
2016-04-05 13:20                                                                 ` Stefan Roese
2016-04-05 13:31                                                                   ` Andrew Lunn
2016-03-23 13:27             ` Mark Brown
2016-03-23 17:25               ` Stefan Roese
2016-03-23 18:29                 ` Mark Brown
2016-03-23 18:39                 ` Andrew Lunn
2016-03-24  5:45                   ` Stefan Roese
2016-03-24 11:23                     ` Mark Brown
2016-03-24 12:05                       ` Stefan Roese
2016-03-22 17:39   ` 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=12458203.7DzKuGjIvi@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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