linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@booyaka.com>
To: Jiri Kosina <jikos@jikos.cz>
Cc: linux-input@atrey.karlin.mff.cuni.cz
Subject: Re: [PATCH 0/7] usbhid: add load-time and run-time USB HID quirks configuration
Date: Mon, 19 Mar 2007 14:10:15 -0600 (MDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703191322010.9906@utopia.booyaka.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0703191408400.5030@twin.jikos.cz>

Hello Jiri,

thanks for the review.

On Mon, 19 Mar 2007, Jiri Kosina wrote:

> You can currently "force" HID_QUIRK_IGNORE for the device that has been
> already bound to usbhid driver through 'unbind' file in sysfs. This lets
> you to ask usbhid driver to release the device. So you can just have
> HID_QUIRK_HIDDEV quirk set, and bind/unbind the device depending whether
> you want to use hiddev driver or a separate driver.

Thanks, I was unaware of that 'unbind' feature.  Defining HID_QUIRK_HIDDEV 
by default seems sort of kludgy, but it would probably work for my 
purposes.  Certainly my preference would still be for some sort of boot or 
runtime configuration for this, so the device is associated with the 
proper driver upon initial plugin.

> Also your solution cosumes significantly more memory (adding 16 bits to
> every hid_blacklist entry, duplicating the information into list that in
> most cases will stay intact and just mirror the contents of
> hid_blacklist). Not that it's a big issue, but still worth noting.

Right now there are about 160 entries in the hid_blacklist, so adding the 
mask costs about 320 bytes extra.  If that's a concern, a bigger issue is 
the list_head added to each hid_blacklist entry - two pointers per entry - 
so, 1280 bytes on a 32-bit machine (not counting the list head itself)

If you'd rather not to have the mask code in the patch, I'll drop it. 
It's only in there to remove the runtime-immutable special-case code for 
Wacom and Codemercs devices, so it's not really useful for my specific 
concern.

> There are also some CodingStyle issues (like inconsistent usage of "return
> something" and "return(something);" and over-commenting on some places (no
> need to say that we are going to allocate memory before calling kmalloc(),
> etc.), but these are not that important now.

If you ultimately decide you want the patchset, I'll respin it with these 
issues resolved to your satisfaction.

> To summarize: do you see any other application of your aproach, for any
> currently existing devices/drivers, that can't be accomplished by
> unbinding the usbhid driver from the device?

Aside from other devices that have a similar HIDDEV/IGNORE situation, 
there are two other possible uses that occur to me - but I don't know if 
either one is compelling enough to justify the extra code involved in the 
patchset.  I suspect that runtime quirks configuration would probably be 
useful for testing new HID devices.  I can also foresee a situation where 
a manufacturer revises a device, and an existing quirk is no longer 
applicable for some users, or a new quirk needs to be added for particular 
users.  But, these are both theoretical use cases.  Since the patches have 
been useful for me, I wouldn't mind seeing them in mainline, but I don't 
have any stake in it either way.

(re procfs usage)
> This is unfortunately also not going to fly - the general rule of thumb is
> that no new entries should be added into /proc. You could acomplish the
> very same functionality through sysfs, right?

Yes - if you decide that you want the patchset, I'll convert it to sysfs.


regards,

- Paul

  reply	other threads:[~2007-03-19 20:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19  4:21 [PATCH 0/7] usbhid: add load-time and run-time USB HID quirks configuration Paul Walmsley
2007-03-19 13:24 ` Jiri Kosina
2007-03-19 20:10   ` Paul Walmsley [this message]
2007-03-20 17:26     ` Jiri Kosina
2007-03-21 17:45       ` Paul Walmsley
  -- strict thread matches above, loose matches on Subject: below --
2007-03-21 10:14 Li Yu

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=Pine.LNX.4.64.0703191322010.9906@utopia.booyaka.com \
    --to=paul@booyaka.com \
    --cc=jikos@jikos.cz \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    /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).