From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
Ian Abbott <abbotti@mev.co.uk>, Ian Abbott <ian.abbott@mev.co.uk>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 15/90] staging: comedi: adv_pci1723: move comedi_pci_enable() into the attach
Date: Thu, 19 Jul 2012 17:15:44 -0700 [thread overview]
Message-ID: <20120720001544.GA15590@kroah.com> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F00206AA9165C1@AUSP01VMBX24.collaborationhost.net>
On Thu, Jul 19, 2012 at 06:58:38PM -0500, H Hartley Sweeten wrote:
> On Thursday, July 19, 2012 4:35 PM, gregkh wrote:
> > On Thu, Jul 19, 2012 at 06:31:23PM -0500, H Hartley Sweeten wrote:
> >> If the comedi pci drivers have the "attach_pci" callback defined, the
> >> PCI api does correctly probe the driver. The comedi_pci_auto_config()
> >> then passes the pci_dev directly to the driver and the search of the
> >> PCI space for the device is not required.
> >>
> >> If the "attach_pci" callback is not defined, the comedi_pci_auto_config()
> >> then falls back to passing the bus/slot information to the driver and uses
> >> the "attach" callback. In this case we could probably fast-track the search
> >> by using pci_get_slot() instead of doing the for_each_pci_dev() loop.
> >>
> >> I think the problem is the COMEDI_DEVCONFIG ioctl. The userspace
> >> utility 'comedi_config' uses that ioctl to link a device node to a
> >> comedi driver. That utility allows passing the bus/slot information
> >> but it's not required. This means we have to search the PCI space
> >> for the pci_dev that matches the driver.
> >
> > The ioctl shouldn't be needed anymore for PCI or USB devices, as the
> > kernel handles the matching of the driver to the device. Even if it
> > didn't, there are other more "standard" ways that you can bind devices
> > to drivers (through sysfs.)
>
> I think it's still needed for some of the devices that require external
> firmware. The comedi_config utility allows the user to remove the
> driver binding and then reattach to it while passing the firmware blob
> into the driver.
Why would the driver need to be unbound from the device to do this?
> Not saying any of this is valid... And yes, there probably is a more
> "standard" way to do this. I just need a hint of what that is... ;-)
The "bind" and "unbind" files in sysfs are for that.
thanks,
greg k-h
next prev parent reply other threads:[~2012-07-20 0:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 1:30 [PATCH 15/90] staging: comedi: adv_pci1723: move comedi_pci_enable() into the attach H Hartley Sweeten
2012-07-19 9:37 ` Ian Abbott
2012-07-19 17:12 ` H Hartley Sweeten
2012-07-19 23:17 ` gregkh
2012-07-19 23:31 ` H Hartley Sweeten
2012-07-19 23:35 ` gregkh
2012-07-19 23:58 ` H Hartley Sweeten
2012-07-20 0:15 ` gregkh [this message]
2012-07-20 16:33 ` H Hartley Sweeten
2012-07-20 18:01 ` gregkh
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=20120720001544.GA15590@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=hartleys@visionengravers.com \
--cc=ian.abbott@mev.co.uk \
--cc=linux-kernel@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