android_kernel_xiaomi_sm8350/drivers/usb/core
Alan Stern 55c527187c [PATCH] USB: Consider power budget when choosing configuration
This patch (as609) changes the way we keep track of power budgeting for
USB hubs and devices, and it updates the choose_configuration routine to
take this information into account.  (This is something we should have
been doing all along.)  A new field in struct usb_device holds the amount
of bus current available from the upstream port, and the usb_hub structure
keeps track of the current available for each downstream port.

Two new rules for configuration selection are added:

	Don't select a self-powered configuration when only bus power
	is available.

	Don't select a configuration requiring more bus power than is
	available.

However the first rule is #if-ed out, because I found that the internal
hub in my HP USB keyboard claims that its only configuration is
self-powered.  The rule would prevent the configuration from being chosen,
leaving the hub & keyboard unconfigured.  Since similar descriptor errors
may turn out to be fairly common, it seemed wise not to include a rule
that would break automatic configuration unnecessarily for such devices.

The second rule may also trigger unnecessarily, although this should be
less common.  More likely it will annoy people by sometimes failing to
accept configurations that should never have been chosen in the first
place.

The patch also changes usbcore's reaction when no configuration is
suitable.  Instead of raising an error and rejecting the device, now
the core will simply leave the device unconfigured.  People can always
work around such problems by installing configurations manually through
sysfs.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:48:34 -08:00
..
buffer.c [PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile 2005-11-17 11:29:55 -08:00
config.c [PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile 2005-11-17 11:29:55 -08:00
devices.c [PATCH] USB: Remove USB private semaphore 2006-01-04 13:48:34 -08:00
devio.c [PATCH] USB: Remove USB private semaphore 2006-01-04 13:48:34 -08:00
driver.c [PATCH] USB: Remove USB private semaphore 2006-01-04 13:48:34 -08:00
file.c [PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile 2005-11-17 11:29:55 -08:00
hcd-pci.c [PATCH] USB: Fix USB suspend/resume crasher (#2) 2005-11-29 21:39:23 -08:00
hcd.c [PATCH] USB: Consider power budget when choosing configuration 2006-01-04 13:48:34 -08:00
hcd.h [PATCH] USB: central handling for host controllers that were reset during suspend/resume 2006-01-04 13:48:31 -08:00
hub.c [PATCH] USB: Consider power budget when choosing configuration 2006-01-04 13:48:34 -08:00
hub.h [PATCH] USB: Consider power budget when choosing configuration 2006-01-04 13:48:34 -08:00
inode.c [PATCH] usbfs: usbfs_dir_inode_operations cleanup 2005-11-17 11:29:53 -08:00
Kconfig [PATCH] root hub updates (greater half) 2005-10-28 16:47:40 -07:00
Makefile [PATCH] USB: reorg some functions out of the main usb.c file 2006-01-04 13:48:31 -08:00
message.c [PATCH] USB: Consider power budget when choosing configuration 2006-01-04 13:48:34 -08:00
notify.c [PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile 2005-11-17 11:29:55 -08:00
otg_whitelist.h
sysfs.c [PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile 2005-11-17 11:29:55 -08:00
urb.c [PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile 2005-11-17 11:29:55 -08:00
usb.c [PATCH] USB: Remove USB private semaphore 2006-01-04 13:48:34 -08:00
usb.h [PATCH] USB: Remove USB private semaphore 2006-01-04 13:48:34 -08:00