Perf: Dont reset PMU's if perf is not active

Perf would save and restore counters after resetting the PMU when
the CPU's came out of power collapse even if a perf session wasn't
active. Check if perf was running before going into power collapse
and only then reset PMU's while coming out.

This way PMU's can be accessed externally via the RPM or T32 without
perf intruding in counter output.

Change-Id: I33ac11b2a5cae21456341fde015aabe5b4bb8f52
Signed-off-by: Ashwin Chaugule <ashwinc@codeaurora.org>
net: usb: Add debug support to the driver

Add debugfs file to rmnet usb data  driver to dynamically
display driver statistics

Change-Id: I9a20df04414002e4e44529fff321ce39ae1a2be1
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
gpu: ion: Fix fragmentation debug message cond.

If an ion allocation fails because of memory fragmentation a debug
message should be printed. However, the logic that decides whether
the debug message should be printed or not is incorrect causing
the debug message to not be printed when the amount of space
available in the heap is equal to the requested size.

Change-Id: Iaaf8cd6742aeffab7bcb4806e485326fb9690945
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Fix fragmentation message log condition

If an ion allocation fails because of memory fragmentation a debug
message should be printed. However, the logic that decides whether
the debug message should be printed or not is incorrect causing
the debug message to not be printed when it should.

Change-Id: I6537171db0a47ba072d182e9bb3125cac5513ff9
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: kgsl: Improve the notification timing of idle events

Use the ringbuffer read and write pointers to determine if the
GPU is almost done processing a command sequence.

Change-Id: I0d131a7df71aca02d644a5b95b99749ced2f0b0e
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
mtd: msmnand: Support for 2K page size devices with 128 spare bytes

This patch adds support for 2K pages sized devices which have 128 bytes
for spare data. The layout used is the same as that of 2K page sized
devices with 64 spare bytes so as to be compatible with current build
images with additional spare bytes information marked appropriately.

Change-Id: I1b3db3cc790f02dcf1c41be4c2c21add6e7f1b38
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
msm: kgsl: Properly assign the physical address

Correctly assign the physical address to be used as gpu address
when no MMU is used.

Change-Id: Ie824cadc7c8c85203f81c9c5961b6f8a5d1cd449
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: kgsl: Allocate setstate memory when no MMU is used

Setstate memory should be allocated even when no MMU is used
because it is used when submitting workaround commands.

Change-Id: Ia8217cec9507bff82680e737b4328c2611f5f917
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: kgsl: Call the function to setup global mappings

Call kgsl_setup_pt function to setup the gpuaddr mappings for
global allocations when no MMU is used

Change-Id: I062de3b52fd4d48717bd9d6b074deca9ffcb85de
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: clock-pll: Use a timeout when enabling voteable PLLs

Instead of waiting infinitely for a PLL to enable,
use a timeout mechanism that returns an error code
if that voteable PLL doesn't activate its output
in time.

This will especially help if PLLs are incorrectly
configured and cannot turn on during bootup. Rather
than the device hanging forever, the kernel log
will contain a WARN stack and the caller will
know that the PLL didn't enable.

Change-Id: I4eab4b72da7c28866f033b50121c8265c9d432ad
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
slimbus: Scheduling algorithm should ensure non-zero channel-offset

Messaging slots are at the beginning of a slimbus superframe.
A channel cannot start at offset 0 in the superframe to ensure
messaging space gets non-zero slots.
Make sure channel scheduling algorithm leaves some slots for message
space.

Change-Id: I25dd3703b1ae331f4b8017b9ca92410f5811088c
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
msm: audio: qdsp6v2: Fix noise in Tunnel mode Mp3/AAC audio playback

Modify the async_write API to send Encode bitstream buffer address
for non-tunnel mode with skipping meta data. And for tunnel mode
buffer address remains same as there is no meta data for
Tunnel mode and is sent to DSP without any change in this value.

Change-Id: Ie2ccd5a9ca2f72800afa11a818f65b90d374eb5b
Signed-off-by: Karthik Reddy Katta <akkatta@codeaurora.org>
nl80211: advertise device AP SME

Add the ability to advertise that the device contains the AP SME and
what features it can support.There are currently no features in the
bitmap -- probe response offload will be advertised by a few patches
Arik is working on now (who took over from Guy Eilam) and a device
with AP SME will typically implement and require response offload.

Change-Id: Ic8d75e4933d795d43a0c30df6ec187f4d0ab6d8c
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
nl80211: Add probe response offload attribute

Notify user-space about probe-response offloading support in the driver.
A wiphy flag is used to indicate support and a bitmap of protocols
determines which protocols are supported.

Change-Id: I13b16c71449ab61f4308b6caa1cca35529f905b4
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
spi_qsd:  Reset the FORCE_CS bit

This patch resets the FORCE_CS bit at the end of the last
SPI transfer. This prevents the chip select from remaining
asserted for the subsequent SPI transactions.

Change-Id: Ie35b6c20b836970933562a71ddc1744a075402c7
Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>
power: pm8921-charger: Bound lower AICL limit at 500 mA

AICL is only relevant for wall chargers for current
ratings above 500 mA. Once the minimum value is reached
stop decreasing the IUSB_MAX value to avoid a complete
charging stop by setting IUSB_MAX to 100 mA.

Change-Id: I9b100a5a06aa22552ba8251ce4137e69aea7d07c
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
vsprintf: Fix %ps on non symbols when using kallsyms

Using %ps in a printk format will sometimes fail silently and
print the empty string if the address passed in does not match a
symbol that kallsyms knows about. But using %pS will fall back to
printing the full address if kallsyms can't find the symbol. Make
%ps act the same as %pS by falling back to printing the address.

While we're here also make %ps print the module that a symbol
comes from so that it matches what %pS already does. Take this
simple function for example (in a module):

	static void test_printk(void)
	{
		int test;
		pr_info("with pS: %pS\n", &test);
		pr_info("with ps: %ps\n", &test);
	}

Before this patch:

 with pS: 0xdff7df44
 with ps:

After this patch:

 with pS: 0xdff7df44
 with ps: 0xdff7df44

Change-Id: Id03d74b079d40fe24b07a978909faedc741e281a
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
spinlock_debug: Print kallsyms name for lock

When a spinlock warning is printed we usually get

 BUG: spinlock bad magic on CPU#0, modprobe/111
  lock: 0xdff09f38, .magic: 00000000, .owner: /0, .owner_cpu: 0

but it's nicer to print the symbol for the lock if we have it so
that we can avoid 'grep dff09f38 /proc/kallsyms' to find out
which lock it was. Use kallsyms to print the symbol name so we
get something a bit easier to read

 BUG: spinlock bad magic on CPU#0, modprobe/112
  lock: test_lock, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0

Change-Id: I833d011da8362960e97c53ebd59236ac7eb147fd
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: copper: Rename SDCC device names to msm_sdcc.[slot] format

Rename SDCC device names to msm_sdcc.[slot] as opposed to
device tree address,sdcc format to be consistent with
non-device tree targets.  This allows compatibility with
existing userspace applications that require direct
access to specific SDCC slot in a target-independent
manner.

Change-Id: I6012e7a104d1ee3da88e4bca8fa83a60014dda38
Signed-off-by: David Ng <dave@codeaurora.org>
arm/dt: msmcopper: Change acpuclock node address to match convention

Unit addresses in node names should, by convention, not be prefixed
by '0x'. Fix this for acpuclock by replacing 'qcom,acpuclk@0xf9000000'
with  'qcom,acpuclk@f9000000'

Change-Id: I769abe1cbb0ca34537d6c94aa29ca5158b255b66
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>