public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Linux-kernel <linux-kernel@vger.kernel.org>,
	Linux USB list <linux-usb@vger.kernel.org>
Subject: "permanently" unbind a device from a driver?
Date: Tue, 20 Jan 2009 23:50:07 +0300	[thread overview]
Message-ID: <497638FF.8050805@msgid.tls.msk.ru> (raw)

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.

I understand that it's easy to write an udev rule
(I don't use udev but that's another story) to
unbind the device from the driver and bind it to
another driver automatically.  That's basically
what I have for now (handling hidraw* device).
But that seems somewhat... ugly, at best.

The question is: is it possible to tell usbhid
to STOP claiming devices with given vendor:device
identifier, from now on?

I also understand that to do it permanently the
given vendor:device has to be blacklisted in the
driver source.  But I don't think it's worth the
effort.  Sort of runtime blacklist support --
possible?

Thanks!

/mjt

             reply	other threads:[~2009-01-20 20:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-20 20:50 Michael Tokarev [this message]
2009-01-20 21:02 ` "permanently" unbind a device from a driver? 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

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=497638FF.8050805@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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