Re: [PATCH 2/3] usb: Take attribute avoid_reset_quirk out of usb device's attribute group

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 31 Jul 2012, Sarah Sharp wrote:

> > >    1. If the device is internal and unpluggable, power off the port
> > 
> > That doesn't sound right.  Don't you mean: If the port is internal and 
> > not pluggable and there is no device attached, power off the port?
> 
> If there's a device attached and the ACPI table reports the port is not
> "connectable", then there's something wrong with the ACPI table.

Um, we've got a failure of terminology here.  I don't know exactly what
the ACPI entries are supposed to mean.  However, it's possible to have:

	a port into which no device can ever be plugged, or

	a port with a fixed device plugged in, which can never
	be unplugged.

I would call both of these not "pluggable" -- which may or may not be 
the same as "unpluggable"!

Besides, it's hardly unheard of for something to be wrong with an ACPI 
table...  :-)

> > If the port is unpluggable and has no device, I don't see what 
> > difference it makes whether the port is internal or external.
> 
> External ports would never be marked as unpluggable, because the user
> can plug a device in.

In theory such things are possible.  For example, the embedded hub in a
compound device might not have all of its ports wired up.  However such
a hub would have no way to report this fact to the kernel...


> I'm apparently not explaining the ACPI methods very well.  Can you
> please take a look at the Microsoft page on them and let me know if it
> clears up your confusion:
> 
> http://msdn.microsoft.com/en-us/library/windows/hardware/ff553550%28v=vs.85%29.aspx

Okay.  For other people's reference this page says:

	"PortIsConnectable" means it's possible for a device to be 
	connected (either temporarily or permanently).

	"UserVisible" means the user can freely plug and unplug
	devices.

In addition to these ACPI definitions, the USB spec defines 
a "DeviceRemovable" flag.  The spec doesn't appear to take into account 
the possibility of a port which can never have a device plugged in, so 
it defines this flag simply to mean that the port doesn't have a 
permanently-attached device.

If we wanted to be thorough, our root-hub hub descriptors would set the
DeviceRemovable flag for those ports where PortIsConnectable is set 
and UserVisible is clear.  (But of course this only works on ACPI-based 
systems.)

And your first rule now says that the kernel should turn off power to
any port for which PortIsConnectable and UserVisible are both clear.


In the context of these definitions, the terms "internal"/"external"  
and "pluggable"/"unpluggable" we've been tossing around are somewhat
cloudy.  For example, does "internal" mean that UserVisible is clear,
or does it mean that the port has an ACPI table entry?


> Ok, fine.  I do think the internal vs external information could be
> useful to userspace to decide whether it should turn off a port, but I
> agree that unpluggable vs pluggable is more useful.

Provided we agree on an exact meaning.

> > Exposing the extra attributes to userspace can't hurt -- unless we want 
> > to change or remove them in the future!
> 
> Hmm, true.  I suppose we could have a "no info" output if the ACPI port
> info isn't there, and that would allow us to deprecate the API in the
> future.

We should expose the USB DeviceRemovable flag too.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux