All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: stefan.wahren@i2se.com, dri-devel@lists.freedesktop.org,
	linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	meghana.madhyastha@gmail.com, kernel@martin.sperl.org
Subject: Re: [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks
Date: Fri, 12 Apr 2019 12:46:23 +0100	[thread overview]
Message-ID: <20190412114623.GJ6909@sirena.org.uk> (raw)
In-Reply-To: <20190412104644.rg6dxoxuaxptexdj@wunner.de>


[-- Attachment #1.1: Type: text/plain, Size: 1780 bytes --]

On Fri, Apr 12, 2019 at 12:46:44PM +0200, Lukas Wunner wrote:
> On Thu, Apr 11, 2019 at 11:02:26PM +0200, Noralf Trønnes wrote:
> > Den 11.04.2019 20.18, skrev Lukas Wunner:

> > > Note that spi_map_buf() already splits every transfer's sglist into
> > > segments that are smaller than ctlr->max_dma_len.  Now all that needs
> > > to be done is to amend spi-bcm2835.c to iterate over the sglist
> > > and transmit it in portions which do not exceed 65535.  Addressing the
> > > problem at this lower level would drastically reduce the overhead
> > > compared to the approach in the present patch and hence appears to be
> > > more recommendable.

> > In a previous version of this I suggested to Meghana to put this in the
> > driver, but Mark wanted it in the core.

> Do you have a link to these comments of Mark?  The first version of
> this patchset that I have here is v2 of March 2018 and it already
> uses spi_split_transfers_maxsize().  I've never seen a version which
> splits the sglist in spi-bcm2835.c (instead of splitting the transfers
> in spi.c, which, again, is significantly more expensive).

The basic theory is that we shouldn't be open coding the same handling
in multiple drivers, they should just be able to declare their
capabilities and have the core handle things as far as possible.  Since
we're already iterating over the whole message I'd be surprised if there
were a particularly big hit in cases where we don't need to split things
out, though obviously that's not been tested yet.

There have also been discussions in the past about pre-cooking some of
the messages so that if the client is sending the same thing a lot (or
things that vary only by data) we can do a lot of the validation one
time which would help.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-04-12 11:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 16:42 [PATCH v4 0/4] Chunk splitting of spi transfers Noralf Trønnes
2019-04-11 16:42 ` [PATCH v4 1/4] spi: Remove warning in spi_split_transfers_maxsize() Noralf Trønnes
     [not found] ` <20190411164235.49771-1-noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
2019-04-11 16:42   ` [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks Noralf Trønnes
2019-04-11 18:18     ` Lukas Wunner
2019-04-11 21:02       ` Noralf Trønnes
2019-04-12  9:47         ` Mark Brown
     [not found]           ` <20190412094721.GE6909-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2019-04-12 10:03             ` kernel-TqfNSX0MhmxHKSADF0wUEw
2019-04-12 10:22               ` Mark Brown
2019-04-12 10:54           ` Lukas Wunner
2019-04-12 11:09             ` Mark Brown
2019-04-12 11:16               ` Lukas Wunner
2019-04-12 11:28                 ` Mark Brown
     [not found]                 ` <20190412111615.25iogtr6qwc5zbx7-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2019-04-12 11:34                   ` kernel-TqfNSX0MhmxHKSADF0wUEw
2019-04-12 10:46         ` Lukas Wunner
2019-04-12 11:46           ` Mark Brown [this message]
2019-04-11 20:39     ` Noralf Trønnes
     [not found]     ` <20190411164235.49771-3-noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
2019-04-12  9:08       ` Mark Brown
2019-04-11 16:42 ` [PATCH v4 3/4] spi/spi-bcm2835: Remove DMA transfer size cap Noralf Trønnes
2019-04-11 16:42 ` [PATCH v4 4/4] drm/tinydrm: Remove chunk splitting in tinydrm_spi_transfer Noralf Trønnes

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=20190412114623.GJ6909@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@martin.sperl.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=meghana.madhyastha@gmail.com \
    --cc=stefan.wahren@i2se.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 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.