All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Michal Suchanek <hramrach@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] drivers core: allow id match override when manually binding driver
Date: Mon, 27 Jun 2016 15:12:59 -0700	[thread overview]
Message-ID: <20160627221259.GA10054@kroah.com> (raw)
In-Reply-To: <CAOMqctQj0ftbOH9dvMPczBPeSFTvDuTKCXgYprYvtcQDYML8Kw@mail.gmail.com>

On Mon, Jun 27, 2016 at 09:40:38PM +0200, Michal Suchanek wrote:
> On 27 June 2016 at 21:09, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > On Mon, Jun 27, 2016 at 09:02:32PM +0200, Michal Suchanek wrote:
> >> The spi bus has no autodetection whatsoever. The 'detection' of the
> >> device that's suposed to be on the other side completely relies on user
> >> supplied information coming from devicetree on many platforms. It is
> >> completely reasonable then to allow the user to supply the information
> >> at runtime by doing echo 'somedevice' >
> >> /sys/bus/spi/drivers/somedriver/bind
> >> This fails if somedriver does not have in its id table compatible of
> >> somedevice so just skip this check for manual driver binding.
> >
> > That's what the new_id file is for, right?
> >
> 
> No. It's for buses that have some inherent identification. It's not for
> 
> 1) generate random compatible and stick it in device tree
> 2) reboot with new devicetree or load overlay
> 3) write the random compatible you just generated to new_id file so
> you can bind drivers to your device
> 
> You could have saved yourself a lot of hassle just ignoring the ID completely.

Um, all devices have to have an "id" the driver core enforces this.

Now your bus can ignore them, or do whatever it wants, but really, you
can't just try to wave them away.

> Do you have to go through that to connect a different modem to your
> serial port?

As has been said numerous times, there is no serial port bus, but people
are working on it.

And no, you don't, and serial _devices_ work just fine with the driver
model.

> Or even a new i2c device to i2c bus?

If you have an unknown i2c device, yes you do.

> also AFAIK new_id is not automagic and not all buses have it.

That's up to the bus to enable that option.  Just like you are creating
a new option.

> So it would have to be implemented on SPI. How? On PCI new_id is a PCI
> id. What is it on SPI? ACPI PnP id? DT compatible? How do you tell?
> And why when the bus does not even have IDs?

Then fake the id out, like all other dumb busses that don't have an id.

Again, I'm not going to take this driver core change, sorry.

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
To: Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 3/3] drivers core: allow id match override when manually binding driver
Date: Mon, 27 Jun 2016 15:12:59 -0700	[thread overview]
Message-ID: <20160627221259.GA10054@kroah.com> (raw)
In-Reply-To: <CAOMqctQj0ftbOH9dvMPczBPeSFTvDuTKCXgYprYvtcQDYML8Kw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, Jun 27, 2016 at 09:40:38PM +0200, Michal Suchanek wrote:
> On 27 June 2016 at 21:09, Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> wrote:
> > On Mon, Jun 27, 2016 at 09:02:32PM +0200, Michal Suchanek wrote:
> >> The spi bus has no autodetection whatsoever. The 'detection' of the
> >> device that's suposed to be on the other side completely relies on user
> >> supplied information coming from devicetree on many platforms. It is
> >> completely reasonable then to allow the user to supply the information
> >> at runtime by doing echo 'somedevice' >
> >> /sys/bus/spi/drivers/somedriver/bind
> >> This fails if somedriver does not have in its id table compatible of
> >> somedevice so just skip this check for manual driver binding.
> >
> > That's what the new_id file is for, right?
> >
> 
> No. It's for buses that have some inherent identification. It's not for
> 
> 1) generate random compatible and stick it in device tree
> 2) reboot with new devicetree or load overlay
> 3) write the random compatible you just generated to new_id file so
> you can bind drivers to your device
> 
> You could have saved yourself a lot of hassle just ignoring the ID completely.

Um, all devices have to have an "id" the driver core enforces this.

Now your bus can ignore them, or do whatever it wants, but really, you
can't just try to wave them away.

> Do you have to go through that to connect a different modem to your
> serial port?

As has been said numerous times, there is no serial port bus, but people
are working on it.

And no, you don't, and serial _devices_ work just fine with the driver
model.

> Or even a new i2c device to i2c bus?

If you have an unknown i2c device, yes you do.

> also AFAIK new_id is not automagic and not all buses have it.

That's up to the bus to enable that option.  Just like you are creating
a new option.

> So it would have to be implemented on SPI. How? On PCI new_id is a PCI
> id. What is it on SPI? ACPI PnP id? DT compatible? How do you tell?
> And why when the bus does not even have IDs?

Then fake the id out, like all other dumb busses that don't have an id.

Again, I'm not going to take this driver core change, sorry.

greg k-h
--
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:[~2016-06-27 22:13 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27 19:02 [PATCH v2 0/3] Updated spidev usability patchset Michal Suchanek
2016-06-27 19:02 ` Michal Suchanek
2016-06-27 19:02 ` [PATCH v2 1/3] spi: spidev: fix the check for spidev in dt Michal Suchanek
2016-06-27 20:36   ` Mark Brown
2016-06-27 20:36     ` Mark Brown
2016-06-27 19:02 ` [PATCH v2 2/3] spi: of: allow instantiating slaves without a driver Michal Suchanek
2016-06-27 21:14   ` Mark Brown
2016-06-27 21:14     ` Mark Brown
2016-06-27 19:02 ` [PATCH v2 3/3] drivers core: allow id match override when manually binding driver Michal Suchanek
2016-06-27 19:02   ` Michal Suchanek
2016-06-27 19:09   ` Greg Kroah-Hartman
2016-06-27 19:09     ` Greg Kroah-Hartman
2016-06-27 19:40     ` Michal Suchanek
2016-06-27 19:40       ` Michal Suchanek
2016-06-27 20:32       ` Mark Brown
2016-06-27 20:32         ` Mark Brown
2016-06-27 22:12       ` Greg Kroah-Hartman [this message]
2016-06-27 22:12         ` Greg Kroah-Hartman
2016-06-28 12:40         ` Michal Suchanek
2016-06-28 12:40           ` Michal Suchanek
2016-06-28 15:51           ` Mark Brown
2016-06-28 15:51             ` Mark Brown
2016-06-28 16:24             ` Michal Suchanek
2016-06-28 16:24               ` Michal Suchanek
2016-06-28 18:38               ` Mark Brown
2016-06-28 18:38                 ` Mark Brown
2016-06-28 20:02                 ` Michal Suchanek
2016-06-28 20:57                   ` Mark Brown
2016-06-28 20:57                     ` Mark Brown
2016-06-29  3:32                     ` Michal Suchanek
2016-06-29  3:32                       ` Michal Suchanek
2016-06-29 18:02                       ` Mark Brown
2016-06-29 18:02                         ` Mark Brown
2016-06-30  7:47                         ` Michal Suchanek
2016-06-30  7:47                           ` Michal Suchanek
2016-06-30  9:03                           ` Dan O'Donovan
2016-06-30  9:03                             ` Dan O'Donovan
2016-07-01  9:36                             ` Mark Brown
2016-07-01 10:11                               ` Michal Suchanek
2016-07-01 10:11                                 ` Michal Suchanek
2016-07-01  8:25                           ` Mark Brown
2016-07-01  8:58                             ` Michal Suchanek
2016-07-01  8:58                               ` Michal Suchanek
2016-07-01 15:00                               ` Mark Brown
2016-07-01 15:37                                 ` Michal Suchanek
2016-07-01 16:22                                   ` Mark Brown
2016-07-01 18:56                                     ` Michal Suchanek
2016-07-01 18:56                                       ` Michal Suchanek
2016-07-01 19:36                                       ` Michal Suchanek
2016-07-01 19:36                                         ` Michal Suchanek

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=20160627221259.GA10054@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=broonie@kernel.org \
    --cc=hramrach@gmail.com \
    --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.