From: Huang, Tao Date: Sat, 6 May 2017 06:23:00 +0000 (+0800) Subject: Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux... X-Git-Tag: release-20171130_firefly~4^2~656 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=986d4e4637c85011e94a40cad15301edbf7a7c03;p=firefly-linux-kernel-4.4.55.git Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git * linux-linaro-lsk-v4.4-android: (521 commits) Linux 4.4.66 ftrace/x86: Fix triple fault with graph tracing and suspend-to-ram ARCv2: save r30 on kernel entry as gcc uses it for code-gen nfsd: check for oversized NFSv2/v3 arguments Input: i8042 - add Clevo P650RS to the i8042 reset list p9_client_readdir() fix MIPS: Avoid BUG warning in arch_check_elf MIPS: KGDB: Use kernel context for sleeping threads ALSA: seq: Don't break snd_use_lock_sync() loop by timeout ALSA: firewire-lib: fix inappropriate assignment between signed/unsigned type ipv6: check raw payload size correctly in ioctl ipv6: check skb->protocol before lookup for nexthop macvlan: Fix device ref leak when purging bc_queue ip6mr: fix notification device destruction netpoll: Check for skb->queue_mapping net: ipv6: RTF_PCPU should not be settable from userspace dp83640: don't recieve time stamps twice tcp: clear saved_syn in tcp_disconnect() sctp: listen on the sock only when it's state is listening or closed net: ipv4: fix multipath RTM_GETROUTE behavior when iif is given ... Conflicts: drivers/usb/dwc3/gadget.c include/linux/usb/quirks.h Change-Id: I490f766b9a530b10da3107e20709538e4536a99d --- 986d4e4637c85011e94a40cad15301edbf7a7c03 diff --cc drivers/misc/Makefile index 06750b942827,9a3b402921b2..c73cc3ee8449 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@@ -57,6 -56,5 +57,6 @@@ obj-$(CONFIG_GENWQE) += genwqe obj-$(CONFIG_ECHO) += echo/ obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o obj-$(CONFIG_CXL_BASE) += cxl/ - obj-$(CONFIG_UID_CPUTIME) += uid_cputime.o + obj-$(CONFIG_UID_SYS_STATS) += uid_sys_stats.o obj-$(CONFIG_MEMORY_STATE_TIME) += memory_state_time.o +obj-$(CONFIG_USB_CAM_GPIO) += usb_cam_gpio.o diff --cc drivers/usb/dwc3/gadget.c index 3399679513a8,ec7a50f98f57..46c7bb4cfd10 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@@ -174,14 -235,24 +174,15 @@@ void dwc3_gadget_giveback(struct dwc3_e int status) { struct dwc3 *dwc = dep->dwc; + unsigned int unmap_after_complete = false; int i; - if (req->queued) { + if (req->started) { i = 0; do { - dep->busy_slot++; - /* - * Skip LINK TRB. We can't use req->trb and check for - * DWC3_TRBCTL_LINK_TRB because it points the TRB we - * just completed (not the LINK TRB). - */ - if (((dep->busy_slot & DWC3_TRB_MASK) == - DWC3_TRB_NUM- 1) && - usb_endpoint_xfer_isoc(dep->endpoint.desc)) - dep->busy_slot++; + dwc3_ep_inc_deq(dep); } while(++i < req->request.num_mapped_sgs); - req->queued = false; + req->started = false; } list_del(&req->list); req->trb = NULL; @@@ -189,20 -260,32 +190,32 @@@ if (req->request.status == -EINPROGRESS) req->request.status = status; - if (dwc->ep0_bounced && dep->number <= 1) + /* + * NOTICE we don't want to unmap before calling ->complete() if we're + * dealing with a bounced ep0 request. If we unmap it here, we would end + * up overwritting the contents of req->buf and this could confuse the + * gadget driver. + */ + if (dwc->ep0_bounced && dep->number <= 1) { dwc->ep0_bounced = false; - - usb_gadget_unmap_request(&dwc->gadget, &req->request, - req->direction); + unmap_after_complete = true; + } else { + usb_gadget_unmap_request(&dwc->gadget, + &req->request, req->direction); + } - dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n", - req, dep->name, req->request.actual, - req->request.length, status); trace_dwc3_gadget_giveback(req); spin_unlock(&dwc->lock); usb_gadget_giveback_request(&dep->endpoint, &req->request); spin_lock(&dwc->lock); + if (unmap_after_complete) + usb_gadget_unmap_request(&dwc->gadget, + &req->request, req->direction); ++ + if (dep->number > 1) + pm_runtime_put(dwc->dev); } int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param) diff --cc include/linux/usb/quirks.h index 56939098675e,de2a722fe3cf..594385d1ad36 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h @@@ -50,7 -50,10 +50,13 @@@ /* device can't handle Link Power Management */ #define USB_QUIRK_NO_LPM BIT(10) + /* + * Device reports its bInterval as linear frames instead of the + * USB 2.0 calculation. + */ + #define USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL BIT(11) + +/* device can't support auto suspend function */ - #define USB_QUIRK_AUTO_SUSPEND BIT(11) ++#define USB_QUIRK_AUTO_SUSPEND BIT(12) + #endif /* __LINUX_USB_QUIRKS_H */