Update copyright to The Linux Foundation

Change-Id: Iedbbbc0940b1ba4695fb29c601176183458046e4
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
usb: ks_bridge: Limit write size to 16KB

The user space application writes in 1MB chunks while loading MDM
images.  The current code allocate as many bytes as user space
passed to write system call.  These allocations are failing under
memory fragmentation scenario.  Hence limit write size to 16KB.

CRs-Fixed: 434638
Change-Id: Ibfad0f13c1fb2c30342d2435114001c580143292
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
(cherry picked from commit 7fcc7799af7ace4c4eda229b0eac6448f98d6637)

Conflicts:

	drivers/usb/misc/ks_bridge.c

Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
Merge "usb: ks_bridge: Limit write size to 16KB"
slimbus: Avoid same channel definition, removal in same sequence

Do not add the channel removal request to the remove list
when the client sends it right after the channel definition
without sending reconfigure_now request. Also remove the
channel define request from define list. This avoids
channel definition count being inconsistent, which may
lead to slimbus driver going into wrong state.

CRs-fixed: 409161
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
(cherry picked from commit 3dad0217b710d15b4fb0f02b438718b841a1d739)

Change-Id: Idd0fc28eac1a6299ff2d0453248cb4d656148ff8
Signed-off-by: Akhila Musunuri <c_akhila@qti.qualcomm.com>
Merge "slimbus: Avoid same channel definition, removal in same sequence"
net: usb: Fix memory leak on Tx data path

Driver anchors the tx urbs and defers the urb submission if
a transmit request comes when the interface is suspended.
Anchoring urb increments the urb reference count. These
deferred urbs are later accessed by calling usb_get_from_anchor()
for submission during interface resume. usb_get_from_anchor()
unanchors the urb but urb reference count remains same.
This causes the urb reference count to remain non-zero
after usb_free_urb() gets called and urb never gets freed.
Hence call usb_put_urb() after anchoring the urb to properly
balance the reference count for these deferred urbs. Also,
unanchor these deferred urbs during disconnect, to free them
up.

CRs-Fixed: 408145
Change-Id: If37b2f63da4ed20796cc8f3be6e64d15149c6cea
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
(cherry picked from commit 673e1f276a71065638da2dd7f431b630e9d414f4)

Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
usb: mdm_ctrl_bridge: Do not unlink URB upon cable disconnect

MDM control bridge driver unlinks the pending URBs when control
bridge gets closed as a result of usb cable disconnect. Driver
sends set_control_line_state request to MDM upon bridge close.
Right after sending the setup request driver unlinks the pending
URBs. In case if the URB is unlinked after setup stage is completed,
status stage remains pending. This results in a control transfer
stall. Similarly, when the bridge is reopened as a result of USB
cable plug-in, the interrupt URB is not resubmitted, which can also
lead to a QMI stall since the MDM is waiting indefinitely to send
its response available notification. Fix these two potential stall
conditions by not unlinking URBs upon cable disconnect; this will
allow in-progress control transfers to finish gracefully and will
also allow notification interrupts to always be handled. Unlinking
of the URBs will happen during MDM device disconnect, instead of
upon bridge close.

(cherry picked from commit 77f79575ebe35f2ec329827290e7a67fb0e75286)
CRs-Fixed: 419128,418478

Change-Id: I5474372d832de2fd49f17faf77e7e549e80566ad
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
(cherry picked from commit b95d663a4933726d6aeaa303989b5b3b17736fac)

Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
USB: ci13xxx_udc: Don't flush and disable all endpoints during disconnect

Flushing and disabling all endpoints during disconnect in controller
driver is simply wasteful and unnecessary.  Flushing endpoints before
notifying disconnect to composite driver will have side effects too.
The active endpoints will be disabled by function drivers when they
notified about disconnect.

The current code use 100 msec timeout for flush operation.  If controller
driver flush and disable all endpoints, the worst case timeout will be
added up to several seconds.  This is leading to watch dog timeout.

CRs-Fixed: 431623
Change-Id: If6a2e87006cda367c2eb4def616e9672e13eadf5
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
(cherry picked from commit bd710acbacb5b0265c26e00a8659a79b5ac0ffed)

Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
USB: ci13xxx_udc: Avoid flushing endpoint twice during disable

The ep_disable() function nukes all pending requests before
disabling the endpoint in hardware.  The endpoint is flushed
during nuking.  Don't flush the endpoint again.

(cherry picked from commit a89f80f9942e5dc2796ad742f9d01f6aa68e1267)

CRs-Fixed: 445916
Change-Id: I84020dceef751dbdde1233068a414a72d1c1b609
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
(cherry picked from commit 710a733e04dfbdce66fa91c68308e4439f732256)

Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
USB: ci13xxx_udc: Don't flush inactive endpoints

The endpoint must be flushed prior to retiring pending requests.
This is done during disabling an endpoint.  Don't flush an endpoint
if there are no pending requests.  According databook flushing
endpoint may take large amount of time.  This optimization will
make USB disconnect/reset processing a little bit faster.

(cherry picked from commit 58db2c1f94451d7a352d2ad1a1b1e9732f4f0a11)

CRs-Fixed: 445916
Change-Id: I2a8b185d7f6f295485bc1d1b1794f42471149491
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
(cherry picked from commit e25afb71f30e23f3563ab6be4ea8d35f732d50ae)

Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
USB: ci13xxx_udc: Skip flushing endpoints upon failure

Flushing an endpoint involve polling ENDPTFLUSH and ENDPTSTAT
registers.  The worst case timeout is 100 msec for each endpoint.
The reason for failure is unknown.  When flushing an endpoint
fails, successive flushing of remaining endpoints are also failing.
Hence skip flushing remaining endpoints.  Reset this condition
upon USB bus reset.

(cherry picked from commit 2a630fb9b83b31e607ef61f3b61959cc1b095349)

CRs-Fixed: 445916
Change-Id: I54cf860c0d290ffa3fc0d7e41af32b4be48937ef
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
(cherry picked from commit 0b4472b0957d49c87f3b4a230d9bd93204327e3e)

Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
usbnet: decrease suspend count if returning -EBUSY for runtime suspend

From commit 5eeb3132eb4c5e9ca92e5247fe4575fe9f8c3efe upstream.

This patch decreases dev->suspend_count in the -EBUSY failure path
of usbnet_suspend. Without the change, the later runtime suspend
will do nothing except for increasing dev->suspend_count.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: I5e1cbd39e4469150de7cc98af9517a4dbdc80780
CRs-Fixed: 404339
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
(cherry picked from commit bd57cdbc3f93781b364d11a0f5728da0112985ed)

Signed-off-by: Satish Kamuju <skamuj@codeaurora.org>
Merge "net: usb: Fix memory leak on Tx data path"
Merge "usb: mdm_ctrl_bridge: Do not unlink URB upon cable disconnect"
Merge "USB: ci13xxx_udc: Don't flush and disable all endpoints during disconnect"
Merge "USB: ci13xxx_udc: Avoid flushing endpoint twice during disable"
Merge "USB: ci13xxx_udc: Don't flush inactive endpoints"
Merge "USB: ci13xxx_udc: Skip flushing endpoints upon failure"
Merge "usbnet: decrease suspend count if returning -EBUSY for runtime suspend"
msm_fb: display: restore previous mdp bandwidth when resume

mdp resume bandwidth is set to the value when device was suspend, so
that the correct init value is set to avoid underrun.

(cherry picked from commit 5afd08632f905b54e7539cf46ddca670454445b0)

CRs-fixed: 425823
Change-Id: Ie9b832f0eb5b5e1b6cb5e8979626986d896d340b
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit 1c9eeb413179125fc0898bfdebaab4868acdca45)