All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* Matching semantics for version numbers....
@ 2001-03-20 21:12 Matthew Dharm
  2001-03-21  6:12 ` David Brownell
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matthew Dharm @ 2001-03-20 21:12 UTC (permalink / raw
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]

I recently discovered a small problem in the code that matches devices to
drivers in the way version numbers are handled.

The tests used against version numbers are < and > -- while this doesn't
seem like a problem at first, consider usb-storage where we need to have
one entry for a device up to rev 3.00, and a different entry for devices
rev 3.00 and higher.  The current mechanism means that the first entry must
test against less than 3.00 and the second against greater than 2.99, which
is counter-intuitive at best. 

I'd like to change these to <= and >= -- and yes, I understand what a major
change that is.  The drivers which use the version numbers would have to be
changed, and so would the hotplug scripts.  But I wanted to throw this idea
out there for consideration.  It's certainly much easier to maintain the
code with the <= and >= semantics, since I can give a definate termination
point to my entries.  With these semantics, the above example uses <= 2.99
and >= 3.00 as the test values respectively, which is much clearer.

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

THEY CASTRATED MY QUAKE BITS! I WANT THEM BACK!!!!
					-- Greg
User Friendly, 3/27/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Matching semantics for version numbers....
  2001-03-20 21:12 Matching semantics for version numbers Matthew Dharm
@ 2001-03-21  6:12 ` David Brownell
  2001-03-21 18:54 ` Matthew Dharm
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Brownell @ 2001-03-21  6:12 UTC (permalink / raw
  To: linux-hotplug

Hi Matt,

Two comments come to mind:

(1) Is it correct that changing this would involve no more than:

* Linux 2.4.? kernel updates:
    - drivers/usb/usb.c ... usb_match_id()
    - drivers/usb/ibmcam.c ... uses range matching
    - drivers/usb/storage/unusual_devs.h ... lots of ranges
* Hotplug scripts
* "usbmodules"
* No spec/documentation (yet)

Distributions would need to get all those updates at once;
I don't know how much of a problem that'd be, except
that if there's no coordination then it'll be painful.  If it
happens, this should all be ready at the same time.  (Not
like the original match_flags patch ... though goofing this
up would break less, since "modutils" will still work.)

(2) For some reason my preference in this area would
be to use "low <= value < high" range specs rather the
current "low < value < high" or "low <= value <= high".

That's just a better match to how I normally think about
such ranges -- not a huge deal, but it seems like Jeff
Ozvold had a similar thought.  So maybe I'm not alone
in thinking about those bcd version codes that way.

- Dave




_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Matching semantics for version numbers....
  2001-03-20 21:12 Matching semantics for version numbers Matthew Dharm
  2001-03-21  6:12 ` David Brownell
@ 2001-03-21 18:54 ` Matthew Dharm
  2001-03-22 19:23 ` David Brownell
  2001-03-22 19:50 ` Matthew Dharm
  3 siblings, 0 replies; 5+ messages in thread
From: Matthew Dharm @ 2001-03-21 18:54 UTC (permalink / raw
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 2258 bytes --]

On Tue, Mar 20, 2001 at 10:12:09PM -0800, David Brownell wrote:
> Hi Matt,
> 
> Two comments come to mind:
> 
> (1) Is it correct that changing this would involve no more than:
> 
> * Linux 2.4.? kernel updates:
>     - drivers/usb/usb.c ... usb_match_id()
>     - drivers/usb/ibmcam.c ... uses range matching

I'm not certain if this range-matching is done correctly for < > or if it
thinks <= and >=, but assuming it's "working" now, yes, it would need
changing.

>     - drivers/usb/storage/unusual_devs.h ... lots of ranges

This wouldn't need updating -- it's actually improperly coded right now
with the assumption of <= and >= (which was how my custom matching code
worked).

> * Hotplug scripts
> * "usbmodules"

I'm not sure what you mean by this item.

> * No spec/documentation (yet)

Other than my comments above, yes, that should be all the changes.

> Distributions would need to get all those updates at once;
> I don't know how much of a problem that'd be, except
> that if there's no coordination then it'll be painful.  If it
> happens, this should all be ready at the same time.  (Not
> like the original match_flags patch ... though goofing this
> up would break less, since "modutils" will still work.)

AFAICT, yes.  Having one part of the patch (assuming the 2 kernel files
count as one "part") doesn't break anything.

> (2) For some reason my preference in this area would
> be to use "low <= value < high" range specs rather the
> current "low < value < high" or "low <= value <= high".
> 
> That's just a better match to how I normally think about
> such ranges -- not a huge deal, but it seems like Jeff
> Ozvold had a similar thought.  So maybe I'm not alone
> in thinking about those bcd version codes that way.

Someone mentioned this to me in a private e-mail... it seems reasonable, as
then range checks can be 0.00 -- 3.00, and 3.00 -- 9.99 with no overlap.
Tho, it _must_ be well documented that the low and high parameters are
matched slightly differently.

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

Ye gods! I have feet??!
					-- Dust Puppy
User Friendly, 12/4/1997

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Matching semantics for version numbers....
  2001-03-20 21:12 Matching semantics for version numbers Matthew Dharm
  2001-03-21  6:12 ` David Brownell
  2001-03-21 18:54 ` Matthew Dharm
@ 2001-03-22 19:23 ` David Brownell
  2001-03-22 19:50 ` Matthew Dharm
  3 siblings, 0 replies; 5+ messages in thread
From: David Brownell @ 2001-03-22 19:23 UTC (permalink / raw
  To: linux-hotplug

> > * Hotplug scripts
> > * "usbmodules"
>
> I'm not sure what you mean by this item.

The "usbmodules" addition to "usbutils", from Adam Richter.
It's needed for some kinds of "cold plug" (handling devices
present at boot) and for multiple-interface devices.  It's
been posted to both these lists ... should probably put it
into one of the patch areas at SourceForge, I don't think
Thomas' latest "usbutils" has the current version.


Overall this proposed change falls into the category of
stuff that seems better done than not.

- Dave



_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Matching semantics for version numbers....
  2001-03-20 21:12 Matching semantics for version numbers Matthew Dharm
                   ` (2 preceding siblings ...)
  2001-03-22 19:23 ` David Brownell
@ 2001-03-22 19:50 ` Matthew Dharm
  3 siblings, 0 replies; 5+ messages in thread
From: Matthew Dharm @ 2001-03-22 19:50 UTC (permalink / raw
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

Well, I'm not hearing any complaints... so who is going to do it?  I
can't... I can barely send e-mail right now (little 'net access)...

Matt

On Thu, Mar 22, 2001 at 11:23:46AM -0800, David Brownell wrote:
> > > * Hotplug scripts
> > > * "usbmodules"
> >
> > I'm not sure what you mean by this item.
> 
> The "usbmodules" addition to "usbutils", from Adam Richter.
> It's needed for some kinds of "cold plug" (handling devices
> present at boot) and for multiple-interface devices.  It's
> been posted to both these lists ... should probably put it
> into one of the patch areas at SourceForge, I don't think
> Thomas' latest "usbutils" has the current version.
> 
> 
> Overall this proposed change falls into the category of
> stuff that seems better done than not.
> 
> - Dave
> 
> 
> 
> _______________________________________________
> Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
> Linux-hotplug-devel@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

Why am I talking to a toilet brush?
					-- CEO
User Friendly, 4/30/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-03-22 19:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-20 21:12 Matching semantics for version numbers Matthew Dharm
2001-03-21  6:12 ` David Brownell
2001-03-21 18:54 ` Matthew Dharm
2001-03-22 19:23 ` David Brownell
2001-03-22 19:50 ` Matthew Dharm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.