All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Steve B <sbattazzo@gmail.com>
Cc: xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] RT-CAN question (was: CAN bus on beaglebone black)
Date: Fri, 20 Mar 2015 19:39:48 +0100	[thread overview]
Message-ID: <20150320183948.GC27775@hermes.click-hack.org> (raw)
In-Reply-To: <CAEMXjGwMj1TAr-HUwLXwD+Na0DFBWm9qD5siSzLd_fkpdd9q3g@mail.gmail.com>

On Fri, Mar 20, 2015 at 11:28:21AM -0700, Steve B wrote:
> On Fri, Mar 20, 2015 at 11:16 AM, Gilles Chanteperdrix <
> gilles.chanteperdrix@xenomai.org> wrote:
> 
> > On Fri, Mar 20, 2015 at 10:42:05AM -0700, Steve B wrote:
> > > Michael,
> > > At least for the Beaglebone Black case, it is looking like you will have
> > a
> > > good and simple way of picking which driver you load.
> > > I am working on getting the driver integrated to the Xenomai tree and in
> > > the process making minor tweaks.. by changing the "compatibility" string
> > to
> > > something unique it looks like you can match the CAN device to the driver
> > > in your device tree overlay. Should be no more having to load the
> > original
> > > driver first.
> > >
> > > I have a bit of an issue that I'm trying to work around with splitting
> > the
> > > driver into the multiple source files, but once I get that sorted out it
> > > should be ready to work that way!
> >
> > From what I understood, the device tree is a description of the
> > hardware, so the compatibility string describes what hardware a
> > board/controller is based on. So, it does not make sense to change
> > the compatibility string to change the driver used. This is contrary
> > to the spirit of the device tree. A device tree is supposed to be OS
> > independent, the device tree files licenses for instance, have been
> > chosen to not prevent a device tree file from being used with BSD.
> >
> > --
> >                                             Gilles.
> >
> 
> OK, sorry if I have it backwards. But if I have both drivers in my kernel
> build and they both have the same compatibility string, they both get
> loaded when I load my device tree overlay. In that case how are we supposed
> to specify which one gets loaded?

Loading a driver, but not initializing it is not a problem. I
believe the kernel will not start two drivers for the same device.
At least that is the way it works with other buses (like PCIe or USB).

You can unbind a device to a driver with sysfs files. Then bind the
device to another driver. I do not know if you can do this with
kernel command line arguments.

See for instance:
https://lwn.net/Articles/143397/

-- 
					    Gilles.


  reply	other threads:[~2015-03-20 18:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  9:57 [Xenomai] RT-CAN question (was: CAN bus on beaglebone black) Michael Haberler
2015-03-19 18:44 ` Steve B
2015-03-20  6:15   ` Michael Haberler
2015-03-20  6:58     ` Michael Haberler
2015-03-20  7:26       ` Michael Haberler
2015-03-20  7:54         ` Jan Kiszka
2015-03-20  8:02           ` Michael Haberler
2015-03-20 17:42             ` Steve B
2015-03-20 18:16               ` Gilles Chanteperdrix
2015-03-20 18:28                 ` Steve B
2015-03-20 18:39                   ` Gilles Chanteperdrix [this message]
2015-03-21  8:48                 ` Wolfgang Grandegger
2015-03-21  8:57 ` Wolfgang Grandegger
2015-03-21 14:56   ` Michael Haberler

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=20150320183948.GC27775@hermes.click-hack.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=sbattazzo@gmail.com \
    --cc=xenomai@xenomai.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.