From: Ming Lei <tom.leiming@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: Michael Tokarev <mjt@tls.msk.ru>,
Linux-kernel <linux-kernel@vger.kernel.org>,
Linux USB list <linux-usb@vger.kernel.org>
Subject: Re: "permanently" unbind a device from a driver?
Date: Thu, 22 Jan 2009 10:31:19 +0800 [thread overview]
Message-ID: <d82e647a0901211831k214f730aj4e8fb92cbb6ef43@mail.gmail.com> (raw)
In-Reply-To: <20090121162345.GB22615@kroah.com>
2009/1/22 Greg KH <greg@kroah.com>:
> On Wed, Jan 21, 2009 at 11:44:03PM +0800, Ming Lei wrote:
>> 2009/1/21 Greg KH <greg@kroah.com>:
>> > On Tue, Jan 20, 2009 at 11:50:07PM +0300, Michael Tokarev wrote:
>> >> Is there a way to stop a module from claiming a
>> >> given device no matter how/when it gets plugged?
>> >>
>> >> For example, there's a series of power supplies
>> >> (UPSes) with USB connection (common nowadays)
>> >> which, by default, gets claimed by usbhid module.
>> >> But it does not work as a HID device, instead it
>> >> uses a serial line logic and has a USB<=>serial
>> >> converter inside, which works just fine with
>> >> cypress_m8 usbserial driver.
>> >>
>> >> usbhid module is loaded on startup (to handle
>> >> usb keyboards/mouses), and it claims this device
>> >> too. Using /sys/bus/.../drivers/usbhid/unbind
>> >> releases it, after which cypress_m8 works as
>> >> expected. But after re-plugging it gets claimed
>> >> by usbhid again.
>> >
>> > Just add a blacklist rule to the usbhid driver for this device. There
>> > are a number of devices out there that need this functionality, which is
>> > why there is such a list.
>>
>> Is it possible to implement a generic blacklist mechanism in driver core
>> to support the function for all kinds of drivers? or is it necessary to do that?
>
> It's not necessary as the hid core already supports this very thing due
> to the need for it (it's the easiest way to write a userspace Windows
> driver, so lots of manufacturers lie about their devices in order to
> work around having to write a Windows kernel driver.)
>
> So just add this device to the hid core blacklist, and you are all set.
Yes.
>
> Care to send a patch?
Each low level subsystem(pci/usb/...) has its own
device id format and binding way, so it is impossible
to implement a generic blacklist mechanism in driver core.
It is even difficult to do the blacklist in low level
subsystem of usb. Quirk tables in drivers of high level
subsystem(hid/bt/...) contain information specific to
the high level subsystem,some of which is used to
ignore the device by driver, some of which is used to
do some fixes to support the device.
Maybe we can provide a blacklist mechanism in usb subsystem
to ignore some broken device for driver,but it can not replace the
existing quirks in drivers of high level subsystem.
>
> thanks,
>
> greg k-h
>
--
Lei Ming
prev parent reply other threads:[~2009-01-22 2:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-20 20:50 Michael Tokarev
2009-01-20 21:02 ` Greg KH
2009-01-21 15:44 ` Ming Lei
2009-01-21 16:23 ` Greg KH
2009-01-21 17:20 ` Sam Liddicott
2009-01-21 18:11 ` Greg KH
2009-01-21 21:24 ` Michael Tokarev
2009-01-28 6:19 ` Greg KH
2009-01-29 9:43 ` Jiri Kosina
2009-01-22 2:31 ` Ming Lei [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=d82e647a0901211831k214f730aj4e8fb92cbb6ef43@mail.gmail.com \
--to=tom.leiming@gmail.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mjt@tls.msk.ru \
/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
Powered by JetHome