From: Alex Williamson <alex.williamson@redhat.com>
To: Jeroen Van den Keybus <jeroen.vandenkeybus@triphase.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: Fwd: Attaching drivers to identical PCI devices.
Date: Fri, 28 Feb 2014 12:03:40 -0700 [thread overview]
Message-ID: <1393614220.26901.28.camel@ul30vt.home> (raw)
In-Reply-To: <CAPykPM=HhgvAebJbFW76D2umQjH5jz66FVh9egVY5khvGFNH2Q@mail.gmail.com>
On Fri, 2014-02-28 at 19:54 +0100, Jeroen Van den Keybus wrote:
> I would like to use 2 versions of a PCI driver, each for one of 2
> identical devices. The driver that gets probed first will seize both
> devices in driver_attach().
>
> Using sysfs's bind and unbind methods, you can arrange to release the
> device for use by the other driver, but the first driver has
> nevertheless been initializing, driving and shutting down the device,
> which is unacceptable in my case.
>
> What would be the best way to deal with this ?
It's not a very good solution, but you can use pci-stub to claim both
devices, then manually unbind each from pci-stub and bind it to the
driver you want. Compile pci-stub statically so it gets first dibs
(CONFIG_PCI_STUB=y) and boot with pci-stub.ids=xxxx:yyyy where x/y is
vendor/device ID. Use sysfs to unbind the device you want, load the
driver, repeat for the second device & driver. Thanks,
Alex
prev parent reply other threads:[~2014-02-28 19:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAPykPMmLkQ2O5253EcUFuwNdmMKcL-Nr9KQi1EZoMH2yuHXcjQ@mail.gmail.com>
2014-02-28 18:54 ` Fwd: Attaching drivers to identical PCI devices Jeroen Van den Keybus
2014-02-28 19:03 ` Alex Williamson [this message]
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=1393614220.26901.28.camel@ul30vt.home \
--to=alex.williamson@redhat.com \
--cc=jeroen.vandenkeybus@triphase.com \
--cc=linux-pci@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 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).