fat: limit the number of error prints

Use fat_fs_error_ratelimit instead of fat_fs_error so as to
avoid large number of prints.

CRs-Fixed: 619824
Change-Id: I458df6c2c7a53c0902f2b388b5992007b719cb86
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
msm: kgsl: allow creation of events from the future

For contexts created with the KGSL_CONTEXT_USER_GENERATED_TS,
allow events to be created for timestamps that have not
been issued yet. Presumably these contexts know what they
are doing.

Change-Id: Iccf2e549b38e1a11850d26ee64b7279ab0b8a1ae
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
TTY: msm_smd_tty: Fix simultaneous open/close race condition

smd_tty_close currently has a variable that depends on a race
condition with tty_port_open. This causes a null-pointer dereference
when the same port is simultaneously being opened/closed.

Use data from a static array instead of the variable to eliminate
the race condition.

CRs-Fixed: 624398
Change-Id: Ie55d37feaadd3a15f64e18501cd3af19145dbc8e
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
ksm: Provide support to use deferred timers for scanner thread

KSM thread to scan pages is getting schedule on definite timeout.
That wakes up CPU from idle state and hence may affect the power
consumption. Provide an optional support to use deferred timer
which suites low-power use-cases.

To enable deferred timers,
$ echo 1 > /sys/kernel/mm/ksm/deferred_timer

Change-Id: I07fe199f97fe1f72f9a9e1b0b757a3ac533719e8
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
mmc: core: fix variable being overwritten

The status variable is being overwritten by label variable,
since the latter is an array of 0 length. Hence, move label
to be the last member of the structure.

CRs-fixed: 642326
Change-Id: I0a985a73dfa1d82829f8dfef5c32d947a33ce2ba
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
cfg80211: unblock user hint when cfg80211_regdom is intersected

If the driver is loaded when cfg80211_regdom is intersected then
user hint will fail for the first time since cfg80211 does not
have a check to see if cfg80211_regdom is intersected. Add
a check to see if cf80211_regdom is intersected and allow the
user hint to be processed.

Change-Id: Iba9cdd32470e29d35d3bb35012eb404b7c78d601
CRs-Fixed: 639538
Signed-off-by: Mihir Shete <smihir@codeaurora.org>
msm: kgsl: Fix spinlock recursion in destroy pagetable

pagetable list is protected by ptlock. Few functions
while iterating over a pagetable list takes same ptlock,
kgsl_destroy_pagetable() also need same lock. This will
cause spinlock recursion if kgsl_destroy_pagetable()
called while iterating over a list. Created two versions
of same function one is with lock and other is without
lock.

CRs-Fixed: 621172
Change-Id: I61440f99022fce8629a57bb5661e2eef9613187b
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
power: core: add set_voltage_limit API

Add the power_supply_set_voltage_limit API which
allows the POWER_SUPPLY_PROP_VOLTAGE_MAX property
to be configured for a given power supply.

CRs-Fixed: 637169
Change-Id: Ib525366ff742ad31d81ffee75920c19a6f9e8de8
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
power: qpnp-charger: take into account charge path priority

On the SMBB peripheral there is a possibility of having
both the USB and DC input being connected at the same time.
In this situation there is a requirement to be able to communicate
to userspace services that the higher priority input was
inserted so appropriate action can be taken.

This is achieved as follows:

1. If DC has the higher priority, the USB input
current limit will be reduced to 100 mA to avoid
charging from the USB path.

2. If USB has priority the DC input current
limit will be reduced to 100 mA to avoid charging
from the DC path.

3. Upon the removal of the priority charge path
the secondary charge path input current limit
will be restored to allow charging.

CRs-Fixed: 637169
Change-Id: Id5b61103b9f1d8f32ffd707d2512972c1a310108
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
mdss: dsi: Handle gpio configuration properly

Dsi related GPIOs are freed even when gpio request fails.
Fix this by removing the gpio_free() calls when the gpio request
fails. Add the gpio_request() and gpio_free()
calls to panel reset sequence so that gpio pins would
go to suspend state when not in use.

Change-Id: Id5ef45c5cc106d2a3ced3359739037f488e1919f
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: mdss: Avoid GPIO warnings during boot up

During continuous splash screen handoff, we see GPIO
warnings since we try to free the GPIOs without
requesting them before. This change takes care of avoiding
these warnings.

Change-Id: I574bcf0bd28e3c33dca618103cf0285675917189
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: mdss: fix clearing interrupts of DSI0 during isr for DSI1

Currently we need to handle DSI-1 interrupts only for panel/DCS
commands in the software during broadcast mode. When we handle
isr for DSI-1 interrupt, we clear all the interrupts for DSI-0
also. This might cause timeout issues for waits on DSI-0
interrupts like CMD_MDP_DONE since the interrupt is cleared
and we do not handle the interrupt for DSI-0. Fix this issue
by clearing only the DMA_DONE interrupt for DSI-0 during the
isr handling for DSI-1.

Change-Id: Id1735673f94066ff6c7250eaef7d9394b0525c2f
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: mdss: dsi: remove unused memory mapped resource

There are more than one instances where the DSI registers
are memory mapped in the driver whereas only one instance is
being used. Remove the reference to the unused resource.

Change-Id: Ia213e94b43bf58446eead47b18cadeb36d6795a7
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
ARM: dts: msm: Add batt-pres-status node to MSM QPNP-BMS devices

Add the bat_pres_status nodes to the qpnp-bms device node in order to
know whether the battery has been removed when the device is powered
off.

Change-Id: I2b71d9c8380a87b3f5b9871d5e42ba3e483cab05
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
msm: camera: Make ISP and camera kernel not interruptible

Change wait_event_interruptible_timeout to wait_completion_timeout
in camera kernel and change wait_completion_timeout_interruptible
to wait_event_timeout to avoid getting interrupts from kernel.

Change-Id: Ibf17d0f11ed705e68294257a90f7770676e63cbb
Signed-off-by: Yiduo Wang <yiduow@codeaurora.org>
msm: vidc: add input check for hfi q6 function

The input parameters may be null. This change adds input checks at
function q6_hfi_iface_eventq_read.

CRs-Fixed: 606516
Change-Id: I801a9d3249e9b97fa218fc29bc3a2a0e7a0d4d3f
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: Free OCMEM during power collapse

To disable OCMEM clock during power collapse, video driver
has to free up the allocated OCMEM. This memory will be
re-allocated before bringing venus core out of reset.

CRs-Fixed: 571083
Change-Id: I88f7e771b21046d9817feb17b06b3739f128c434
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Merge "Merge "msm: vidc: add kzalloc success check for new q6 HAL session""
crypto: msm: fix Off-by-one error in computation of length for strlcpy()

size + strlen("qcom-") is equal to the length of string not including the
null character. However,we are comparing it to the length of the buffer,
so we need to include the null character, and make a change to make sure
(size + strlen("qcom-")) is smaller than CRYPTO_MAX_ALG_NAME.

Change-Id: I882e2c3e761a4bd4344ce8820b26cf890f29bab3
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Merge "Merge "Merge "msm: vidc: add kzalloc success check for new q6 HAL session"""