linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Additional SPI-master parameters per SPI-Device in device-tree
Date: Tue, 04 Aug 2015 12:09:52 +0200	[thread overview]
Message-ID: <55C08F70.5070303@martin.sperl.org> (raw)
In-Reply-To: <20150804095443.GH20873-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

On 04.08.2015 11:54, Mark Brown wrote:
> On Tue, Aug 04, 2015 at 08:39:20AM +0200, Martin Sperl wrote:
>> Examples for the spi-bcm2835 master for example could be:
>> * set minimum transfer size for dma to something else but the default
>>     (of 96 bytes - setting for something high would disable it)
>> * change polling transfer limits (i.e disable it)
>
> Why would these things be configured in the device tree in the first
> place?  They don't look like things that should be device tree
> properties, they look like something the kernel should figure out at
> runtime - the system tuning may change as the kernel evolves or
> depending on userspace needs.

Sometimes it may be necessary to define different values than the
"kernel" thinks may be necessary (hardcoded).

We just had one issue with fbtft devices where it would have been
nice to change those values on a per device basis (even if it was
just for some testing to see why it was behaving badly
- see the still un-merged patch:
"spi: bcm2835: set up spi-mode before asserting cs-gpio").

So I first thought of adding it as a module parameter for the driver
and then exposing it via sysfs for modification, but now I think it
might be even more beneficial to "tune" the parameters per device.

Say for fbtft devices to use DMA for any xfer-size above 4 bytes.
But that policy may not apply to the corresponding touch screen device
also connected to the same SPI bus.

But then - I now come to realize - that this "dt-property" idea
may again break the "philosophy" of "device-tree only contains
a description of the HW".

So maybe a per device sysfs approach together with udev-rules to
change those settings may be the better approach.

But even those may require those device registration hooks I had
mentioned.

So I was wondering what was feasible/acceptable.

Martin
--
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:[~2015-08-04 10:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04  6:39 Additional SPI-master parameters per SPI-Device in device-tree Martin Sperl
     [not found] ` <55C05E18.600-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-08-04  9:54   ` Mark Brown
     [not found]     ` <20150804095443.GH20873-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-08-04 10:09       ` Martin Sperl [this message]
     [not found]         ` <55C08F70.5070303-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-08-04 11:15           ` Mark Brown
     [not found]             ` <20150804111528.GL20873-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-08-04 11:37               ` Martin Sperl
     [not found]                 ` <55C0A40C.5070806-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-08-04 15:00                   ` 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=55C08F70.5070303@martin.sperl.org \
    --to=kernel-tqfnsx0mhmxhksadf0wuew@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@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 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).