This patch (as1620) speeds up USB root-hub resumes in the common case
where every enabled port has its suspend feature set (which currently
will be true for every runtime resume of the root hub). If all the
enabled ports are suspended then resuming the root hub won't resume
any of the downstream devices. In this case there's no need for a
Resume Recovery delay, because that delay is meant to give devices a
chance to get ready for active use.
To keep track of the port suspend features, the patch adds a
"port_is_suspended" flag to struct usb_device. This has to be tracked
separately from the device's state; it's entirely possible for a USB-2
device to be suspended while the suspend feature on its parent port is
clear. The reason is that devices will go into suspend whenever their
parent hub does.
Signed-off-by: Alan Stern <[email protected]>
Reviewed-by: Peter Chen <[email protected]>
Tested-by: Peter Chen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch (as1619) improves the interface to the "hub_for_each_child"
macro. The name clearly suggests that the macro iterates over child
devices; it does not suggest that the loop will also iterate over
unnconnected ports.
The patch changes the macro so that it will skip over unconnected
ports and iterate only the actual child devices. The two existing
call sites are updated to avoid testing for a NULL child pointer,
which is now unnecessary.
Signed-off-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In preparation for splitting the ehci-hcd driver into a core library
and separate platform-specific driver modules, this patch (as1618)
moves ehci_update_device() from a couple of platform-specific source
files into ehci-lpm.c. This is where it should have been all along,
since all it does is call a couple of other functions that are already
in ehci-lpm.c.
Signed-off-by: Alan Stern <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In preparation for splitting the ehci-hcd driver into a core library
and separate platform-specific driver modules, this patch (as1617)
changes the way ehci_read_frame_index() is handled.
Since the same core library will have to work with both PCI and
non-PCI platforms, the quirk handler routine will be compiled
unconditionally. The decision about whether to call it or simply to
read the frame index register is made at run time, based on whether
the frame_index_bug quirk flag is set.
Signed-off-by: Alan Stern <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In preparation for splitting the ehci-hcd driver into a core library
and separate platform-specific driver modules, this patch (as1616)
moves the console logging macros from ehci-dbg.c to ehci.h, where they
will be available to the platform drivers.
Signed-off-by: Alan Stern <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Without this condition, all controllers will do this delay,
and increase the resume time.
Only enabled and unsuspended port needs this delay, but
Some buggy hardware(like Synopsys usb controller) will
clear suspend bit once they receive/send resume signal,
so it takes resume bit as consideration.
Tested it at Freescale i.mx6q Sabrelite board.
Signed-off-by: Peter Chen <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fixing compilaton error.
Incrementing usage counter only on successful execution of skel_open.
Removing redundant locking
Some last changes in function skel_open and finally commit
52a7499 Revert "USB: usb-skeleton.c: fix open/disconnect race"
introduced a bug in function skel_open, which this patch fixes.
Changes since v2:
- refactoring
- Removing redundant mutex synchronization.
Changes since v1:
- Fixed accordingly feedback of Oliver Neukum [email protected]: also need to drop the lock.
Signed-off-by: Constantine Shulyupin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The devm_ functions allocate memory that is released when a driver
detaches. This makes the code smaller and a bit simpler.
Signed-off-by: Jingoo Han <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The devm_ functions allocate memory that is released when a driver
detaches. This patch uses devm_clk_get() for these functions.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.
Signed-off-by: Thomas Abraham <[email protected]>
Acked-by: Jingoo Han <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.
Signed-off-by: Thomas Abraham <[email protected]>
Acked-by: Jingoo Han <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Almost nothing from this file is used, and the file will hopefully be
deleted soon. Copy the tiny portions that are used directly into
tegra_usb_phy.c. I believe that Venu Byravarasu is working on cleaning up
our USB driver, and those cleanups will remove the need for these
constants.
Signed-off-by: Stephen Warren <[email protected]>
Acked-by: Venu Byravarasu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Almost nothing from this file is used, and the file will hopefully be
deleted soon. Copy the tiny portions that are used directly into
ehci-tegra.c. I believe that Venu Byravarasu is working on cleaning up
our USB driver, and those cleanups will remove the need for these
constants.
Signed-off-by: Stephen Warren <[email protected]>
Acked-by: Venu Byravarasu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When the ezusb code was split out, support was added for the fx2 chip
type, but no one is using these functions, so comment it out. If
someone needs it, it can be added back in the future.
Also properly include <linux/usb/ezusb.h> into the ezusb.c file, to
ensure we catch any function prototype mis-matches
Reported-by: Fengguang Wu <[email protected]>
Cc: René Bürgel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This is the first set of omap cleanup patches for v3.8 merge
window to remove most of the remaining plat includes to get us
closer to ARM common zImage support.
To avoid a huge amount of trivial merge conflicts with includes,
this branch is based on several small topic branches coordinated
with the driver subsystem maintainers. These branches are based on
v3.7-rc1 and can also be merged into the related driver subsystem
branches as needed:
omap-for-v3.8/cleanup-headers-prepare few trivial driver changes
omap-for-v3.8/cleanup-headers-dma move of the DMA header
omap-for-v3.8/cleanup-headers-gpmc GPMC and MTD changes
omap-for-v3.8/cleanup-headers-mmc MMC related changes
omap-for-v3.8/cleanup-headers-dss DSS related changes
omap-for-v3.8/cleanup-headers-asoc ASoC related changes
Note that for the dma-omap.h, it was decided that it should be
is completed. For the related discussion, please see:
https://patchwork.kernel.org/patch/1519591/#
After these patches we still have a few plat headers remaining
that will be handled in later pull requests.
I found a memory leak in sierra_release() (well sierra_probe() I guess)
that looses 8 bytes each time the driver releases a device.
Signed-off-by: Len Sorensen <[email protected]>
Acked-by: Johan Hovold <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
flush_work_sync and flush_work are now the same and flush_work_sync
has been deprecated. This fixes the following warning:
drivers/usb/core/hub.c: In function hub_quiesce:
drivers/usb/core/hub.c:1216:3: warning: flush_work_sync is deprecated (declared at include/linux/workqueue.h:448) [-Wdeprecated-declarations]
Reported-by: Fengguang Wu <[email protected]>
Signed-off-by: Octavian Purdila <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
xHCI fixes for 3.7-rc3
Hi Greg,
Here's four bug fixes for 3.7.
The first patch fixes a potential deadlock in the USB port power off code,
and the last two patches fix bugs in the USB 3.0 Link PM patchset. The
second one is trivial and removes an unnecessary cast.
Sarah Sharp
usb: fixes for v3.7-rc3
Here's a new set of fixes for v3.7-rc3. It's quite small, only
four patches.
There's one bug fix for the newly added musb-dsps glue layer where
we could be overflowing a buffer when creating the instance name.
NET2272 got a fix for a case where the lock would be left held
when exiting the IRQ handler with error in case of Spurious IRQs.
Renensas USBHS got a DMA stall fix which would cause transfers to
stall forever and a NULL pointer deref fix in case of pipe detach.
xhci_service_interval_to_ns() returns long long
to avoid an overflow. However, the type cast happens
too late. The fix is to force ULL from the beginning.
This patch should be backported to kernels as old as 3.5, that contain
the commit e3567d2c15 "xhci: Add Intel
U1/U2 timeout policy."
Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Sarah Sharp <[email protected]>
CC: [email protected]
An le16 is accessed without conversion.
This patch should be backported to kernels as old as 3.5, that contain
the commit e3567d2c15 "xhci: Add Intel
U1/U2 timeout policy."
Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Sarah Sharp <[email protected]>
CC: [email protected]
renesas_usbhs driver can switch DMA/PIO transfer by using handler,
and each handler have push/pop direction.
But unfortunately, current dma push handler didn't a path
which calls usbhs_pipe_enable(). Thus, dma transfer never happened.
this patch fixes it.
Signed-off-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
If renesas_usbhs or DMAEngine interrupt didn't happen by a certain cause,
urb->ep will be NULL by usb time out.
Then, host mode will access to it and crash kernel.
This patch fixes it.
Signed-off-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Add the missing unlock on the error handle path in function
net2272_irq().
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
The res_name is used for the name construction of a DT property as
follows:
sprintf(res_name, "port%d-mode", id);
Hence, res_name must be at least 11 characters long in order to store
the name including the terminating '\0'.
While at it, use to snprintf() rather than sprintf() when accessing this
buffer.
Reported-by: David Binderman <[email protected]>
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Struct usb_hub_descriptor.ss.DeviceRemovable has been defined as __le16
and (__force__ __u16) doesn't need.
Signed-off-by: Lan Tianyu <[email protected]>
Signed-off-by: Sarah Sharp <[email protected]>
When setting usb port's acpi power resource, there will be some xhci hub requests.
This will cause dead lock since xhci->lock has been held before setting acpi power
resource in the xhci_hub_control(). The usb_acpi_power_manageable() function might
fall into sleep so release xhci->lock before invoking it.
Signed-off-by: Lan Tianyu <[email protected]>
Signed-off-by: Sarah Sharp <[email protected]>
The "wusb_cap_descr_default" is never used. GCC doesn't complain about
it because we have that line ".bLength = sizeof(wusb_cap_descr_default)"
inside the definition itself. Clang complains though.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch changes the ohci-platform driver to use the device managed helper
function for requesting memory region and ioremapping memory resources.
As a result the error path in the probe function is simplified, and the
platform driver remove callback does no longer need to release and iounmap
memory resources. devm_request_and_ioremap() will use either the ioremap()
or ioremap_nocache() handler depending on the resource's CACHEABLE flag, so
we are good with this change.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch changes the ehci-platform driver to use the device managed helper
function for requesting memory region and ioremapping memory resources.
As a result the error path in the probe function is simplified, and the
platform driver remove callback does no longer need to release and iounmap
memory resources. devm_request_and_ioremap() will use either the ioremap()
or ioremap_nocache() handler depending on the resource's CACHEABLE flag, so
we are good with this change.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
We meant to write "resource" instead of "recourse", this patch fixes this
typo.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix the obvious typo in the error message, we meant to write "resource"
instead of "recourse".
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch converts the ohci-platform driver to use dev_err() functions
instead of pr_err().
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch converts the ehci-platform driver to make use of the dev_err()
functions instead of pr_err().
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
A previous patch converted the Alchemy platform to use the OHCI and EHCI
platform drivers. As a result, all the common logic to handle USB present in
drivers/usb/host/alchemy-common.c has no reason to remain here, so we move it
to arch/mips/alchemy/common/usb.c which is a more appropriate place. This
change was suggested by Manuel Lauss.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
All users have been converted to use the OHCI platform driver instead, thus
making ohci-au1xxx obsolete, remove it.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
All users have been converted to use the OHCI platform driver instead, thus
making ohci-sh obsolete, so remove it.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
All users have been converted to use the OHCI platform driver instead, thus
making ohci-xls obsolete, remove it.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
All users have been converted to use the OHCI platform driver instead, thus
making ohci-cns3xxx, so remove it.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The users have been converted to use the platform OHCI driver instead, thus
making the ohci-pnx8550 driver obsolete, so remove it.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Merge ohci_finish_controller_resume with ohci_resume as suggested by Alan
Stern. Since ohci_finish_controller_resume no longer exists, update the
various OHCI drivers to call ohci_resume() instead. Some drivers used to set
themselves the bit HCD_FLAG_HW_ACCESSIBLE, which is now handled by
ohci_resume().
Acked-by: Jingoo Han <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
As suggested by Alan Stern, the code checking for the OHCI RH already
suspended is no longer required since the bug it fixes has not been seen in
ages. Remove that check making ohci_suspend much simpler.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
As suggested by Alan Stern, move the ohci-pci.c ohci_pci_{suspend,resume}
routines to ohci-hcd.c. Due to their move, also rename them to
ohci_{suspend,resume} to make it clear they operate on ohci_hcd. Since they
are not necessarily called, annotate them with __maybe_unused, and make them
enclosed within an #ifdef CONFIG_PM / #endif section.
Signed-off-by: Florian Fainelli <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>