OSDN Git Service

android-x86/kernel.git
6 years agousb: dwc3: core: Fix broken system suspend/resume on AM437x
Roger Quadros [Fri, 16 Mar 2018 14:44:27 +0000 (16:44 +0200)]
usb: dwc3: core: Fix broken system suspend/resume on AM437x

On TI's AM437x, the DWC3 controller looses state after a
system suspend/resume. We are re-initializing the controller
but we miss restoring the PRTCAP register. This causes
USB host to break on AM437x after a system suspend/resume.

Fix this by restoring the PRTCAP register on system resume.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Check controller type before setting speed
Thinh Nguyen [Fri, 16 Mar 2018 22:35:57 +0000 (15:35 -0700)]
usb: dwc3: Check controller type before setting speed

DWC_usb3 speed can only be set up to SuperSpeed. Limit the setting to
SuperSpeed only should the value be higher. Otherwise, the controller
will read an invalid speed value and set the device to an incorrect
speed.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Dump LSP and BMU debug info
Thinh Nguyen [Fri, 16 Mar 2018 22:35:51 +0000 (15:35 -0700)]
usb: dwc3: Dump LSP and BMU debug info

Dump LSP and BMU debug info.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Check for ESS TX/RX threshold config
Thinh Nguyen [Fri, 16 Mar 2018 22:35:44 +0000 (15:35 -0700)]
usb: dwc3: Check for ESS TX/RX threshold config

Check and configure TX/RX threshold for DWC_usb31. Update dwc3 structure
with new fields to store these threshold configurations.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Make TX/RX threshold configurable
Thinh Nguyen [Fri, 16 Mar 2018 22:35:38 +0000 (15:35 -0700)]
usb: dwc3: Make TX/RX threshold configurable

DWC_usb31 periodic transfer at 48K+ bytes per interval may need
modification to the TX/RX packet threshold to achieve optimal result.
Add properties to make it configurable.

By default, periodic ESS TX and RX threshold are not enabled. To enable
TX or RX threshold (host mode only), both packet threshold count and max
burst size properties must be set to a valid non-zero value 1-16.

DWC_usb31 programming guide section 1.2.3 and 1.2.4.

Cc: John Youn <johnyoun@synopsys.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Add DWC_usb31 GTXTHRCFG reg fields
Thinh Nguyen [Fri, 16 Mar 2018 22:34:20 +0000 (15:34 -0700)]
usb: dwc3: Add DWC_usb31 GTXTHRCFG reg fields

Add new GTXTHRCFG bit field macros for DWC_usb31. The GTXTHRCFG register
fields for DWC_usb31 is as follows:
 +-------+--------------------------+-----------------------------------+
 | BITS  | Name                     | Description                       |
 +=======+==========================+===================================+
 | 31:27 | reserved                 |                                   |
 | 26    | UsbTxPktCntSel           | Async ESS transmit packet         |
 |       |                          | threshold enable                  |
 | 25:21 | UsbTxPktCnt              | Async ESS transmit packet         |
 |       |                          | threshold count                   |
 | 20:16 | UsbMaxTxBurstSize        | Async ESS Max transmit burst size |
 | 15    | UsbTxThrNumPktSel_HS_Prd | HS high bandwidth periodic        |
 |       |                          | transmit packet threshold enable  |
 | 14:13 | UsbTxThrNumPkt_HS_Prd    | HS high bandwidth periodic        |
 |       |                          | transmit packet threshold count   |
 | 12:11 | reserved                 |                                   |
 | 10    | UsbTxThrNumPktSel_Prd    | Periodic ESS transmit packet      |
 |       |                          | threshold enable                  |
 | 9:5   | UsbTxThrNumPkt_Prd       | Periodic ESS transmit packet      |
 |       |                          | threshold count                   |
 | 4:0   | UsbMaxTxBurstSize_Prd    | Max periodic ESS TX burst size    |
 +-------+--------------------------+-----------------------------------+

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: gadget: Check IP revision for GRXTHRCFG
Thinh Nguyen [Fri, 16 Mar 2018 22:34:13 +0000 (15:34 -0700)]
usb: dwc3: gadget: Check IP revision for GRXTHRCFG

DWC_usb31 controller has a different UsbRxPktCnt bit fields from
GRXTHRCFG register. Check for DWC_usb31 IP revision to read the
appropriate value.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Add DWC_usb31 GRXTHRCFG bit fields
Thinh Nguyen [Fri, 16 Mar 2018 22:34:07 +0000 (15:34 -0700)]
usb: dwc3: Add DWC_usb31 GRXTHRCFG bit fields

Add new GRXTHRCFG bit field macros for DWC_usb31. The GRXTHRCFG register
fields for DWC_usb31 is as follows:
 +-------+--------------------------+----------------------------------+
 | BITS  | Name                     | Description                      |
 +=======+==========================+==================================+
 | 31:27 | reserved                 |                                  |
 | 26    | UsbRxPktCntSel           | Async ESS receive packet         |
 |       |                          | threshold enable                 |
 | 25:21 | UsbRxPktCnt              | Async ESS receive packet         |
 |       |                          | threshold count                  |
 | 20:16 | UsbMaxRxBurstSize        | Async ESS Max receive burst size |
 | 15    | UsbRxThrNumPktSel_HS_Prd | HS high bandwidth periodic       |
 |       |                          | receive packet threshold enable  |
 | 14:13 | UsbRxThrNumPkt_HS_Prd    | HS high bandwidth periodic       |
 |       |                          | receive packet threshold count   |
 | 12:11 | reserved                 |                                  |
 | 10    | UsbRxThrNumPktSel_Prd    | Periodic ESS receive packet      |
 |       |                          | threshold enable                 |
 | 9:5   | UsbRxThrNumPkt_Prd       | Periodic ESS receive packet      |
 |       |                          | threshold count                  |
 | 4:0   | UsbMaxRxBurstSize_Prd    | Max periodic ESS RX burst size   |
 +-------+--------------------------+----------------------------------+

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Check IP revision for GTXFIFOSIZ
Thinh Nguyen [Fri, 16 Mar 2018 22:34:00 +0000 (15:34 -0700)]
usb: dwc3: Check IP revision for GTXFIFOSIZ

DWC_usb31 controller has different GTXFIFOSIZE bit field for TXFDEF.
Check for DWC_usb31 IP revision to read the appropriate bit fields.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Update DWC_usb31 GTXFIFOSIZ reg fields
Thinh Nguyen [Fri, 16 Mar 2018 22:33:54 +0000 (15:33 -0700)]
usb: dwc3: Update DWC_usb31 GTXFIFOSIZ reg fields

Update two GTXFIFOSIZ bit fields for the DWC_usb31 controller. TXFDEP
is a 15-bit value instead of 16-bit value, and bit 15 is TXFRAMNUM.

The GTXFIFOSIZ register for DWC_usb31 is as follows:
 +-------+-----------+----------------------------------+
 | BITS  | Name      | Description                      |
 +=======+===========+==================================+
 | 31:16 | TXFSTADDR | Transmit FIFOn RAM Start Address |
 | 15    | TXFRAMNUM | Asynchronous/Periodic TXFIFO     |
 | 14:0  | TXFDEP    | TXFIFO Depth                     |
 +-------+-----------+----------------------------------+

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Add SoftReset PHY synchonization delay
Thinh Nguyen [Fri, 16 Mar 2018 22:33:48 +0000 (15:33 -0700)]
usb: dwc3: Add SoftReset PHY synchonization delay

From DWC_usb31 programming guide section 1.3.2, once DWC3_DCTL_CSFTRST
bit is cleared, we must wait at least 50ms before accessing the PHY
domain (synchronization delay).

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: pci: Properly cleanup resource
Thinh Nguyen [Mon, 19 Mar 2018 20:07:35 +0000 (13:07 -0700)]
usb: dwc3: pci: Properly cleanup resource

Platform device is allocated before adding resources. Make sure to
properly cleanup on error case.

Cc: <stable@vger.kernel.org>
Fixes: f1c7e7108109 ("usb: dwc3: convert to pcim_enable_device()")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Makefile: fix link error on randconfig
Felipe Balbi [Thu, 22 Mar 2018 08:45:20 +0000 (10:45 +0200)]
usb: dwc3: Makefile: fix link error on randconfig

If building a kernel without FTRACE but with TRACING, dwc3.ko fails to
link due to missing trace events. Fix this by using the correct
Kconfig symbol on Makefile.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: ep0: remove redundant assignment
Heinrich Schuchardt [Sun, 18 Mar 2018 14:47:40 +0000 (15:47 +0100)]
usb: dwc3: ep0: remove redundant assignment

In

dwc3_request *r = NULL;
r = A;

the first assignment has no effect. Remove it.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: fix spelling mistake: "genereted" -> "generated"
Colin Ian King [Tue, 13 Mar 2018 15:50:24 +0000 (15:50 +0000)]
usb: dwc2: fix spelling mistake: "genereted" -> "generated"

Trivial fix to spelling mistake in dev_warn warning message text.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: Prevent indefinite sleep in _dwc3_set_mode during suspend/resume
Roger Quadros [Fri, 9 Mar 2018 12:47:04 +0000 (14:47 +0200)]
usb: dwc3: Prevent indefinite sleep in _dwc3_set_mode during suspend/resume

In the following test we get stuck by sleeping forever in _dwc3_set_mode()
after which dual-role switching doesn't work.

On dra7-evm's dual-role port,
- Load g_zero gadget driver and enumerate to host
- suspend to mem
- disconnect USB cable to host and connect otg cable with Pen drive in it.
- resume system
- we sleep indefinitely in _dwc3_set_mode due to.
  dwc3_gadget_exit()->usb_del_gadget_udc()->udc_stop()->
dwc3_gadget_stop()->wait_event_lock_irq()

To fix this instead of waiting indefinitely with wait_event_lock_irq()
we use wait_event_interruptible_lock_irq_timeout() and print
and error message if there was a timeout.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Make dwc2_force_mode() static
Grigor Tovmasyan [Fri, 19 Jan 2018 10:43:01 +0000 (14:43 +0400)]
usb: dwc2: Make dwc2_force_mode() static

Declared dwc2_force_mode() function as static, because it was used
only in core.c file, for fixing sparse error.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: add support for host mode external vbus supply
Amelie Delaunay [Tue, 13 Feb 2018 08:28:12 +0000 (09:28 +0100)]
usb: dwc2: add support for host mode external vbus supply

This patch adds a way to enable an external vbus supply in host mode,
when dwc2 drvvbus signal is not used.

This patch is very similar to the one done in U-Boot dwc2 driver [1]. It
also adds dynamic vbus supply management depending on the role and state
of the core.

[1] https://lists.denx.de/pipermail/u-boot/2017-March/283434.html

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Force mode optimizations
Vardan Mikayelyan [Fri, 16 Feb 2018 08:56:03 +0000 (12:56 +0400)]
usb: dwc2: Force mode optimizations

If the dr_mode is USB_DR_MODE_OTG, forcing the mode is needed during
driver probe to get the host and device specific HW parameters. Then we
clear the force mode bits so that the core operates in OTG mode.

The force mode bits should not be touched at any other time during the
driver lifetime and they should be preserved whenever the GUSBCFG
register is written to. The force mode bit values will persist across
soft resets of the core.

If the dr_mode is either USB_DR_MODE_HOST or USB_DR_MODE_PERIPHERAL, the
force mode is set just once at probe to configure the core as either a
host or peripheral.

Given the above, we no longer need any other reset delays, force delays,
or any forced modes anywhere else in the driver. So replace all calls to
dwc2_core_reset_and_force_dr_mode() with dwc2_core_reset() and remove
all other unnecessary delays.

Also remove the dwc2_force_mode_if_needed() function since the "if
needed" part is already taken care of by the polling in
dwc2_force_mode().

Finally, remove all other calls to dwc2_clear_force_mode().

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Enable power down
John Youn [Fri, 16 Feb 2018 10:12:28 +0000 (14:12 +0400)]
usb: dwc2: Enable power down

Enable the power down option based on the core capability.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Change hub-control to allow hibernation
Vardan Mikayelyan [Fri, 16 Feb 2018 10:12:02 +0000 (14:12 +0400)]
usb: dwc2: Change hub-control to allow hibernation

Affected cases:
ClearPortFeature's
 USB_PORT_FEAT_SUSPEND

SetPortFeature's
 USB_PORT_FEAT_SUSPEND
 USB_PORT_FEAT_RESET

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add dwc2_handle_gpwrdn_intr() handler
Vardan Mikayelyan [Fri, 16 Feb 2018 10:11:35 +0000 (14:11 +0400)]
usb: dwc2: Add dwc2_handle_gpwrdn_intr() handler

The GPWRDN interrupts are those that occur in both Host and
Device mode while core is in hibernated state.

Export dwc2_core_init to be able to use it in GPWRDN_IDSTS
interrupt handler.

Here we have duplicated init functions in host and gadget sides
so I have left things as it was(used corresponing functions for
host and gadget), maybe in the future we'll resolve this problem
and will use dwc2_core_init for both sides.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Allow entering hibernation from USB_SUSPEND interrupt
Vardan Mikayelyan [Fri, 16 Feb 2018 10:11:07 +0000 (14:11 +0400)]
usb: dwc2: Allow entering hibernation from USB_SUSPEND interrupt

Do changes to allow entering hibernated state from USB_SUSPEND
interrupt. All code is added under if conditions and mustn't impact
existing functionality.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()
Vardan Mikayelyan [Fri, 16 Feb 2018 10:10:39 +0000 (14:10 +0400)]
usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()

These are wrapper functions which are calling device or host
enter/exit hibernation functions.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add host/device hibernation functions
Vardan Mikayelyan [Fri, 16 Feb 2018 10:10:13 +0000 (14:10 +0400)]
usb: dwc2: Add host/device hibernation functions

Add host/device hibernation functions which must be wrapped
by core's  dwc2_enter_hibernation()/dwc2_exit_hibernation()
functions.

Make dwc2_backup_global_registers dwc2_restore_global_register
non-static to use them in both host/gadget sides.

Added function names:
dwc2_gadget_enter_hibernation()
dwc2_gadget_exit_hibernation()
dwc2_host_enter_hibernation()
dwc2_host_exit_hibernation()

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add helper functions for restore routine
Vardan Mikayelyan [Fri, 16 Feb 2018 10:09:46 +0000 (14:09 +0400)]
usb: dwc2: Add helper functions for restore routine

Add common (host/device) helper functions, which will be called while
exiting from hibernation, from both sides.

dwc2_restore_essential_regs()
dwc2_hib_restore_common()

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Changes in registers backup/restore functions
Vardan Mikayelyan [Fri, 16 Feb 2018 10:09:19 +0000 (14:09 +0400)]
usb: dwc2: Changes in registers backup/restore functions

Move hptxfsiz to host register's backup/restore functions, not
needed to have it in global register's backup/restore functions.

Add backup for glpmcfg, and read/write for gi2cctl and pcgcctl.
As requires programming guide.

Affected functions:
dwc2_backup_host_registers()
dwc2_restore_host_registers()
dwc2_backup_global_registers()
dwc2_restore_global_registers()

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: gadget: Add remote_wakeup_allowed flag
Vardan Mikayelyan [Fri, 16 Feb 2018 10:08:53 +0000 (14:08 +0400)]
usb: dwc2: gadget: Add remote_wakeup_allowed flag

It will be set once corresponding set_feature command comes.

True if device is allowed to wake-up host by remote-wakeup
signalling.

This is preparation for remote wake-up support implementation,
it will not be implemented until gadget stack provide interface
for bringing remote wake-up signalling.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: core: Add hibernated flag
Vardan Mikayelyan [Fri, 16 Feb 2018 10:08:27 +0000 (14:08 +0400)]
usb: dwc2: core: Add hibernated flag

Added a flag to indicate that core is in hibernation,
it is used to determine the hibernation state of the core.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: gadget: Fix dwc2_restore_device_registers
Vardan Mikayelyan [Fri, 16 Feb 2018 10:08:00 +0000 (14:08 +0400)]
usb: dwc2: gadget: Fix dwc2_restore_device_registers

Add parameter remote_wakeup to dwc2_restore_device_registers()
to be able to restore device registers according to programming
guide for dwc-otg. It says that in case of rem_wakeup DCTL must not
be restored here.

Remove setting of DCTL_PWRONPRGDONE from this function, because it
will be done in function responsible for exiting from hibernation.

WA for enabled EPx's IN and OUT in DDMA mode. On entering to
hibernation wrong value read and saved from DIEPDMAx,
as result BNA interrupt asserted on hibernation exit
by restoring from saved area.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: gadget: Moved dtxfsiz backup array place
Vardan Mikayelyan [Fri, 16 Feb 2018 10:07:33 +0000 (14:07 +0400)]
usb: dwc2: gadget: Moved dtxfsiz backup array place

Moved dtxfsiz from dwc2_gregs_backup to dwc2_dregs_backup,
because it is device register.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add hibernation field into dwc2_hw_params
Vardan Mikayelyan [Fri, 16 Feb 2018 10:07:05 +0000 (14:07 +0400)]
usb: dwc2: Add hibernation field into dwc2_hw_params

Add parameter and it's initialization, needed for hibernation.

Reimplement dwc2_set_param_power_down() to support hibernation too.
Now 'power_down' parameter can be initialized with 0, 1 or 2.
0 - No
1 - Partial power down
2 - Hibernation

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Rename hibernation to partial_power_down
Vardan Mikayelyan [Fri, 16 Feb 2018 10:06:36 +0000 (14:06 +0400)]
usb: dwc2: Rename hibernation to partial_power_down

No-op change, only rename.

This code was misnamed originally. It was only responsible for partial
power down and not for hibernation.

Rename core_params->hibernation to core_params->power_down,
dwc2_set_param_hibernation() to dwc2_set_param_power_down().

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Enable LPM
John Youn [Wed, 24 Jan 2018 13:44:51 +0000 (17:44 +0400)]
usb: dwc2: Enable LPM

Set 'lpm_capable' flag in the gadget structure so
indicating that LPM is supported.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: add dual role support using OTG block
Roger Quadros [Tue, 27 Feb 2018 11:30:19 +0000 (13:30 +0200)]
usb: dwc3: add dual role support using OTG block

This is useful on platforms (e.g. TI AM437x) that don't
have ID available on a GPIO but do have the OTG block.

We can obtain the ID state via the OTG block and use it
for dual-role switching.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: phy: tegra: Increase PHY clock stabilization timeout
Dmitry Osipenko [Sun, 17 Dec 2017 17:02:39 +0000 (20:02 +0300)]
usb: phy: tegra: Increase PHY clock stabilization timeout

This fixes "utmi_phy_clk_enable: timeout waiting for phy to stabilize"
error message.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: phy-generic: Use gpiod_set_value_cansleep
Mike Looijmans [Wed, 21 Feb 2018 15:04:01 +0000 (16:04 +0100)]
usb: phy-generic: Use gpiod_set_value_cansleep

The nop_reset and shutdown methods are called in a context that can sleep,
so use gpiod_set_value_cansleep instead of gpiod_set_value.

If you've connected the reset line to a GPIO expander, you'd get a kernel
"slowpath" warning with gpiod_set_value.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: udc: Use scnprintf() instead of snprintf()
Jaejoong Kim [Tue, 27 Feb 2018 02:04:22 +0000 (11:04 +0900)]
usb: gadget: udc: Use scnprintf() instead of snprintf()

The show() method should use scnprintf() not snprintf() because snprintf()
may returns a value that exceeds its second argument.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: prevent setting PRTCAP to OTG from debugfs
Roger Quadros [Tue, 27 Feb 2018 10:54:37 +0000 (12:54 +0200)]
usb: dwc3: prevent setting PRTCAP to OTG from debugfs

We don't support PRTCAP == OTG yet, so prevent user from
setting it via debugfs.

Fixes: 41ce1456e1db ("usb: dwc3: core: make dwc3_set_mode() work properly")
Cc: <stable@vger.kernel.org> # v4.12+
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: core.h: add some register definitions
Roger Quadros [Tue, 27 Feb 2018 11:29:11 +0000 (13:29 +0200)]
usb: dwc3: core.h: add some register definitions

Add OTG and GHWPARAMS6 register definitions

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: of-simple: add support for the Amlogic Meson GXL and AXG SoCs
Martin Blumenstingl [Sun, 11 Feb 2018 21:15:17 +0000 (22:15 +0100)]
usb: dwc3: of-simple: add support for the Amlogic Meson GXL and AXG SoCs

Amlogic Meson GXL and AXG SoCs come with a (host-only) dwc3 USB
controller. To use this controller a clock has to be enabled and a reset
line has to be pulsed.
Enabling the clock works identical to other SoCs. However, the reset
line has to be pulsed (using reset_control_reset) instead of using a
level reset (reset_control_{assert,deassert}).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Yixun Lan <yixun.lan@amlogic.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: of-simple: add support for shared and pulsed reset lines
Martin Blumenstingl [Sun, 11 Feb 2018 21:15:16 +0000 (22:15 +0100)]
usb: dwc3: of-simple: add support for shared and pulsed reset lines

Some SoCs (such as Amlogic Meson GXL for example) share the reset line
with other components (in case of the Meson GXL example there's a shared
reset line between the USB2 PHYs, USB3 PHYs and the dwc3 controller).
Additionally SoC implementations may prefer a reset pulse over level
resets.

For now this falls back to the old defaults, which are:
- reset lines are exclusive
- level resets are being used

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Yixun Lan <yixun.lan@amlogic.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agodt-bindings: usb: add support for dwc3 controller on Amlogic Meson GX
Martin Blumenstingl [Sun, 11 Feb 2018 21:15:15 +0000 (22:15 +0100)]
dt-bindings: usb: add support for dwc3 controller on Amlogic Meson GX

Amlogic Meson GX SoCs (GXL and AXG) come with a (host-only) dwc3 USB
controller. This requires a clock to be enabled and a reset line to be
pulsed to get the hardware into a known state.
Add the documentation for this IP block, similar to "qcom,dwc3.txt".

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Tested-by: Yixun Lan <yixun.lan@amlogic.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: gadget: Use true and false for boolean values
Gustavo A. R. Silva [Tue, 23 Jan 2018 15:45:31 +0000 (09:45 -0600)]
usb: dwc2: gadget: Use true and false for boolean values

Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add core state checking
Grigor Tovmasyan [Wed, 24 Jan 2018 13:44:25 +0000 (17:44 +0400)]
usb: dwc2: Add core state checking

Added core state checking in dwc2_hsotg_ep_queue() function
to make sure that application will submit requests only in L0 state.

Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add call_gadget() function call
Grigor Tovmasyan [Wed, 24 Jan 2018 13:43:58 +0000 (17:43 +0400)]
usb: dwc2: Add call_gadget() function call

Added call_gadget() function call when entering to L1 state
to inform gadget that core is in L1 state.

Did the same thing when exiting from L1 state
to inform gadget that core is in L0 state.

Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: gadget: Configure the core to enable LPM
Sevak Arakelyan [Wed, 24 Jan 2018 13:43:32 +0000 (17:43 +0400)]
usb: dwc2: gadget: Configure the core to enable LPM

Configure core in device mode to support LPM according to
programming guide.
Device will start giving valid responses for LPM tokens.
After this patch device side LPM will start working.

Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Enable LPM Transaction Received interrupt
Sevak Arakelyan [Wed, 24 Jan 2018 13:43:06 +0000 (17:43 +0400)]
usb: dwc2: Enable LPM Transaction Received interrupt

Enable "LPM Transaction Received" interrupt for receive an
interrupt when host will send LPM token.

Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: gadget: LPM interrupt handler
Sevak Arakelyan [Wed, 24 Jan 2018 13:42:40 +0000 (17:42 +0400)]
usb: dwc2: gadget: LPM interrupt handler

This interrupt indicates that an LPM transaction
was received on the USB bus. After getting this
interrupt we are going from L0 state to L1 state.

Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: gadget: Add functionality to exit from LPM L1 state
Sevak Arakelyan [Wed, 24 Jan 2018 13:42:14 +0000 (17:42 +0400)]
usb: dwc2: gadget: Add functionality to exit from LPM L1 state

Add a function which will be called if device is in L1 sleep state
and Resume/Remote Wakeup Detected interrupt is asserted.

Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add core parameters for LPM support
Sevak Arakelyan [Wed, 24 Jan 2018 13:41:48 +0000 (17:41 +0400)]
usb: dwc2: Add core parameters for LPM support

Add lpm, lpm_clock_gating, besl, hird_threshold_en and hird_threshold
core parameters. These will indicate LPM and LPM Errata support
as well as chosen L1 sleeping mode for the core and PHY.

Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Rename GLPMCFG... definitions
Sevak Arakelyan [Wed, 24 Jan 2018 13:41:22 +0000 (17:41 +0400)]
usb: dwc2: Rename GLPMCFG... definitions

Make field names of GLPMCFG register in definitions to be
the same with the databook.

Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Backup and restore PCGCCTL1 register
Razmik Karapetyan [Wed, 24 Jan 2018 13:40:56 +0000 (17:40 +0400)]
usb: dwc2: Backup and restore PCGCCTL1 register

Backup PCGCCTL1 register when entering hibernation mode and
restore it after exiting from hibernation, to keep active ACG
feature.

Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Add ACG support to the driver
Razmik Karapetyan [Wed, 24 Jan 2018 13:40:29 +0000 (17:40 +0400)]
usb: dwc2: Add ACG support to the driver

Added function for supporting Active Clock Gating functionality
in the driver.

PCGCCTL1 (Power and Clock Control) register will be used
for controlling the core`s active clock gating feature, and
the previously reserved 12th bit in GHWCFG4 now indicates that the
controller supports the Dynamic Power Reduction (Active Clock Gating)
during no traffic scenarios such as L0, idle, resume and suspend
states.

dwc2_enable_acg() function sets GATEEN bit in PCGCCTL1 register
and enables ACG, if it supported.

According to ACG functional specification, enabling of ACG feature
in host mode done in host initialization, before turning Vbus on,
specifically in dwc2_core_host_init function.

Enabling of ACG feature in device mode done in device initialization,
before clearing the SftDiscon bit in DCTL.
This bit was cleared in dwc2_hsotg_core_connect() function.So
dwc2_enable_acg() called before dwc2_core_connect() calls.

Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Print error if unable to set DMA coherent mask
Stefan Wahren [Mon, 12 Feb 2018 20:20:08 +0000 (21:20 +0100)]
usb: dwc2: Print error if unable to set DMA coherent mask

We better print an error in case probing of dwc2 fails on
setting the DMA coherent mask.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: udc: atmel: convert to use GPIO descriptors
Ludovic Desroches [Thu, 1 Feb 2018 09:34:32 +0000 (10:34 +0100)]
usb: gadget: udc: atmel: convert to use GPIO descriptors

Use GPIO descriptors instead of relying on the old method.
Include irq.h header since it is needed and was indirectly
included through of_gpio.h.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: udc: atmel: remove code related to platform stuff
Ludovic Desroches [Thu, 1 Feb 2018 09:34:31 +0000 (10:34 +0100)]
usb: gadget: udc: atmel: remove code related to platform stuff

With the removal of AVR platforms, code related to platform stuff
is useless.

Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Fix interval type issue
Grigor Tovmasyan [Tue, 6 Feb 2018 15:07:38 +0000 (19:07 +0400)]
usb: dwc2: Fix interval type issue

The maximum value that unsigned char can hold is 255, meanwhile
the maximum value of interval is  2^(bIntervalMax-1)=2^15.

Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: pci: Handle error cleanup in probe
Vardan Mikayelyan [Fri, 19 Jan 2018 10:46:30 +0000 (14:46 +0400)]
usb: dwc2: pci: Handle error cleanup in probe

The probe function doesn't properly handle errors. Fix it so that it
properly handles cleanup.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: pci: Move devm_kzalloc() before platform_device_add()
Vardan Mikayelyan [Fri, 19 Jan 2018 10:46:04 +0000 (14:46 +0400)]
usb: dwc2: pci: Move devm_kzalloc() before platform_device_add()

After platform_device_add(), if we error out, we must do
platform_device_unregister(), which also does the put. So lets move
devm_kzalloc() to simplify error handling and avoid calling of
platform_device_unregister().

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: pci: Move usb_phy_generic_register()
Vardan Mikayelyan [Fri, 19 Jan 2018 10:45:38 +0000 (14:45 +0400)]
usb: dwc2: pci: Move usb_phy_generic_register()

Move usb_phy_generic_register() function call to the top, to simplify
error handling. If this fails we can simply return instead of cleaning
up.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: pci: Replace kzalloc() with devm_kzalloc()
Vardan Mikayelyan [Fri, 19 Jan 2018 10:45:12 +0000 (14:45 +0400)]
usb: dwc2: pci: Replace kzalloc() with devm_kzalloc()

Use devm_kzalloc() and remove the unnecessary kfree().

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Change TxFIFO and RxFIFO flushing flow
Minas Harutyunyan [Fri, 19 Jan 2018 10:44:46 +0000 (14:44 +0400)]
usb: dwc2: Change TxFIFO and RxFIFO flushing flow

Before flushing fifos required to check AHB master state and
lush when AHB master is in IDLE state.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: host: Fix transaction errors in host mode
Minas Harutyunyan [Fri, 19 Jan 2018 10:44:20 +0000 (14:44 +0400)]
usb: dwc2: host: Fix transaction errors in host mode

Added missing GUSBCFG programming in host mode, which fixes
transaction errors issue on HiKey and Altera Cyclone V boards.

These field even if was programmed in device mode (in function
dwc2_hsotg_core_init_disconnected()) will be resetting to POR values
after core soft reset applied.
So, each time when switching to host mode required to set this field
to correct value.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: hcd: Fix host channel halt flow
Minas Harutyunyan [Fri, 19 Jan 2018 10:43:53 +0000 (14:43 +0400)]
usb: dwc2: hcd: Fix host channel halt flow

According databook in Buffer and External DMA mode
non-split periodic channels can't be halted.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Remove unnecessary debug prints
Razmik Karapetyan [Fri, 19 Jan 2018 10:43:27 +0000 (14:43 +0400)]
usb: dwc2: Remove unnecessary debug prints

Removed unnecessary debug prints about DMA mode for host side
from dwc2_gahbcfg_init() function.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Delete unused functionality
Grigor Tovmasyan [Fri, 19 Jan 2018 10:42:35 +0000 (14:42 +0400)]
usb: dwc2: Delete unused functionality

Deleted dwc2_hcd_dump_frrem() function, because it used undefined
parameters from dwc2_hsotg structure. The function body was in #ifdef
statement and was never compiled.

Also removed that parameters from dwc2_hsotg structure, which were
used only in dwc2_hcd_dump_frrem() function.

And also delete dwc2_sample_frrem macro, because without
dwc2_hcd_dump_frrem() function it's lose its purpose.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Rename bit set/clear function names
Razmik Karapetyan [Fri, 19 Jan 2018 10:42:08 +0000 (14:42 +0400)]
usb: dwc2: Rename bit set/clear function names

Renamed __orr32 and __bic32 function names to more descriptive
dwc2_set_bit and dwc2_clear_bit respectively.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Update GINTSTS_GOUTNAKEFF interrupt handling
Razmik Karapetyan [Fri, 19 Jan 2018 10:41:42 +0000 (14:41 +0400)]
usb: dwc2: Update GINTSTS_GOUTNAKEFF interrupt handling

Disabled only unmasked endpoints based on DAINTMSK register.
This will allow to minimize GINTSTS_GOUTNAKEFF interrupt handling.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Update dwc2_handle_incomplete_isoc_out() function
Razmik Karapetyan [Fri, 19 Jan 2018 10:41:16 +0000 (14:41 +0400)]
usb: dwc2: Update dwc2_handle_incomplete_isoc_out() function

In 'for' loop skipped masked and non-ISOC EPs. Also breaked 'for' loop
after setting SGOUTNAK in DCTL,when one enabled EP was detected.

This will allow to minimize incomplete ISOC OUT interrupt handling.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Update dwc2_handle_incomplete_isoc_in() function
Razmik Karapetyan [Fri, 19 Jan 2018 10:40:49 +0000 (14:40 +0400)]
usb: dwc2: Update dwc2_handle_incomplete_isoc_in() function

Disabled only that ISOC endpoints,for which interrupt bit was set
in the DAINTMSK register. This will allow to minimize incomplete
ISOC IN interrupt handling.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Set AHB burst size to INCR
Razmik Karapetyan [Fri, 19 Jan 2018 10:40:23 +0000 (14:40 +0400)]
usb: dwc2: Set AHB burst size to INCR

Changed AHB burst size from INCR4 to INCR by default.
With this value driver shows excellent DMA performance.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Use AHB burst size parameter
Razmik Karapetyan [Fri, 19 Jan 2018 10:39:57 +0000 (14:39 +0400)]
usb: dwc2: Use AHB burst size parameter

In dwc2_hsotg_core_init_disconnected() function used AHB burst size
parameter, instead of calculating already calculated value.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Update bit polling functionality
Sevak Arakelyan [Fri, 19 Jan 2018 10:39:31 +0000 (14:39 +0400)]
usb: dwc2: Update bit polling functionality

Move dwc2_hsotg_wait_bit_set function to core.c so it can be used
anywhere in the code.

Added dwc2_hsotg_wait_bit_clear function in core.c.

Replace all the parts of register bit polling code with
dwc2_hsotg_wait_bit_set or dwc2_hsotg_wait_bit_clear functions
calls depends on code logic.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: Remove version check in GSNPSID
Gevorg Sahakyan [Tue, 16 Jan 2018 12:21:46 +0000 (16:21 +0400)]
usb: dwc2: Remove version check in GSNPSID

Only check the ID portion of the GSNPSID register and don’t check
the version. This will allow the driver to work with version 4.00a
and later of the DWC_hsotg IP.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Gevorg Sahakyan <sahakyan@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS
Lars-Peter Clausen [Fri, 12 Jan 2018 10:26:16 +0000 (11:26 +0100)]
usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS

Some UDC drivers (like the DWC3) expect that the response to a setup()
request is queued from within the setup function itself so that it is
available as soon as setup() has completed.

Upon receiving a setup request the function fs driver creates an event that
is made available to userspace. And only once userspace has acknowledged
that event the response to the setup request is queued.

So it violates the requirement of those UDC drivers and random failures can
be observed. This is basically a race condition and if userspace is able to
read the event and queue the response fast enough all is good. But if it is
not, for example because other processes are currently scheduled to run,
the USB host that sent the setup request will observe an error.

To avoid this the gadget framework provides the USB_GADGET_DELAYED_STATUS
return code. If a setup() callback returns this value the UDC driver is
aware that response is not yet available and can uses the appropriate
methods to handle this case.

Since in the case of function fs the response will never be available when
the setup() function returns make sure that this status code is used.

This fixed random occasional failures that were previously observed on a
DWC3 based system under high system load.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: ffs: Execute copy_to_user() with USER_DS set
Lars-Peter Clausen [Fri, 12 Jan 2018 10:05:02 +0000 (11:05 +0100)]
usb: gadget: ffs: Execute copy_to_user() with USER_DS set

When using a AIO read() operation on the function FS gadget driver a URB is
submitted asynchronously and on URB completion the received data is copied
to the userspace buffer associated with the read operation.

This is done from a kernel worker thread invoking copy_to_user() (through
copy_to_iter()). And while the user space process memory is made available
to the kernel thread using use_mm(), some architecture require in addition
to this that the operation runs with USER_DS set. Otherwise the userspace
memory access will fail.

For example on ARM64 with Privileged Access Never (PAN) and User Access
Override (UAO) enabled the following crash occurs.

Internal error: Accessing user space memory with fs=KERNEL_DS: 9600004f [#1] SMP
Modules linked in:
CPU: 2 PID: 1636 Comm: kworker/2:1 Not tainted 4.9.0-04081-g8ab2dfb-dirty #487
Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
Workqueue: events ffs_user_copy_worker
task: ffffffc87afc8080 task.stack: ffffffc87a00c000
PC is at __arch_copy_to_user+0x190/0x220
LR is at copy_to_iter+0x78/0x3c8
[...]
[<ffffff800847b790>] __arch_copy_to_user+0x190/0x220
[<ffffff80086f25d8>] ffs_user_copy_worker+0x70/0x130
[<ffffff80080b8c64>] process_one_work+0x1dc/0x460
[<ffffff80080b8f38>] worker_thread+0x50/0x4b0
[<ffffff80080bf5a0>] kthread+0xd8/0xf0
[<ffffff8008083680>] ret_from_fork+0x10/0x50

Address this by placing a set_fs(USER_DS) before of the copy operation
and revert it again once the copy operation has finished.

This patch is analogous to commit d7ffde35e31a ("vhost: use USER_DS in
vhost_worker thread") which addresses the same underlying issue.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: mass_storage: Set max_speed to SSP
Thinh Nguyen [Wed, 10 Jan 2018 21:17:13 +0000 (13:17 -0800)]
usb: gadget: mass_storage: Set max_speed to SSP

Increase max_speed of the mass_storage driver for UDCs that support
SuperSpeed Plus. The composite driver will pass this value to UDC core
to set the device speed on probe (actual speed may be different
depending on whether the USB controller supports it or other external
factors).

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: composite: remove duplicated code in OS desc handling
Chris Dickens [Mon, 1 Jan 2018 02:59:43 +0000 (18:59 -0800)]
usb: gadget: composite: remove duplicated code in OS desc handling

When the host wants to fetch OS descriptors, it sends two requests. The
first is only for the header and the second for the full amount
specified by the header in the first request. The OS descriptor handling
code is distinguishing the header-only requests based on the wLength of
the setup packet, but the same code is executed in both cases to
construct the actual header. Simplify this by always constructing the
header and then filling out the rest of the request if the wLength is
greater than the size of the header.

Also remove the duplicate code for queueing the request to ep0 by adding
a goto label.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: composite: fix incorrect handling of OS desc requests
Chris Dickens [Mon, 1 Jan 2018 02:59:42 +0000 (18:59 -0800)]
usb: gadget: composite: fix incorrect handling of OS desc requests

When handling an OS descriptor request, one of the first operations is
to zero out the request buffer using the wLength from the setup packet.
There is no bounds checking, so a wLength > 4096 would clobber memory
adjacent to the request buffer. Fix this by taking the min of wLength
and the request buffer length prior to the memset. While at it, define
the buffer length in a header file so that magic numbers don't appear
throughout the code.

When returning data to the host, the data length should be the min of
the wLength and the valid data we have to return. Currently we are
returning wLength, thus requests for a wLength greater than the amount
of data in the OS descriptor buffer would return invalid (albeit zero'd)
data following the valid descriptor data. Fix this by counting the
number of bytes when constructing the data and using this when
determining the length of the request.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc2: eliminate irq parameter from dwc2_gadget_init
Vardan Mikayelyan [Mon, 25 Dec 2017 11:17:45 +0000 (15:17 +0400)]
usb: dwc2: eliminate irq parameter from dwc2_gadget_init

The irq is available in hsotg already, so there's no need to pass it as
separate function parameter.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: udc: atmel: Use devm_ioremap_resource()
Ladislav Michl [Mon, 22 Jan 2018 16:05:21 +0000 (17:05 +0100)]
usb: gadget: udc: atmel: Use devm_ioremap_resource()

As devm_ioremap_resource() checks for valid resource,
make use of it instead of testing ourselves. As a bonus
memory region is requested.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoUSB: gadget: function: remove redundant initialization of 'tv_nexus'
Colin Ian King [Fri, 26 Jan 2018 15:39:00 +0000 (15:39 +0000)]
USB: gadget: function: remove redundant initialization of 'tv_nexus'

Pointer tv_nexus is being initialized a value and this is never read
and is later being updated with the same value. Remove the redundant
initialization so that the assignment to tv_nexus is performed later
and more local to when it is being read.

Cleans up clang warning:
drivers/usb/gadget/function/f_tcm.c:1097:25: warning: Value stored to
'tv_nexus' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: udc: change comparison to bitshift when dealing with a mask
Wolfram Sang [Tue, 6 Feb 2018 08:50:40 +0000 (09:50 +0100)]
usb: gadget: udc: change comparison to bitshift when dealing with a mask

Due to a typo, the mask was destroyed by a comparison instead of a bit
shift.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: phy: ab8500: use correct enum type
Stefan Agner [Sun, 11 Feb 2018 23:19:11 +0000 (00:19 +0100)]
usb: phy: ab8500: use correct enum type

The local variable event is of type enum usb_phy_events. Use
the same enum value USB_EVENT_NONE instead of UX500_MUSB_NONE.

This avoids a warning when building with clang:
  drivers/usb/phy/phy-ab8500-usb.c:906:30: warning: implicit conversion from
  enumeration type 'enum ux500_musb_vbus_id_status' to different enumeration
  type 'enum usb_phy_events' [-Wenum-conversion]
        enum usb_phy_events event = UX500_MUSB_NONE;
                            ~~~~~   ^~~~~~~~~~~~~~~

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: phy: mxs: Staticize mxs_charger_secondary_detection()
Fabio Estevam [Mon, 12 Feb 2018 02:24:05 +0000 (00:24 -0200)]
usb: phy: mxs: Staticize mxs_charger_secondary_detection()

mxs_charger_secondary_detection() is only used in this file, so make
it static.

This fixes the following sparse warning:

drivers/usb/phy/phy-mxs-usb.c:581:23: warning: symbol 'mxs_charger_secondary_detection' was not declared. Should it be static?

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: gadget: udc: bdc: Use dma_pool_zalloc
Souptick Joarder [Wed, 14 Feb 2018 18:29:13 +0000 (23:59 +0530)]
usb: gadget: udc: bdc: Use dma_pool_zalloc

Use dma_pool_zalloc instead of dma_pool_alloc + memset

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agousb: dwc3: debugfs: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Felipe Balbi [Thu, 15 Feb 2018 11:03:38 +0000 (13:03 +0200)]
usb: dwc3: debugfs: Re-use DEFINE_SHOW_ATTRIBUTE() macro

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoUSB: gadget: pxa27x: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Andy Shevchenko [Wed, 14 Feb 2018 16:08:23 +0000 (18:08 +0200)]
USB: gadget: pxa27x: Re-use DEFINE_SHOW_ATTRIBUTE() macro

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoUSB: gadget: pxa25x: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Andy Shevchenko [Wed, 14 Feb 2018 16:08:22 +0000 (18:08 +0200)]
USB: gadget: pxa25x: Re-use DEFINE_SHOW_ATTRIBUTE() macro

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoUSB: gadget: gr: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Andy Shevchenko [Wed, 14 Feb 2018 16:08:21 +0000 (18:08 +0200)]
USB: gadget: gr: Re-use DEFINE_SHOW_ATTRIBUTE() macro

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoUSB: gadget: bcm63xx: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Andy Shevchenko [Wed, 14 Feb 2018 16:08:20 +0000 (18:08 +0200)]
USB: gadget: bcm63xx: Re-use DEFINE_SHOW_ATTRIBUTE() macro

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoUSB: dwc2: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Andy Shevchenko [Wed, 14 Feb 2018 16:08:18 +0000 (18:08 +0200)]
USB: dwc2: Re-use DEFINE_SHOW_ATTRIBUTE() macro

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Cc: John Youn <johnyoun@synopsys.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
6 years agoLinux 4.16-rc3
Linus Torvalds [Mon, 26 Feb 2018 02:50:41 +0000 (18:50 -0800)]
Linux 4.16-rc3

6 years agoMerge tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa
Linus Torvalds [Mon, 26 Feb 2018 01:02:24 +0000 (17:02 -0800)]
Merge tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa

Pull Xtensa fixes from Max Filippov:
 "Two fixes for reserved memory/DMA buffers allocation in high memory on
  xtensa architecture

   - fix memory accounting when reserved memory is in high memory region

   - fix DMA allocation from high memory"

* tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa:
  xtensa: support DMA buffers in high memory
  xtensa: fix high memory/reserved memory collision

6 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 26 Feb 2018 00:58:55 +0000 (16:58 -0800)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
 "A small set of fixes:

   - UAPI data type correction for hyperv

   - correct the cpu cores field in /proc/cpuinfo on CPU hotplug

   - return proper error code in the resctrl file system failure path to
     avoid silent subsequent failures

   - correct a subtle accounting issue in the new vector allocation code
     which went unnoticed for a while and caused suspend/resume
     failures"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/topology: Update the 'cpu cores' field in /proc/cpuinfo correctly across CPU hotplug operations
  x86/topology: Fix function name in documentation
  x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
  x86/apic/vector: Handle vector release on CPU unplug correctly
  genirq/matrix: Handle CPU offlining proper
  x86/headers/UAPI: Use __u64 instead of u64 in <uapi/asm/hyperv.h>

6 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 26 Feb 2018 00:57:22 +0000 (16:57 -0800)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf fix from Thomas Gleixner:
 "A single commit which shuts up a bogus GCC-8 warning"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()

6 years agoMerge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 26 Feb 2018 00:29:59 +0000 (16:29 -0800)]
Merge branch 'locking-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull locking fixes from Thomas Gleixner:
 "Three patches to fix memory ordering issues on ALPHA and a comment to
  clarify the usage scope of a mutex internal function"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/xchg/alpha: Fix xchg() and cmpxchg() memory ordering bugs
  locking/xchg/alpha: Clean up barrier usage by using smp_mb() in place of __ASM__MB
  locking/xchg/alpha: Add unconditional memory barrier to cmpxchg()
  locking/mutex: Add comment to __mutex_owner() to deter usage

6 years agoMerge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 26 Feb 2018 00:27:51 +0000 (16:27 -0800)]
Merge branch 'core-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull cleanup patchlet from Thomas Gleixner:
 "A single commit removing a bunch of bogus double semicolons all over
  the tree"

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  treewide/trivial: Remove ';;$' typo noise

6 years agoMerge tag 'nfs-for-4.16-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Sun, 25 Feb 2018 21:43:18 +0000 (13:43 -0800)]
Merge tag 'nfs-for-4.16-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfixes from Trond Myklebust:

 - fix a broken cast in nfs4_callback_recallany()

 - fix an Oops during NFSv4 migration events

 - make struct nlmclnt_fl_close_lock_ops static

* tag 'nfs-for-4.16-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  NFS: make struct nlmclnt_fl_close_lock_ops static
  nfs: system crashes after NFS4ERR_MOVED recovery
  NFSv4: Fix broken cast in nfs4_callback_recallany()