All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>,
	linux-spi@vger.kernel.org, Martin Sperl <kernel@martin.sperl.org>,
	Michal Suchanek <hramrach@gmail.com>
Subject: Re: [PATCH] spi: Force the registration of the spidev devices
Date: Wed, 13 May 2015 21:09:30 +0200	[thread overview]
Message-ID: <20150513190930.GD4004@lukather> (raw)
In-Reply-To: <20150513143610.GT2761@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 3221 bytes --]

On Wed, May 13, 2015 at 03:36:10PM +0100, Mark Brown wrote:
> On Wed, May 13, 2015 at 02:51:02PM +0200, Maxime Ripard wrote:
> 
> > I'd say we're also ok because if we delegate the device driving logic
> > to userspace, we should expect it to know what it does to first drive
> > the device properly, but also to open the right device for this.
> 
> > What's the worst that could happen in such a case? The data are output
> > without any chipselect line being driven by the controller? Isn't that
> > supposed to be ignored by the devices?
> 
> I'm more worried about the chip select line being connected to the
> "make the board catch fire" signal or whatever (more realistically
> causing us to drive against some other external component) if the extra
> chip selects weren't pinmuxed away.

It seems we've had this discussion at lot lately ;)

That indeed might be problematic....

> > > > This also adds an i2cdev-like feeling, where you get all the
> > > > spidev devices all the time, without any modification.
> 
> > > I2C is a bit safer here since it's a shared bus so you can't do
> > > anything to devices not connected to the bus by mistake.
> 
> > I'm not sure to understand what you mean here. How is SPI different
> > from that aspect?
> 
> Chip select signals.

Well, if it's not connected to the bus, it probably won't be connected
to the chip select either, will it?

> > > This still leaves us in the situation where if we do know the device
> > > that is connected we have to explicitly bind it in spidev which is
> > > apparently unreasonably difficult for people.
> 
> > You can still do that, but the point is that you don't have to.
> 
> Right, but that's not what I'd expect to happen (and seems to make it
> easier for people to not list things in the DT at all which doesn't seem
> great).  If we're going to make it available by default I'd expect to be
> able to use a userspace driver with anything that doesn't have a driver
> bound rather than with devices that explicitly don't have any
> identification.

The point is that if we don't have anything declared in the DT, we
won't even have a device. So we can't really expect that the device
will not be bound to a driver, because it won't even be there in the
first place.

> > > I'm also concerned about the interactions with DT overlays here -
> > > what happens if a DT overlay or other dynamic hardware instantiation
> > > comes along later and does bind something to this chip select?  It
> > > seems like we should be able to combine the two models, and the fact
> > > that we only create these devices with a Kconfig option is a bit of
> > > an interesting thing here.
> 
> > I think the safe approach would be, just like I told in this thread,
> > to just check whether the modalias is spidev. If it is, destroy the
> > previous (spidev) device, create a new device as specified by the DT,
> > you're done.
> 
> Sure, but I don't see code for that here.

No, of course. Remember that this code was written before the overlays
were posted.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-05-13 19:09 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 20:33 [PATCH] spi: Force the registration of the spidev devices Maxime Ripard
2015-05-12 20:33 ` Maxime Ripard
     [not found] ` <1431462804-30467-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-05-13  9:34   ` [PATCH] spi: Add option to bind spidev to all chipselects Michal Suchanek
2015-05-13  9:34     ` Michal Suchanek
     [not found]     ` <20150513093441.80359.qmail-ve7rdfgbAvJ3WEpVTuSGmqVXKuFTiq87@public.gmane.org>
2015-05-13 10:16       ` Maxime Ripard
2015-05-13 10:16         ` Maxime Ripard
2015-05-13 10:40         ` Michal Suchanek
2015-05-13 10:40           ` Michal Suchanek
2015-05-13 11:05       ` Mark Brown
2015-05-13 11:05         ` Mark Brown
2015-05-13 11:26   ` [PATCH] spi: Force the registration of the spidev devices Mark Brown
2015-05-13 11:26     ` Mark Brown
     [not found]     ` <20150513112604.GI3066-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 12:35       ` Michal Suchanek
2015-05-13 12:35         ` Michal Suchanek
2015-05-13 12:51       ` Maxime Ripard
2015-05-13 12:51         ` Maxime Ripard
2015-05-13 14:36         ` Mark Brown
2015-05-13 14:36           ` Mark Brown
     [not found]           ` <20150513143610.GT2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 15:31             ` Michal Suchanek
2015-05-13 15:31               ` Michal Suchanek
     [not found]               ` <CAOMqctTd7xG6mwX9AojTH4uaGDY06xOgDFUP437VDiE0rp0sXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-13 17:43                 ` Mark Brown
2015-05-13 17:43                   ` Mark Brown
2015-05-13 19:09           ` Maxime Ripard [this message]
2015-05-13 19:10         ` Geert Uytterhoeven
2015-05-13 19:10           ` Geert Uytterhoeven
     [not found]           ` <CAMuHMdWJ730G_a6=vQgs4gV837am5KKd7zEhU2FaHw2cpv=aRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-13 19:41             ` Maxime Ripard
2015-05-13 19:41               ` Maxime Ripard
2015-05-13 15:37       ` Greg Kroah-Hartman
2015-05-13 15:37         ` Greg Kroah-Hartman
     [not found]         ` <20150513153740.GC11677-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-13 15:52           ` Michal Suchanek
2015-05-13 15:52             ` Michal Suchanek
2015-05-13 17:13           ` Mark Brown
2015-05-13 17:13             ` Mark Brown
     [not found]             ` <20150513171300.GD2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 17:20               ` Greg Kroah-Hartman
2015-05-13 17:20                 ` Greg Kroah-Hartman
     [not found]                 ` <20150513172028.GA18303-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-13 17:39                   ` Mark Brown
2015-05-13 17:39                     ` Mark Brown
     [not found]                     ` <20150513173922.GF2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 18:16                       ` Greg Kroah-Hartman
2015-05-13 18:16                         ` Greg Kroah-Hartman
2015-05-13 18:32                         ` Mark Brown
     [not found]                           ` <20150513183211.GK2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 18:36                             ` Greg Kroah-Hartman
2015-05-13 18:36                               ` Greg Kroah-Hartman
     [not found]                               ` <20150513183653.GA879-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-13 18:51                                 ` Mark Brown
2015-05-13 18:51                                   ` Mark Brown
     [not found]                                   ` <20150513185149.GL2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 19:17                                     ` Maxime Ripard
2015-05-13 19:17                                       ` Maxime Ripard
2015-05-13 17:50           ` Maxime Ripard
2015-05-13 17:50             ` Maxime Ripard
2015-05-13 18:12             ` Mark Brown
2015-05-13 18:17             ` Greg Kroah-Hartman
2015-05-13 18:17               ` Greg Kroah-Hartman
     [not found]               ` <20150513181736.GC16811-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-13 19:23                 ` Geert Uytterhoeven
2015-05-13 19:23                   ` Geert Uytterhoeven
2015-05-13 19:26                 ` Maxime Ripard
2015-05-13 19:26                   ` Maxime Ripard
2015-05-13 22:33                   ` Greg Kroah-Hartman
2015-05-13 22:33                     ` Greg Kroah-Hartman
     [not found]                     ` <20150513223331.GA26748-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-14 14:34                       ` Mark Brown
2015-05-14 14:34                         ` Mark Brown
2015-07-15  6:27                       ` Lucas De Marchi
2015-07-15  6:27                         ` Lucas De Marchi
2015-05-15  8:09                     ` Maxime Ripard
  -- strict thread matches above, loose matches on Subject: below --
2014-04-28 17:22 Maxime Ripard
2014-04-28 17:22 ` Maxime Ripard
     [not found] ` <1398705774-12361-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-04-29 18:37   ` Mark Brown
2014-04-29 18:37     ` Mark Brown
     [not found]     ` <20140429183758.GH15125-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-04-29 21:31       ` Martin Sperl
     [not found]         ` <24BF05CB-35FF-42E8-BE5C-A5E4E3D0C52A-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2014-04-30 18:14           ` Maxime Ripard
2014-04-30 20:00             ` Martin Sperl
     [not found]               ` <DA3907EB-0C1B-42FB-B288-9E33F6E24E3E-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2014-04-30 22:19                 ` Maxime Ripard
2014-05-01  1:21                 ` Mark Brown
2014-04-30 18:06       ` Maxime Ripard
2014-04-30 18:06         ` Maxime Ripard
2014-05-01  1:18         ` Mark Brown
2014-05-01  1:18           ` Mark Brown
     [not found]           ` <20140501011811.GF3245-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-05-01 22:36             ` Maxime Ripard
2014-05-01 22:36               ` Maxime Ripard
2014-05-01 23:28               ` Geert Uytterhoeven
     [not found]                 ` <CAMuHMdUWa1_n94sDvv=L_goc+SOnD9CAKi5DzifrY7GWYRdQmw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-02 16:55                   ` Mark Brown
2014-05-02 16:55                     ` Mark Brown
2014-05-05  4:17                 ` Maxime Ripard
2014-05-05  7:10                   ` Geert Uytterhoeven
     [not found]                     ` <CAMuHMdWZ1rvC+tkT=CbfMwZtppyJ_KpzT7JrLd5k5P2oxzA+8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-05 13:57                       ` Alexandre Belloni
2014-05-05 13:57                         ` Alexandre Belloni
     [not found]                         ` <20140505135701.GA21940-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2014-05-05 14:22                           ` Geert Uytterhoeven
2014-05-05 14:22                             ` Geert Uytterhoeven
2014-05-05 19:16                     ` Mark Brown
2014-05-02 17:40               ` Mark Brown
2014-05-02 17:40                 ` Mark Brown
2014-05-05  4:21                 ` Maxime Ripard
2014-05-05 19:17                   ` Mark Brown
2014-05-05 19:17                     ` Mark Brown
     [not found]                     ` <20140505191723.GK22111-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-05-08  2:22                       ` Maxime Ripard
2014-05-08  2:22                         ` Maxime Ripard

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=20150513190930.GD4004@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=hramrach@gmail.com \
    --cc=kernel@martin.sperl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.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 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.