msm: rpc: Reorganize the usage of spinlocks in RPC Router reader thread

A race condition exists between a driver closing an RPC endpoint and
RPC Router routing an incoming RPC message to that endpoint. So hold
the appropriate locks to avoid both the events happening simultaneously.

CRs-Fixed: 301630

Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
(cherry picked from commit 6dc318126ebced25742068bc90151b6b63f7851e)

Change-Id: I2d8b1f45b6ac6804a1e06d2d9e0da47f2ec81c64
Signed-off-by: Raj Kushwaha <rajk@codeaurora.org>
msm: rpc: Reset RPC endpoint's reply bucket count during modem reset

Every RPC endpoint maintains a reference counter to represent the
number of entries consumed from the reply bucket. During modem reset
this counter is not reset and after few modem resets this counter reaches
the maximum count. Hence the RPC framework stops sending out the replies.

CRs-Fixed: 297292
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
(cherry picked from commit 9231c2d6892b6e9c25df6b3f64fd1cd3cfc1e8f7)

Change-Id: I569f83fd2b7f84b7dc9cbd36aa8e0ca44fd9d5e8
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: rpc: Reader thread to allocate memory without holding a spinlock

RPC Router reader thread is allocating memory with GFP_KERNEL mask while
holding a spinlock. This is causing kernel BUG.

CRs-Fixed: 305570

Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
(cherry picked from commit 77715d195fe8c41d33198e8dbb6fc026472a9551)

Change-Id: I3853cb681de9f27b2dc8ab7f8943b2de14876d53
Signed-off-by: Raj Kushwaha <rajk@codeaurora.org>
msm: sdio: increase sdio al block size to 256

This will improve SDIO throughput in ~10Mbps

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
(cherry picked from commit 7e43c4319e4c1592ef619cb386b40db101565010)

Change-Id: I487a8f8a899a55b63cc57cb9d0154ee9b0cb7504
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: pmem: Squashed update to version from msm 2.6.35 kernel

Conflicts:

	drivers/misc/pmem.c
msm: smd: Add smd_tiocmset api without spinlocks

tiocmset can be called from client drivers in smd callbacks which
could result in dead-lock as most of the call-backs holds spinlock
which is used by tiocmset. Add tiocmset call which does not use
spinlocks so that it can be used from smd callbacks.

Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
(cherry picked from commit dbfcabe35ccb417804242839ed5fdc18a24514ea)

Change-Id: I2942e24845d940055d189eedb593f918a9ac2c8c
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: rpc: Update RPC client's cb_list_lock to use spinlocks

RPC client's callback function list is sometimes accessed from
atomic context. Hence use spinlocks to get exclusive access to the
list rather than mutex lock.

Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
(cherry picked from commit 8b1003105e9df8d296c0b2a1b0c1cbf5e9ae2df1)

Change-Id: I201103b4da453669f2c3e1b9399d782409cbc481
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
msm: smd: Prevent sending interrupt if port is closed

If a client is in the middle of a write and the SMD
port is closed, reset the data-written flag to prevent
sending an interrupt to the remote processor.  This interrupt
is harmless and should be ignored by the remote processor
but in some architectures, this interrupt can cause
problems with power collapse resulting in a bus lock.

CRs-Fixed: 334822
Change-Id: Iab738b06af53a538cbf2956807baea2839e05355
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
msm: smd_pkt: Fix smd_pkt_open()

It should not use hardcoded values.

Change-Id: I48abe78db2e1a32dde70623d0149d01fc430a93e
Acked-by: Kaushik Sikdar <ksikdar@qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
arm: mm: Exclude additional mem_map entries from free

A previous patch addressed the issue of move_freepages_block()
trampling on erronously freed mem_map entries for the bank end
pfn. We also need to restrict the start pfn in a
complementary manner.

Also make macro usage consistent by adopting the use of
round_down and round_up.

Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
(cherry picked from commit 3a99a03af19781dcf1074e70461505e2d773bba1)

Change-Id: Iae5ef3c745d46fcc92766f05ce2c1ca7e27abe7c
Signed-off-by: Swetha Basineni <sbasin@codeaurora.org>