USB: ci13xxx_udc:  Retire pending requests while flushing an endpoint

Rmnet and dun function drivers are designed to start fresh upon MODEM
restart.  The current code is flushing endpoints without freeing
requests.  New requests are allocated again after MODEM is powered up.
All accumulated requests are freed only upon cable disconnect.  If
MODEM is restarted multiple times without disconnecting the cable, we
are running low memory issues.

A pending request can not be freed without dequeuing it.  Dequeuing
all requests in a loop is a heavy operation and involves changing
multiple function drivers.  All pending requests are retired upon
disabling an endpoint.  But an endpoint can not be disabled in
configured state.  Hence retire pending requests while flushing an
endpoint.

CRs-Fixed: 489047
Change-Id: I3440a204ad8c4beb043b1068cb1d3965be96e9b7
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
u_ether: Handle memory allocation failure case on tx path

With multipacket feature enabled, if the memory allocation for
tx request buffer fails, accessing the req->buf leads to null pointer
dereference crash.

Hence, handle memory alloction failure case and return -ENOMEM.

CRs-Fixed: 490085
Change-Id: Ic5faac8ea7eb056755b03007c48ff085f10afa20
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
wcnss: Pre-alloc memory for WLAN driver

WLAN driver will use this pre-allocated memory (when available) for
large memory allocations; this will prevent WLAN driver load
failures because of the un-availability of the large size slabs
during module load.

Change-Id: I8a8139bdf343ddc871036f6d5c6ab90993816de0
CRs-Fixed: 369983
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
defconfig: wcnss: Enable wcnss pre-alloc memory

Enable support for pre-alloc memory for WLAN driver.

Change-Id: I0a18cfcfeb23538e6e0b2f5144f686b26170e1d1
CRs-Fixed: 369983
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
power: pm8921-bms: Update the FCC learning algorithm

1. Add configurable parameters to
	- enable/disable fcc learning
	- minimum soc to start FCC learning
	- minimum ocv (pc) to start FCC learning
	- minimum cycles to update fcc vs temp. table

2. New FCC is calculated using the cc count-
	FCC_NEW = (cc_end - cc_start) / (soc2 - soc1)
	cc_end = CC count when charing ends
	cc_start = CC count when charging starts
	soc1, soc2 = starting and ending SOC_rbatt value

3. Add a new sysfs entries to update the learnt fcc values
   to userspace. These values are restored back on
   reboot.

CRs-Fixed: 417288
Change-Id: I0dc713d59ef9c45f96b9f0b5844252758bd09320
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Merge "USB: ci13xxx_udc:  Retire pending requests while flushing an endpoint"
Merge "power: pm8921-bms: Update the FCC learning algorithm"
Merge "wcnss: Pre-alloc memory for WLAN driver"
Merge "defconfig: wcnss: Enable wcnss pre-alloc memory"
Merge "u_ether: Handle memory allocation failure case on tx path"