tty: n_smux: After receiving OPEN_ACK flush tx_queue

If a local SMUX client re-opens the channel and tries to send data before
receiving the OPEN_ACK, the transaction will get stuck because the
channel local state is not OPENED.

Add the channel to ready list if tx_queue is not empty after receiving
the OPEN_ACK.

CRs-Fixed: 507379
Change-Id: I357b6edc340c404c890da0c415ed3aeba96dcfe8
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
msm_serial_hs: Fix the unbalanced clk_count

If clock vote is failed, clk_count is added. It may cause the unbalanced
clk_count. Also it's possible to be nagative clk_count on unvote. So do
not decrease the clk_count if it's already zero.

Change-Id: Ic63efd9447a18caaa8fabada4d4cae90558c8785
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm_serial_hs: check the returned value of clock vote

If voting clock is failed, we should not access the registers.
It may cause a crash to access the unclocked register.

Change-Id: Ifb75dd68696719905b373c4a276c4dc2d917f2fe
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm_serial_hs: vote for clocks in tty functions

to avoid accessing the unclocked registers.

Change-Id: I17af31b54e2c6288a5284b51670506c44a344fe8
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm_serial_hs: Fix race condition with BAM rx pipe

Crash observed due to the race condition with bam
rx pipe during sps_disconnect and sps_transfer_one
operations executed at the same time on two CPUs.

Because of this race condition rx bam descriptor
pointer becomes NULL and accessing of this pointer
leads to crash.

This patch waits for sps_transfer_one function to
complete, if it is in progress, before calling
sps_disconnect function from the set_termios.

https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/commit/drivers/tty/serial/msm_serial_hs.c?h=msm-3.10&id=478fe086cb075301da4488e3e9e02683b2409084

CRs-Fixed: 534029
Change-Id: I7581062a17a3dc7ede8eb58e4d25e3b517812ab2
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Patrick Tjin <pattjin@google.com>
thermal: qpnp-adc: add tm channel irq disable feature

The tm channel interrupt disable feature was not implemented.
So add this feature to qpnp_adc_tm_channel_configure().

Change-Id: I9b4b708fbaef5db0e5cfc3bf1eaaa400ac2585e5
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
msm: thermal: Refactor core control mitigation only for smp

Refactor core control mitigation only for smp target otherwise it
leads to compilation issue for non smp since cpu_up and cpu_down
functions are not defined.

Change-Id: I73d3792fd9c4ce6d16132b55eb2446dd4bcdfbce
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: thermal: Replace __cpuinit with __ref to support non smp

__cpuinit is causing issues on non smp targets and it also leads to
compilation issues if __cpuinit is completely removed on smp targets
as modpost will complain for calling removable sections from non
removable sections. Replace __cpuinit data with __ref which will
silence the modpost and works fine for non smp targets as well.

Change-Id: Ifa413f6708935b1dcae9438bf39a194372eb0c61
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
hwmon: qpnp-adc: Fix potential errors

There is a possibility of potential out of bound array
access errors and uninitialized variable access from code
inspection. Add additional checks in voltage ADC and
TSENS to check for such errors.

Change-Id: I1213cd76fb636aa457c88d3bdc3740b692f01cce
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
msm: thermal: add wakelock for prevent repeat suspend

when device enters suspend after heating,
device will wake up by low threshold. and send notify
to userspace. however, sometimes It enters into suspend
before setting new threshold value by userspace.
It may cause to repeat suspend/resume cycle.
So, add wakelock for preventing it.

Change-Id: I4a90a74eb0ef8514ec4ee6b3c7bb1cb58372c53a
Signed-off-by: darren.kang <darren.kang@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm: thermal: set the core_control_enabled after offline cores update

The variable for offline core is not yet updated in the initial state, but
msm_thermal try to control core at that time and may access the
offlined core(s). It would cause the watchdog bite due to this.

Change-Id: I6abd55b22f3e09ab44e8df0d6fbb8e82cd9e482c
Signed-off-by: Devin Kim <dojip.kim@lge.com>