OSDN Git Service

android-x86/kernel.git
6 years agousb: quirks: add delay init quirk for Corsair Strafe RGB keyboard
Kai-Heng Feng [Wed, 16 Aug 2017 02:53:20 +0000 (10:53 +0800)]
usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard

Corsair Strafe RGB keyboard has trouble to initialize:

[ 1.679455] usb 3-6: new full-speed USB device number 4 using xhci_hcd
[ 6.871136] usb 3-6: unable to read config index 0 descriptor/all
[ 6.871138] usb 3-6: can't read configurations, error -110
[ 6.991019] usb 3-6: new full-speed USB device number 5 using xhci_hcd
[ 12.246642] usb 3-6: unable to read config index 0 descriptor/all
[ 12.246644] usb 3-6: can't read configurations, error -110
[ 12.366555] usb 3-6: new full-speed USB device number 6 using xhci_hcd
[ 17.622145] usb 3-6: unable to read config index 0 descriptor/all
[ 17.622147] usb 3-6: can't read configurations, error -110
[ 17.742093] usb 3-6: new full-speed USB device number 7 using xhci_hcd
[ 22.997715] usb 3-6: unable to read config index 0 descriptor/all
[ 22.997716] usb 3-6: can't read configurations, error -110

Although it may work after several times unpluging/pluging:

[ 68.195240] usb 3-6: new full-speed USB device number 11 using xhci_hcd
[ 68.337459] usb 3-6: New USB device found, idVendor=1b1c, idProduct=1b20
[ 68.337463] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 68.337466] usb 3-6: Product: Corsair STRAFE RGB Gaming Keyboard
[ 68.337468] usb 3-6: Manufacturer: Corsair
[ 68.337470] usb 3-6: SerialNumber: 0F013021AEB8046755A93ED3F5001941

Tried three quirks: USB_QUIRK_DELAY_INIT, USB_QUIRK_NO_LPM and
USB_QUIRK_DEVICE_QUALIFIER, user confirmed that USB_QUIRK_DELAY_INIT alone
can workaround this issue. Hence add the quirk for Corsair Strafe RGB.

BugLink: https://bugs.launchpad.net/bugs/1678477
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: gadget: make snd_pcm_hardware const
Bhumika Goyal [Sun, 13 Aug 2017 12:43:11 +0000 (18:13 +0530)]
usb: gadget: make snd_pcm_hardware const

Make this const as it is only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: common: use of_property_read_bool()
Sergei Shtylyov [Sun, 20 Aug 2017 18:06:52 +0000 (21:06 +0300)]
usb: common: use of_property_read_bool()

Use more compact of_property_read_bool() calls for the boolean properties
instead  of of_find_property() calls  in of_usb_host_tpl_support() and
of_usb_update_otg_caps().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoUSB: core: constify vm_operations_struct
Arvind Yadav [Thu, 24 Aug 2017 11:17:09 +0000 (16:47 +0530)]
USB: core: constify vm_operations_struct

vm_operations_struct are not supposed to change at runtime.
All functions working with const vm_operations_struct.
So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: misc: ftdi-elan: fix duplicated code for different branches
Gustavo A. R. Silva [Sun, 13 Aug 2017 01:12:32 +0000 (20:12 -0500)]
usb: misc: ftdi-elan: fix duplicated code for different branches

Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoUSB: core: Avoid race of async_completed() w/ usbdev_release()
Douglas Anderson [Thu, 10 Aug 2017 22:42:22 +0000 (15:42 -0700)]
USB: core: Avoid race of async_completed() w/ usbdev_release()

While running reboot tests w/ a specific set of USB devices (and
slub_debug enabled), I found that once every few hours my device would
be crashed with a stack that looked like this:

[   14.012445] BUG: spinlock bad magic on CPU#0, modprobe/2091
[   14.012460]  lock: 0xffffffc0cb055978, .magic: ffffffc0, .owner: cryption contexts: %lu/%lu
[   14.012460] /1025536097, .owner_cpu: 0
[   14.012466] CPU: 0 PID: 2091 Comm: modprobe Not tainted 4.4.79 #352
[   14.012468] Hardware name: Google Kevin (DT)
[   14.012471] Call trace:
[   14.012483] [<....>] dump_backtrace+0x0/0x160
[   14.012487] [<....>] show_stack+0x20/0x28
[   14.012494] [<....>] dump_stack+0xb4/0xf0
[   14.012500] [<....>] spin_dump+0x8c/0x98
[   14.012504] [<....>] spin_bug+0x30/0x3c
[   14.012508] [<....>] do_raw_spin_lock+0x40/0x164
[   14.012515] [<....>] _raw_spin_lock_irqsave+0x64/0x74
[   14.012521] [<....>] __wake_up+0x2c/0x60
[   14.012528] [<....>] async_completed+0x2d0/0x300
[   14.012534] [<....>] __usb_hcd_giveback_urb+0xc4/0x138
[   14.012538] [<....>] usb_hcd_giveback_urb+0x54/0xf0
[   14.012544] [<....>] xhci_irq+0x1314/0x1348
[   14.012548] [<....>] usb_hcd_irq+0x40/0x50
[   14.012553] [<....>] handle_irq_event_percpu+0x1b4/0x3f0
[   14.012556] [<....>] handle_irq_event+0x4c/0x7c
[   14.012561] [<....>] handle_fasteoi_irq+0x158/0x1c8
[   14.012564] [<....>] generic_handle_irq+0x30/0x44
[   14.012568] [<....>] __handle_domain_irq+0x90/0xbc
[   14.012572] [<....>] gic_handle_irq+0xcc/0x18c

Investigation using kgdb() found that the wait queue that was passed
into wake_up() had been freed (it was filled with slub_debug poison).

I analyzed and instrumented the code and reproduced.  My current
belief is that this is happening:

1. async_completed() is called (from IRQ).  Moves "as" onto the
   completed list.
2. On another CPU, proc_reapurbnonblock_compat() calls
   async_getcompleted().  Blocks on spinlock.
3. async_completed() releases the lock; keeps running; gets blocked
   midway through wake_up().
4. proc_reapurbnonblock_compat() => async_getcompleted() gets the
   lock; removes "as" from completed list and frees it.
5. usbdev_release() is called.  Frees "ps".
6. async_completed() finally continues running wake_up().  ...but
   wake_up() has a pointer to the freed "ps".

The instrumentation that led me to believe this was based on adding
some trace_printk() calls in a select few functions and then using
kdb's "ftdump" at crash time.  The trace follows (NOTE: in the trace
below I cheated a little bit and added a udelay(1000) in
async_completed() after releasing the spinlock because I wanted it to
trigger quicker):

<...>-2104   0d.h2 13759034us!: async_completed at start: as=ffffffc0cc638200
mtpd-2055    3.... 13759356us : async_getcompleted before spin_lock_irqsave
mtpd-2055    3d..1 13759362us : async_getcompleted after list_del_init: as=ffffffc0cc638200
mtpd-2055    3.... 13759371us+: proc_reapurbnonblock_compat: free_async(ffffffc0cc638200)
mtpd-2055    3.... 13759422us+: async_getcompleted before spin_lock_irqsave
mtpd-2055    3.... 13759479us : usbdev_release at start: ps=ffffffc0cc042080
mtpd-2055    3.... 13759487us : async_getcompleted before spin_lock_irqsave
mtpd-2055    3.... 13759497us!: usbdev_release after kfree(ps): ps=ffffffc0cc042080
<...>-2104   0d.h2 13760294us : async_completed before wake_up(): as=ffffffc0cc638200

To fix this problem we can just move the wake_up() under the ps->lock.
There should be no issues there that I'm aware of.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: make device_type const
Bhumika Goyal [Sat, 19 Aug 2017 08:22:26 +0000 (13:52 +0530)]
usb: make device_type const

Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoUSB: musb: dsps: add explicit runtime resume at suspend
Johan Hovold [Thu, 24 Aug 2017 16:38:37 +0000 (11:38 -0500)]
USB: musb: dsps: add explicit runtime resume at suspend

The musb_dsps driver is special in that the parent (glue) device's
driver is accessing registers mapped by the child. The clock is however
shared and is managed by the grandparent device.

Since commit 869c59782981 ("usb: musb: dsps: add support for suspend and
resume") the dsps driver has been accessing these registers as part of
suspend and resume.

The parent driver obviously cannot runtime resume the child during
system suspend and is currently relying on the fact that the child will
be RPM_ACTIVE throughout suspend. The suspend implementation also makes
sure to check that the child is indeed present (and hence the clock
enabled) before accessing the registers.

Let's add an explicit runtime resume of the glue device itself to enable
the clock before doing the register accesses in case these assumptions ever
change (i.e. if the child is left runtime suspended).

Note that the glue-timer cancellation is moved after the child-presence
check to keep error handling simple. This should be fine as the timer is
not setup until the controller is being registered and at that time
glue->musb and its driver data have already been initialised.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoUSB: musb: fix external abort on suspend
Johan Hovold [Thu, 24 Aug 2017 16:38:36 +0000 (11:38 -0500)]
USB: musb: fix external abort on suspend

Make sure that the controller is runtime resumed when system suspending
to avoid an external abort when accessing the interrupt registers:

  Unhandled fault: external abort on non-linefetch (0x1008) at 0xd025840a
  ...
  [<c05481a4>] (musb_default_readb) from [<c0545abc>] (musb_disable_interrupts+0x84/0xa8)
  [<c0545abc>] (musb_disable_interrupts) from [<c0546b08>] (musb_suspend+0x38/0xb8)
  [<c0546b08>] (musb_suspend) from [<c04a57f8>] (platform_pm_suspend+0x3c/0x64)

This is easily reproduced on a BBB by enabling the peripheral port only
(as the host port may enable the shared clock) and keeping it
disconnected so that the controller is runtime suspended. (Well, you
would also need to the not-yet-merged am33xx-suspend patches by Dave
Gerlach to be able to suspend the BBB.)

This is a regression that was introduced by commit 1c4d0b4e1806 ("usb:
musb: Remove pm_runtime_set_irq_safe") which allowed the parent glue
device to runtime suspend and thereby exposed a couple of older issues:

Register accesses without explicitly making sure the controller is
runtime resumed during suspend was first introduced by commit c338412b5ded
("usb: musb: unconditionally save and restore the context on suspend")
in 3.14.

Commit a1fc1920aaaa ("usb: musb: core: make sure musb is in RPM_ACTIVE on
resume") later started setting the RPM status to active during resume,
and this was also implicitly relying on the parent always being active.
Since commit 71723f95463d ("PM / runtime: print error when activating a
child to unactive parent") this now also results in the following
warning:

  musb-hdrc musb-hdrc.0: runtime PM trying to activate child device
    musb-hdrc.0 but parent (47401400.usb) is not active

This patch has been verified on 4.13-rc2, 4.12 and 4.9 using a BBB
(the dsps glue would always be active also in 4.8).

Fixes: c338412b5ded ("usb: musb: unconditionally save and restore the context on suspend")
Fixes: a1fc1920aaaa ("usb: musb: core: make sure musb is in RPM_ACTIVE on resume")
Fixes: 1c4d0b4e1806 ("usb: musb: Remove pm_runtime_set_irq_safe")
Cc: stable <stable@vger.kernel.org> # 4.8+
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Dave Gerlach <d-gerlach@ti.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: musb: fix endpoint fifo allocation for 4KB fifo memory
Bin Liu [Thu, 24 Aug 2017 16:38:35 +0000 (11:38 -0500)]
usb: musb: fix endpoint fifo allocation for 4KB fifo memory

The fifo memory allocation in mode_2_cfg[] doesn't utilize all the 4KB
memory.

Increse some endpoint fifo buffers to fully use all the 4KB memory. Now
we can support more webcam usecases on DA8xx.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: musb: print an error message when high bandwidth is unsupported
Bin Liu [Thu, 24 Aug 2017 16:38:34 +0000 (11:38 -0500)]
usb: musb: print an error message when high bandwidth is unsupported

There are multiple places in usb core or controller driver which returns
-EMSGSIZE when a class driver queueing urb failed, so the "Message too
long" log doesn't help much for understanding the error.

Let the musb driver to specifically print a error message when
musb_urb_enqueue() returns -EMSGSIZE.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: musb: print an error message when hwep alloc failed
Bin Liu [Thu, 24 Aug 2017 16:38:33 +0000 (11:38 -0500)]
usb: musb: print an error message when hwep alloc failed

Print an error message with qh maxpacket size and hb_mult when hwep
allocation failed, so we have a better idea why it is failed.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: musb: add helper function musb_ep_xfertype_string
Bin Liu [Thu, 24 Aug 2017 16:38:32 +0000 (11:38 -0500)]
usb: musb: add helper function musb_ep_xfertype_string

Add helper function musb_ep_xfertype_string() to return the ep transfer
type string.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge tag 'usb-ci-v4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter...
Greg Kroah-Hartman [Mon, 28 Aug 2017 08:50:22 +0000 (10:50 +0200)]
Merge tag 'usb-ci-v4.14-rc1' of git://git./linux/kernel/git/peter.chen/usb into usb-next

Peter writes:

Chipidea changes for v4.14-rc1
- Add chipidea support at Nvidia SoCs
- Improvement for extcon support
- Some code refines

6 years agophy: ralink: fix 64-bit build warning
Arnd Bergmann [Thu, 24 Aug 2017 07:49:08 +0000 (13:19 +0530)]
phy: ralink: fix 64-bit build warning

Casting between an 'int' and a pointer causes a warning on
64-bit architectures in compile-testing this driver:

drivers/phy/ralink/phy-ralink-usb.c: In function 'ralink_usb_phy_probe':
drivers/phy/ralink/phy-ralink-usb.c:195:13: error: cast from pointer to
integer of different size [-Werror=pointer-to-int-cast]

This changes the code to cast to uintptr_t instead. This is
guaranteed to do what we want on all architectures and avoids
the warning.

Fixes: 2411a736ff09 ("phy: ralink-usb: add driver for Mediatek/Ralink")
Acked-by: John Crispin <john@phrozen.org>
Tested-by Harvey Hunt <harvey.hunt@imgtec.com>
Reviewed-by Harvey Hunt <harvey.hunt@imgtec.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: chipidea: Add support for Tegra20/30/114/124
Thierry Reding [Wed, 16 Aug 2017 10:32:40 +0000 (13:32 +0300)]
usb: chipidea: Add support for Tegra20/30/114/124

All of these Tegra SoC generations have a ChipIdea UDC IP block that can
be used for device mode communication with a host. Implement rudimentary
support that doesn't allow switching between host and device modes.

Tested-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Thierry Reding <treding@nvidia.com>
[digetx@gmail.com: rebased patches and added DMA alignment quirk for Tegra20]
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
6 years agousb: chipidea: udc: Support SKB alignment quirk
Dmitry Osipenko [Wed, 16 Aug 2017 10:32:39 +0000 (13:32 +0300)]
usb: chipidea: udc: Support SKB alignment quirk

NVIDIA Tegra20 UDC can't cope with unaligned DMA and require a USB gadget
quirk that avoids SKB buffer alignment to be set in order to make Ethernet
Gadget working. Later Tegra generations do not require that quirk. Let's
add a new platform data flag that allows to enable USB gadget quirk for
platforms that require it.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
6 years agoMerge tag 'phy-for-4.14_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon...
Greg Kroah-Hartman [Tue, 22 Aug 2017 20:20:12 +0000 (13:20 -0700)]
Merge tag 'phy-for-4.14_v2' of git://git./linux/kernel/git/kishon/linux-phy into usb-next

Kishon writes:

phy: for 4.14

 *) Add USB PHY driver for Ralink SoC
 *) Make phy-mt65xx-usb3 driver support PCIe and SATA phy
 *) Add mediatek directory and rename phy-mt65xx-usb3 to phy-mtk-tphy.c
    since it now supports USB3.0, PCIe and SATA PHYs
 *) Make sun4i-usb-phy driver support USB PHYs for A83T SoC
 *) Make phy-qcom-qmp driver support USB PHYs for IPQ8074 SoC
 *) Make rockchip-inno-usb2 driver support usb2-phy for rv1108 SoC
 *) Minor fixes in phy drivers

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agoMerge tag 'usb-for-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi...
Greg Kroah-Hartman [Tue, 22 Aug 2017 20:16:06 +0000 (13:16 -0700)]
Merge tag 'usb-for-v4.14' of git://git./linux/kernel/git/balbi/usb into usb-next

Felipe writes:

usb: changes for v4.14 merge window

Not a big pull request this time around. Only 49 non-merge
commits. This pull request is, however, all over the place. Most of
the changes are in the bdc driver adding support for USB Phy layer and
PM.

Renesas adds support for R-Car H3 ES2.0 and R-Car M3-W SoCs.

Also here is PM_RUNTIME support for dwc3-keystone.

UDC Core got a DMA unmap fix to make sure we only unmap requests that
were, indeed, mapped.

Other than these, we have a lot of cleanups, many of them adding
'const' to several places.

6 years agophy: brcm-sata: fix a timeout test in init
Dan Carpenter [Mon, 19 Jun 2017 10:56:05 +0000 (13:56 +0300)]
phy: brcm-sata: fix a timeout test in init

We want to timeout with try set to zero so this should be a pre-op
instead of post-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: cpcap-usb: remove a stray tab
Dan Carpenter [Wed, 28 Jun 2017 12:19:37 +0000 (15:19 +0300)]
phy: cpcap-usb: remove a stray tab

This line was indented further that it should have been.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: phy-twl4030-usb: silence an uninitialized variable warning
Dan Carpenter [Fri, 30 Jun 2017 08:01:47 +0000 (11:01 +0300)]
phy: phy-twl4030-usb: silence an uninitialized variable warning

The "check" variable isn't necessarily initialized when we print it out
in the debugging messages.  It's a pretty haphazard affair and it
doesn't matter very much what we initialize "check" to.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: rockchip-typec: remove unused dfp variable
Shawn Lin [Thu, 3 Aug 2017 01:26:19 +0000 (09:26 +0800)]
phy: rockchip-typec: remove unused dfp variable

In order to silent the 'W=1' compile warning:

drivers/phy/rockchip/phy-rockchip-typec.c: In function 'tcphy_get_mode':
drivers/phy/rockchip/phy-rockchip-typec.c:625:7: warning: variable 'dfp'
set but not used [-Wunused-but-set-variable]

Cc: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: rockchip-inno-usb2: add support of usb2-phy for rv1108 SoCs
Frank Wang [Fri, 11 Aug 2017 08:08:48 +0000 (16:08 +0800)]
phy: rockchip-inno-usb2: add support of usb2-phy for rv1108 SoCs

This adds support usb2-phy for rv1108 SoCs and amend phy Documentation.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agodt-bindings: phy-rockchip-inno-usb2: add otg-mux interrupt
Frank Wang [Fri, 11 Aug 2017 08:07:50 +0000 (16:07 +0800)]
dt-bindings: phy-rockchip-inno-usb2: add otg-mux interrupt

Add otg-mux property to support multiplexed interrupt in otg-port
on some Rockchip SoC (e.g RV1108).

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: rockchip-inno-usb2: add support for otg-mux interrupt
Frank Wang [Fri, 11 Aug 2017 08:07:49 +0000 (16:07 +0800)]
phy: rockchip-inno-usb2: add support for otg-mux interrupt

The otg-id/otg-bvalid/linestate interrupts are multiplexed together
in otg-port on some Rockchip SoC (e.g RV1108), this patch add support
for it.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agodt-bindings: phy-rockchip-inno-usb2: add rockchip,usbgrf property
Frank Wang [Fri, 11 Aug 2017 08:07:48 +0000 (16:07 +0800)]
dt-bindings: phy-rockchip-inno-usb2: add rockchip,usbgrf property

Add rockchip,usbgrf property to support the registers of usb-phy
that are distributed in grf and usbgrf on some special Rockchip
SoCs (e.g RV1108).

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: rockchip-inno-usb2: add support for rockchip,usbgrf property
Frank Wang [Fri, 11 Aug 2017 08:07:47 +0000 (16:07 +0800)]
phy: rockchip-inno-usb2: add support for rockchip,usbgrf property

The registers of usb-phy are distributed in grf and usbgrf on some
Rockchip SoCs (e.g RV1108), this patch add a new rockchip,usbgrf
property to support this companion grf design.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: sun4i-usb: Support A83T USB PHYs
Chen-Yu Tsai [Thu, 3 Aug 2017 08:14:07 +0000 (16:14 +0800)]
phy: sun4i-usb: Support A83T USB PHYs

The A83T has 3 USB PHYs, 1 for OTG, 1 for standard USB, 1 for USB HSIC.
The phy initialization procedure is very different from other SoCs, but
the PMU bits are the same, with additional bits for HSIC.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: sun4i-usb: Support secondary clock for HSIC PHY
Chen-Yu Tsai [Thu, 3 Aug 2017 08:14:06 +0000 (16:14 +0800)]
phy: sun4i-usb: Support secondary clock for HSIC PHY

On the Allwinner A83T SoC, the last USB PHY is an HSIC PHY. It requires
two clocks instead of one.

On all Allwinner SoCs that share the common USB PHY design supported by
the phy-sun4i-usb driver, the first PHY is always tied to OTG, and there
is at most one HSIC PHY, typically the last.

In this patch we take advantage of these known constraints and store an
index in the compatible-string-related config structure describing which
PHY is HSIC, needing the extra hsic_12M clock.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agodt-bindings: phy: sun4i-usb-phy: Add compatible string for A83T
Chen-Yu Tsai [Thu, 3 Aug 2017 08:14:05 +0000 (16:14 +0800)]
dt-bindings: phy: sun4i-usb-phy: Add compatible string for A83T

The A83T has 3 USB PHYs, 1 for OTG, 1 for standard USB, 1 for USB HSIC.

Add a compatible string for it, and describe the needed properties.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Rob Herring <robh@kernel.org>
Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agodt-bindings: phy: sun4i-usb-phy: Add property descriptions for H3
Chen-Yu Tsai [Thu, 3 Aug 2017 08:14:04 +0000 (16:14 +0800)]
dt-bindings: phy: sun4i-usb-phy: Add property descriptions for H3

The Allwinner H3 SoC has 4 USB PHYs, so it needs four sets of pmu
regions, clocks, resets, and optional vbus properties. These were
not described when the H3 compatible string was added.

Fixes: 626a630e003c ("phy-sun4i-usb: Add support for the host usb-phys
      found on the H3 SoC")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: ralink-usb: add driver for Mediatek/Ralink
John Crispin [Thu, 17 Aug 2017 10:33:22 +0000 (11:33 +0100)]
phy: ralink-usb: add driver for Mediatek/Ralink

Add a driver to setup the USB phy on Mediatek/Ralink SoCs.
The driver sets up power and host mode, but also needs to
configure PHY registers for the MT7628 and MT7688.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Harvey Hunt <harvey.hunt@imgtec.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agodt-bindings: phy: Add bindings for ralink-usb PHY
John Crispin [Thu, 17 Aug 2017 10:33:23 +0000 (11:33 +0100)]
dt-bindings: phy: Add bindings for ralink-usb PHY

Add a binding for the USB phy on Mediatek/Ralink SoCs.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Harvey Hunt <harvey.hunt@imgtec.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: samsung: use of_device_get_match_data()
Chunfeng Yun [Wed, 9 Aug 2017 09:17:58 +0000 (17:17 +0800)]
phy: samsung: use of_device_get_match_data()

reduce the boilerplate code to get the specific data

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: phy-mt65xx-usb3: add mediatek directory and rename file
Chunfeng Yun [Thu, 3 Aug 2017 10:01:02 +0000 (18:01 +0800)]
phy: phy-mt65xx-usb3: add mediatek directory and rename file

The driver is actually for T-PHY which supports USB3.0, PCIe and SATA,
and supports more SoCs now, but not just only for series of mt65xx SoCs,
so the name of file, data struct, functions etc with 'mt65xx' may cause
misunderstanding when new SoCs are supported. Here rename them to reflect
the real functions and also enhance readability.

And also update MAINTAINERS file to reflect the correct driver

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agodt-bindings: phy-mt65xx-usb: supports PCIe, SATA and rename file
Chunfeng Yun [Thu, 3 Aug 2017 10:01:03 +0000 (18:01 +0800)]
dt-bindings: phy-mt65xx-usb: supports PCIe, SATA and rename file

add support for PCIe and SATA, also add some new compatibles.

due to phy-mt65xx-usb.txt holds the bindings for all mediatek SoCs
with T-PHY controller, change the name to phy-mtk-tphy.txt to
reflect that.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: phy-mt65xx-usb3: add SATA PHY support
Ryder Lee [Thu, 3 Aug 2017 10:01:01 +0000 (18:01 +0800)]
phy: phy-mt65xx-usb3: add SATA PHY support

This patch adds SATA setting part.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: phy-mt65xx-usb3: add PCIe PHY support
Ryder Lee [Thu, 3 Aug 2017 10:01:00 +0000 (18:01 +0800)]
phy: phy-mt65xx-usb3: add PCIe PHY support

This patch adds PCIe PHY setting part.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: ti-pipe3: Use TRM recommended settings for SATA DPLL
Roger Quadros [Mon, 7 Aug 2017 09:11:02 +0000 (12:11 +0300)]
phy: ti-pipe3: Use TRM recommended settings for SATA DPLL

The AM572x Technical Reference Manual, SPRUHZ6H,
Revised November 2016 [1], shows recommended settings for the
SATA DPLL in Table 26-8. DPLL CLKDCOLDO Recommended Settings.

Use those settings in the driver. The TRM does not show
a value for 20MHz SYS_CLK so we use something close to the
26MHz setting.

[1] - http://www.ti.com/lit/ug/spruhz6h/spruhz6h.pdf

Signed-off-by: Roger Quadros <rogerq@ti.com>
[nsekhar@ti.com: add exact TRM version to commit text]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: qcom-qmp: Fix failure path in phy_init functions
Vivek Gautam [Tue, 20 Jun 2017 05:57:18 +0000 (11:27 +0530)]
phy: qcom-qmp: Fix failure path in phy_init functions

Fixing the clk enable failure path in qcom_qmp_phy_init()
and cleanup the reset control deassertion failure path in
qcom_qmp_phy_com_init().

Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")

Cc: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: qcom-qmp: Add support for IPQ8074
Varadarajan Narayanan [Mon, 31 Jul 2017 06:34:14 +0000 (12:04 +0530)]
phy: qcom-qmp: Add support for IPQ8074

Add definitions required to enable QMP phy support for IPQ8074.

Signed-off-by: smuthayy <smuthayy@codeaurora.org>
Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agophy: qcom-qmp: Fix phy pipe clock name
Varadarajan Narayanan [Mon, 31 Jul 2017 06:34:13 +0000 (12:04 +0530)]
phy: qcom-qmp: Fix phy pipe clock name

Presently, the phy pipe clock's name is assumed to be either
usb3_phy_pipe_clk_src or pcie_XX_pipe_clk_src (where XX is the
phy lane's number). However, this will not work if an SoC has
more than one instance of the phy. Hence, instead of assuming
the name of the clock, fetch it from the DT.

Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agodt-bindings: phy: qmp: Add support for QMP phy in IPQ8074
Varadarajan Narayanan [Mon, 31 Jul 2017 06:34:12 +0000 (12:04 +0530)]
dt-bindings: phy: qmp: Add support for QMP phy in IPQ8074

IPQ8074 uses QMP PHY controller that provides support to PCIe and
USB. Adding DT binding information for the same.

Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agodt-bindings: phy: qmp: Add output-clock-names
Varadarajan Narayanan [Mon, 31 Jul 2017 06:34:11 +0000 (12:04 +0530)]
dt-bindings: phy: qmp: Add output-clock-names

The PHY outputs a clock that will act as the parent for
the PHY's pipe clock. Add the name of this clock to the
lane's DT node.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
6 years agousb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether
Dmitry Osipenko [Wed, 16 Aug 2017 10:32:38 +0000 (13:32 +0300)]
usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether

That quirk is required to make USB Ethernet gadget working on HW that
can't cope with unaligned DMA. For some reason only f_ncm sets up that
quirk, let's setup it directly in u_ether so other network models would
have that quirk applied as well. All network models have been tested with
ChipIdea UDC driver on NVIDIA Tegra20 SoC that require DMA to be aligned.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: serial: fix oops when data rx'd after close
Stephen Warren [Wed, 16 Aug 2017 20:30:10 +0000 (14:30 -0600)]
usb: gadget: serial: fix oops when data rx'd after close

When the gadget serial device has no associated TTY, do not pass any
received data into the TTY layer for processing; simply drop it instead.
This prevents the TTY layer from calling back into the gadget serial
driver, which will then crash in e.g. gs_write_room() due to lack of
gadget serial device to TTY association (i.e. a NULL pointer dereference).

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoUSB: Gadget core: fix inconsistency in the interface tousb_add_gadget_udc_release()
Alan Stern [Thu, 17 Aug 2017 18:49:55 +0000 (14:49 -0400)]
USB: Gadget core: fix inconsistency in the interface tousb_add_gadget_udc_release()

The usb_add_gadget_udc_release() routine in the USB gadget core will
sometimes but not always call the gadget's release function when an
error occurs.  More specifically, if the struct usb_udc allocation
fails then the release function is not called, and for other errors it
is.

As a result, users of this routine cannot know whether they need to
deallocate the memory containing the gadget structure following an
error.  This leads to unavoidable memory leaks or double frees.

This patch fixes the problem by splitting the existing
device_register() call into device_initialize() and device_add(), and
doing the udc allocation in between.  That way, even if the allocation
fails it is still possible to call device_del(), and so the release
function will be always called following an error.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agodt-bindings: usb: keystone-usb: Update bindings pm and clocks properties
Franklin S Cooper Jr [Wed, 16 Aug 2017 21:54:08 +0000 (16:54 -0500)]
dt-bindings: usb: keystone-usb: Update bindings pm and clocks properties

Update various properties to properly indicate their requirement depending
on the SoC.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoxhci: rework bus_resume and check ports are suspended before resuming them.
Mathias Nyman [Wed, 16 Aug 2017 11:23:26 +0000 (14:23 +0300)]
xhci: rework bus_resume and check ports are suspended before resuming them.

bus_resume() tried to resume the same ports the bus_suspend()
suspeded. This caused PLC timeouts in case a suspended device disconnected
and was not in a resumable state at bus_resume().

Add a check to make sure the link state is either U3 or resuming
before actually resuming the link.

At the same time do some other changes such as make sure we remove
wake on connect/disconnect/overcurrent also for the resuming ports,
and avoid extra portsc port register writes.

This improves resume time with 10ms in those PLC timeout cases where
devices disconnect at suspend/resume cycle.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: Increase root hub reset signaling time to prevent retry
Mathias Nyman [Wed, 16 Aug 2017 11:23:25 +0000 (14:23 +0300)]
usb: Increase root hub reset signaling time to prevent retry

Save 80ms device enumeration time by increasing root hub port reset time

The 50ms reset signaling time is not enough for most root hub ports.
Increasing the reset time to 60ms allows host controllers to finish port
reset and removes a retry causing an extra 50ms delay.

The USB 2 specification requires "at least 50ms" for driving root
port reset. The current msleep is exactly 50ms which may not be
enough if there are any delays between writing the reset bit to host
controller portsc register and phy actually driving reset.

On Haswell, Skylake and Kabylake xHC port reset took in average 52-59ms

The 80ms improvement comes from (40ms * 2 port resets) save at enumeration
for each device connected to a root hub port.

more details about root port reset in USB2 section 7.1.7.5:.
"Software must ensure that resets issued to the root ports drive reset
long enough to overwhelm any concurrent resume attempts by downstream
devices. It is required that resets from root ports have a duration of
at least 50 ms (TDRSTR).

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoxhci: add port status tracing
Mathias Nyman [Wed, 16 Aug 2017 11:23:24 +0000 (14:23 +0300)]
xhci: add port status tracing

Track the port status in a human readble way each time we get a
port status change event

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoxhci: rename temp and temp1 variables
Mathias Nyman [Wed, 16 Aug 2017 11:23:23 +0000 (14:23 +0300)]
xhci: rename temp and temp1 variables

temp and temp1 variables are used for port status (portsc) and
command register. Give them more descriptive names

No functional changes

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoxhci: Add port status decoder for tracing purposes
Mathias Nyman [Wed, 16 Aug 2017 11:23:22 +0000 (14:23 +0300)]
xhci: Add port status decoder for tracing purposes

Add PORTSC Port status and control register decoder to
show human readable tracing of portsc register

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoxhci: add definitions for all port link states
Mathias Nyman [Wed, 16 Aug 2017 11:23:21 +0000 (14:23 +0300)]
xhci: add definitions for all port link states

Add definitions for all port link states defined in xhci
specification for PORTSC register.

Will be needed for human readable port status tracing

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: host: xhci: rcar: Add support for R-Car H3 ES2.0
Yoshihiro Shimoda [Wed, 16 Aug 2017 11:23:20 +0000 (14:23 +0300)]
usb: host: xhci: rcar: Add support for R-Car H3 ES2.0

This patch adds support for R-Car H3 ES2.0. Since this SoC revision
(or later) should use the V3 firmware, the driver needs to check
the revision via soc_device_match().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: host: xhci: plat: re-fact xhci_plat_priv for R-Car Gen3
Yoshihiro Shimoda [Wed, 16 Aug 2017 11:23:19 +0000 (14:23 +0300)]
usb: host: xhci: plat: re-fact xhci_plat_priv for R-Car Gen3

Since the firmware_name is decided by xhci-rcar.c on R-Car Gen3 now,
this patch removes 2 things:
 - Remove struct xhci_plat_priv xhci_plat_renesas_rcar_r8a7796.
 - Remoce .firmware_name from xhci_plat_renesas_rcar_gen3.

The behavior is the same as before.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agousb: host: xhci: rcar: Add firmware_name selection by soc_device_match()
Yoshihiro Shimoda [Wed, 16 Aug 2017 11:23:18 +0000 (14:23 +0300)]
usb: host: xhci: rcar: Add firmware_name selection by soc_device_match()

This patch adds firmware_name selection by soc_device_match() to
use other firmware name in the future. (For now, using the firmware
is the same as before.)

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agopower: wm831x_power: Support USB charger current limit management
Baolin Wang [Tue, 15 Aug 2017 11:07:55 +0000 (19:07 +0800)]
power: wm831x_power: Support USB charger current limit management

Integrate with the newly added USB charger interface to limit the current
we draw from the USB input based on the input device configuration
identified by the USB stack, allowing us to charge more quickly from high
current inputs without drawing more current than specified from others.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: phy: Add USB charger support
Baolin Wang [Tue, 15 Aug 2017 11:07:54 +0000 (19:07 +0800)]
usb: phy: Add USB charger support

This patch introduces the usb charger support based on usb phy that
makes an enhancement to a power driver. The basic conception of the
usb charger is that, when one usb charger is added or removed by
reporting from the extcon device state change, the usb charger will
report to power user to set the current limitation.

Power user can register a notifiee on the usb phy by issuing
usb_register_notifier() to get notified by charger status changes
or charger current changes.

we can notify what current to be drawn to power user according to
different charger type, and now we have 2 methods to get charger type.
One is get charger type from extcon subsystem, which also means the
charger state changes. Another is we can get the charger type from
USB controller detecting or PMIC detecting, and the charger state
changes should be told by issuing usb_phy_set_charger_state().

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoinclude: uapi: usb: Introduce USB charger type and state definition
Baolin Wang [Tue, 15 Aug 2017 11:07:53 +0000 (19:07 +0800)]
include: uapi: usb: Introduce USB charger type and state definition

Introducing USB charger type and state definition can help
to support USB charging which will be added in USB phy core.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: f_fs: Pass along set_halt errors.
Jerry Zhang [Fri, 11 Aug 2017 22:46:08 +0000 (15:46 -0700)]
usb: gadget: f_fs: Pass along set_halt errors.

Users can apply i/o in the wrong direction on an
endpoint to stall it. In case there is an error
that does not allow the endpoint to be stalled,
we want the user to know.

An operation to stall the endpoint will return
EBADMSG if successful, EAGAIN if there are still
queued requests, and other errors depending on
the underlying implementation.

Also remove the conditional since it is always true.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: bdc: Add support for USB phy
Al Cooper [Wed, 19 Jul 2017 19:11:48 +0000 (15:11 -0400)]
usb: bdc: Add support for USB phy

If a phy is specified in the device tree node, get it and use it.
This was based on a patch by:
"Srinath Mannam <srinath.mannam@broadcom.com>"

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: bdc: Enable in Kconfig for ARCH_BRCMSTB systems
Al Cooper [Wed, 19 Jul 2017 19:11:47 +0000 (15:11 -0400)]
usb: bdc: Enable in Kconfig for ARCH_BRCMSTB systems

Many ARM based Broadcom STB SoC's have a USB BDC controller so
enable this driver for these systems.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: bdc: fix "xsf for ep not enabled" errror
Al Cooper [Wed, 19 Jul 2017 19:11:46 +0000 (15:11 -0400)]
usb: bdc: fix "xsf for ep not enabled" errror

This patch essentially clears the port status change bits at the
correct times. It is necessary because the driver was not handling
the change bits correctly for events during device
connection/disconnection and bus enumeration. So, one of them (PCC)
was left stuck sometimes causing the "xsf for ep not enabled"
error we get on first connection. This was found by the Android team.
This was debugged and fixed by Sasi Kumar.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: bdc: Add support for suspend/resume
Al Cooper [Wed, 19 Jul 2017 19:11:45 +0000 (15:11 -0400)]
usb: bdc: Add support for suspend/resume

Based on a previous commit by Danesh Petigara <dpetigara@broadcom.com>
that added resume to solve the following problem:
"The BDC driver will fail after resuming from S3 suspend and this
will cause any upper layer gadget driver to fail."
This commit also adds support for suspend and manages the clock during
suspend/resume.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: bdc: hook a quick Device Tree compatible string
Florian Fainelli [Wed, 19 Jul 2017 19:11:44 +0000 (15:11 -0400)]
usb: bdc: hook a quick Device Tree compatible string

Allows Device Tree probing

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: bdc: Small code cleanup
Al Cooper [Wed, 19 Jul 2017 19:11:43 +0000 (15:11 -0400)]
usb: bdc: Small code cleanup

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: bdc: Add clock enable for new chips with a separate BDC clock
Al Cooper [Wed, 19 Jul 2017 19:11:42 +0000 (15:11 -0400)]
usb: bdc: Add clock enable for new chips with a separate BDC clock

Newer SoC's have added a BDC clock to the Device Tree, so get
and enable it.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agodt-bindings: usb: bdc: Add Device Tree binding for Broadcom UDC driver
Al Cooper [Wed, 19 Jul 2017 19:11:41 +0000 (15:11 -0400)]
dt-bindings: usb: bdc: Add Device Tree binding for Broadcom UDC driver

Add Device Tree binding document for Broadcom USB Device
Controller (BDC).

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: bdc: Fix misleading register names
Al Cooper [Wed, 19 Jul 2017 19:11:40 +0000 (15:11 -0400)]
usb: bdc: Fix misleading register names

The BDC endpoint status registers 0-7 were originally each going
to be an array of regsiters. This was later changed to being a
single register. The register definitions are being changed from:
"#define BDC_EPSTS0(n)  (0x60 + (n * 0x10))"
to
"#define BDC_EPSTS0 0x60"
to reflect this change and to avoid future coding mistakes.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: add RNDIS configfs options for class/subclass/protocol
David Lechner [Sun, 30 Jul 2017 01:12:57 +0000 (20:12 -0500)]
usb: gadget: add RNDIS configfs options for class/subclass/protocol

This adds 3 new options to the RNDIS gadget function configs. It allows
overriding the default USB interface class/subclass/protocol.

The motivation for this is that if you set the values to "ef" (Misc),
"04" (RNDIS), "01" (Ethernet) respectively, then the device will be
recognized by the rndiscmp.inf file in Windows Vista and newer and will
cause Windows to load the correct RNDIS driver without the need for a
custom (signed) .inf file.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: phy-tahvo: constify attribute_group structures.
Arvind Yadav [Fri, 4 Aug 2017 12:06:44 +0000 (17:36 +0530)]
usb: phy-tahvo: constify attribute_group structures.

attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: phy-mv-usb: constify attribute_group structures.
Arvind Yadav [Fri, 4 Aug 2017 12:06:43 +0000 (17:36 +0530)]
usb: phy-mv-usb: constify attribute_group structures.

attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: skip L2 state of hcd if controller work in device mode
Meng Dongyang [Wed, 9 Aug 2017 02:34:09 +0000 (10:34 +0800)]
usb: dwc2: skip L2 state of hcd if controller work in device mode

In the case hcd autosuspend is enabled, the hcd will enter L2 state
if no device connected. But if the controller works in otg mode, the
gadget driver still works in L0 state if connected with host. This
may result in transfer fail when gadget enqueue new request but the
hcd driver has set the global state into L2. This patch prevent the
hcd enter L2 state if the controller work in device mode.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: renesas_usbhs: gadget: fix spin_lock_init() for &uep->lock
Yoshihiro Shimoda [Wed, 9 Aug 2017 10:55:24 +0000 (19:55 +0900)]
usb: renesas_usbhs: gadget: fix spin_lock_init() for &uep->lock

This patch fixes an issue that the spin_lock_init() is not called
for almost all pipes. Otherwise, the lockdep output the following
message when we connect a usb cable using g_ncm:

 INFO: trying to register non-static key.
 the code is fine but needs lockdep annotation.
 turning off the locking correctness validator.

Reported-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Fixes: b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps when the driver stops")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: core: unmap request from DMA only if previously mapped
Jack Pham [Tue, 1 Aug 2017 09:00:56 +0000 (02:00 -0700)]
usb: gadget: core: unmap request from DMA only if previously mapped

In the SG case this is already handled since a non-zero
request->num_mapped_sgs is a clear indicator that dma_map_sg()
had been called. While it would be nice to do the same for the
singly mapped case by simply checking for non-zero request->dma,
it's conceivable that 0 is a valid dma_addr_t handle. Hence add
a flag 'dma_mapped' to struct usb_request and use this to
determine the need to call dma_unmap_single(). Otherwise, if a
request is not DMA mapped then the result of calling
usb_request_unmap_request() would safely be a no-op.

Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: allow serial gadget console on other configs
Thadeu Lima de Souza Cascardo [Fri, 11 Aug 2017 11:33:23 +0000 (08:33 -0300)]
usb: gadget: allow serial gadget console on other configs

USB gadget serial console works on functions other than the legacy
configurations. Let the user enable it when using any function that
uses the serial utilities.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: gadget: make usb_ep_ops const
Bhumika Goyal [Sat, 12 Aug 2017 12:04:55 +0000 (17:34 +0530)]
usb: dwc2: gadget: make usb_ep_ops const

Make the structure const as it is only stored in the ops field of a
usb_ep structure, which is of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: udc: renesas_usb3: make usb_ep_ops const
Bhumika Goyal [Sat, 12 Aug 2017 12:04:54 +0000 (17:34 +0530)]
usb: gadget: udc: renesas_usb3: make usb_ep_ops const

Make the structure const as it is only stored in the ops field of a
usb_ep structure, which is of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: renesas_usbhs: gadget: make usb_ep_ops const
Bhumika Goyal [Sat, 12 Aug 2017 12:04:53 +0000 (17:34 +0530)]
usb: renesas_usbhs: gadget: make usb_ep_ops const

Make the structure const as it is only stored in the ops field of a
usb_ep structure, which is of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: of-simple: remove include of clk-provider.h
Shawn Guo [Sun, 13 Aug 2017 14:21:11 +0000 (22:21 +0800)]
usb: dwc3: of-simple: remove include of clk-provider.h

The header clk-provider.h is there for clock drivers (providers) to
include, not client drivers (consumers).  That said,
of_clk_get_parent_count() is a helper function for clock providers, not
a clk API for consumers.

Let's replace of_clk_get_parent_count() with of_count_phandle_with_args()
call, so that we can remove the include of clk-provider.h.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: f_midi: Use snd_card_free_when_closed with refcount
Jerry Zhang [Mon, 14 Aug 2017 21:14:51 +0000 (14:14 -0700)]
usb: gadget: f_midi: Use snd_card_free_when_closed with refcount

Currenly, f_midi_free uses snd_card_free, which will wait
until the user has released the sound card before
returning. However, if the user doesn't release the sound
card, then f_midi_free can block for an arbitrary amount
of time, which also blocks any gadget operations on that
thread.

Instead, we can use snd_card_free_when_closed which returns
before all handles are released. Since f_midi can be
accessed through rmidi if usb_put_function is called before
release_card_device, add refcounting to f_midi_free and
have rawmidi's private free call it. The f_midi memory
is only kfreed when usb_put_function and release_card_device
have both been called.

Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: f_midi: add super speed support
Badhri Jagan Sridharan [Tue, 15 Aug 2017 01:15:14 +0000 (18:15 -0700)]
usb: gadget: f_midi: add super speed support

Add super speed descriptors for f_midi.

Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: dummy: fix infinite loop because of missing loop decrement
Colin Ian King [Tue, 15 Aug 2017 07:38:45 +0000 (08:38 +0100)]
usb: gadget: dummy: fix infinite loop because of missing loop decrement

The while loop never terminates because the loop counter i is never
decremented. Fix this by decrementing i.

Detected by CoverityScan, CID#751073 ("Infinite Loop")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: f_midi: constify snd_rawmidi_ops structures
Julia Lawall [Tue, 15 Aug 2017 08:09:52 +0000 (10:09 +0200)]
usb: gadget: f_midi: constify snd_rawmidi_ops structures

These snd_rawmidi_ops structures are only passed as the third
argument of snd_rawmidi_set_ops.  This argument is const, so the
snd_rawmidi_ops structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: mtu3: add generic compatible string
Chunfeng Yun [Tue, 8 Aug 2017 05:42:49 +0000 (13:42 +0800)]
usb: mtu3: add generic compatible string

The mtu3 driver is a generic driver for MediaTek usb3 DRD IP, add
a generic compatible to avoid confusion when support new SoCs but
use a compatible with specific SoC's name "mt8173".

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: f_hid: {GET,SET} PROTOCOL Support
Abdulhadi Mohamed [Wed, 19 Jul 2017 15:31:10 +0000 (16:31 +0100)]
usb: gadget: f_hid: {GET,SET} PROTOCOL Support

The current f_hid driver doesn't handle GET_PROCOTOL and
SET_PROCOTOL requests, which are required to operate HID
gadgets in BOOT mode. This patch implements this feature for
devices that have the same implementation for REPORT and BOOT mode
so that these devices are recognized by older BIOSes.

Signed-off-by: Abdulhadi Mohamed <abdulahhadi2@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: mtu3: fix ip sleep auto-exit issue when enable DRD mode
Chunfeng Yun [Tue, 25 Jul 2017 08:10:24 +0000 (16:10 +0800)]
usb: mtu3: fix ip sleep auto-exit issue when enable DRD mode

Ip sleep will auto exit if vbus comparison circuit of u2 phy is
disabled when system tries to enter suspend mode, so get vbus-valid
status from mac but not from u2 phy when enable DRD mode to fix
the issue.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: mtu3: clear u1/u2_enable to 0 in mtu3_gadget_reset
Chunfeng Yun [Tue, 25 Jul 2017 08:10:23 +0000 (16:10 +0800)]
usb: mtu3: clear u1/u2_enable to 0 in mtu3_gadget_reset

when the device is reset by host, the status of u1_enable and
u2_enable should also be restored to default value.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: mtu3: handle delayed status of the control transfer
Chunfeng Yun [Tue, 25 Jul 2017 08:10:22 +0000 (16:10 +0800)]
usb: mtu3: handle delayed status of the control transfer

Add the delayed status handling. This is used by mass storage etc to
gain some extra time to setup its internal status before it can proceed
further requests, and once the gadget is ready, it will enqueue an
empty packet which is used for synchronization.
The issue may happen on some FGPA platform with very low cpu frequency.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: phy: qcom: Use devm_ioremap_resource()
Fabio Estevam [Sun, 30 Jul 2017 00:58:56 +0000 (21:58 -0300)]
usb: phy: qcom: Use devm_ioremap_resource()

Using devm_ioremap_resource() can make the code simpler, as it
already does the resource NULL check.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: fsl_qe_udc: constify qe_ep0_desc
Julia Lawall [Wed, 2 Aug 2017 15:29:27 +0000 (17:29 +0200)]
usb: gadget: fsl_qe_udc: constify qe_ep0_desc

qe_ep0_desc is only passed as the second argument to qe_ep_init, which is
const, so qe_ep0_desc can be const too.

Done with the help of Coccinelle.

Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: udc: renesas_usb3: add support for R-Car M3-W
Yoshihiro Shimoda [Fri, 4 Aug 2017 02:16:58 +0000 (11:16 +0900)]
usb: gadget: udc: renesas_usb3: add support for R-Car M3-W

This patch adds support for R-Car M3-W. This patch also adds R-Car
Gen3 generic version's compatible and changes ".compatible" in
the usb3_of_match from "renesas,r8a7796-usb3-peri" to
"renesas,rcar-gen3-usb3-peri".

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoMerge 4.13-rc5 into usb-next
Greg Kroah-Hartman [Mon, 14 Aug 2017 21:50:58 +0000 (14:50 -0700)]
Merge 4.13-rc5 into usb-next

This gets the USB fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoLinux 4.13-rc5
Linus Torvalds [Sun, 13 Aug 2017 23:01:32 +0000 (16:01 -0700)]
Linux 4.13-rc5

6 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Sun, 13 Aug 2017 22:34:28 +0000 (15:34 -0700)]
Merge branch 'upstream' of git://git.linux-mips.org/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "Another round of MIPS fixes:

   - compressed boot: Ignore a generated .c file

   - VDSO: Fix a register clobber list

   - DECstation: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression

   - Octeon: Fix recent cleanups that cleaned away a bit too much thus
     breaking the arch side of the EDAC and USB drivers.

   - uasm: Fix duplicate const in "const struct foo const bar[]" which
     GCC 7.1 no longer accepts.

   - Fix race on setting and getting cpu_online_mask

   - Fix preemption issue. To do so cleanly introduce macro to get the
     size of L3 cache line.

   - Revert include cleanup that sometimes results in build error

   - MicroMIPS uses bit 0 of the PC to indicate microMIPS mode. Make
     sure this bit is set for kernel entry as well.

   - Prevent configuring the kernel for both microMIPS and MT. There are
     no such CPUs currently and thus the combination is unsupported and
     results in build errors.

  This has been sitting in linux-next for a few days and has survived
  automated testing by Imagination's test farm. No known regressions
  pending except a number of issues that crept up due to lots of people
  switching to GCC 7.1"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: Set ISA bit in entry-y for microMIPS kernels
  MIPS: Prevent building MT support for microMIPS kernels
  MIPS: PCI: Fix smp_processor_id() in preemptible
  MIPS: Introduce cpu_tcache_line_size
  MIPS: DEC: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression
  MIPS: VDSO: Fix clobber lists in fallback code paths
  Revert "MIPS: Don't unnecessarily include kmalloc.h into <asm/cache.h>."
  MIPS: OCTEON: Fix USB platform code breakage.
  MIPS: Octeon: Fix broken EDAC driver.
  MIPS: gitignore: ignore generated .c files
  MIPS: Fix race on setting and getting cpu_online_mask
  MIPS: mm: remove duplicate "const" qualifier on insn_table

6 years agoMerge tag 'driver-core-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 13 Aug 2017 19:44:18 +0000 (12:44 -0700)]
Merge tag 'driver-core-4.13-rc5' of git://git./linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are three firmware core fixes for 4.13-rc5.

  All three of these fix reported issues and have been floating around
  for a few weeks. They have been in linux-next with no reported
  problems"

* tag 'driver-core-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  firmware: avoid invalid fallback aborts by using killable wait
  firmware: fix batched requests - send wake up on failure on direct lookups
  firmware: fix batched requests - wake all waiters

6 years agoMerge tag 'char-misc-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
Linus Torvalds [Sun, 13 Aug 2017 19:41:58 +0000 (12:41 -0700)]
Merge tag 'char-misc-4.13-rc5' of git://git./linux/kernel/git/gregkh/char-misc

Pull char/misc fixes from Greg KH:
 "Here are two patches for 4.13-rc5.

  One is a fix for a reported thunderbolt issue, and the other a fix for
  an MEI driver issue. Both have been in linux-next with no reported
  issues"

* tag 'char-misc-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  thunderbolt: Do not enumerate more ports from DROM than the controller has
  mei: exclude device from suspend direct complete optimization

6 years agoMerge tag 'tty-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sun, 13 Aug 2017 19:33:35 +0000 (12:33 -0700)]
Merge tag 'tty-4.13-rc5' of git://git./linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here are two tty serial driver fixes for 4.13-rc5. One is a revert of
  a -rc1 patch that turned out to not be a good idea, and the other is a
  fix for the pl011 serial driver.

  Both have been in linux-next with no reported issues"

* tag 'tty-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  Revert "serial: Delete dead code for CIR serial ports"
  tty: pl011: fix initialization order of QDF2400 E44