coresight: support dumping tmc-etf and tmc-etr on kernel panic

Dump TMC ETF and TMC ETR registers on abort to allow post crash
parsing. Also ensure magic value is written for TMC ETF buffer
dump.

Change-Id: I8f21c456bcc79ed3e2831bd6bd1e6a6dbfdb93d0
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: abort coresight tracing on kernel panic

Calling coresight_abort() on kernel panic will stop/disable the
current sink and dump other necessary info to aid post crash
analysis.

Change-Id: I9d1b0ab2ba9d1a665727ea436df0c906fc80dab7
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: read tmc-etr reservation size from DT node

Remove using hardcoded value for the TMC ETR allocation size in
the TMC driver and instead get the size from the DT node. This
will ensure only one location (DT) controls the size of the
allocation.

Change-Id: I642d149e124c98470821ac4a37627747aecd2af7
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: return error if null or error is passed to coresight_register

Fail coresight_register if invalid (error or null) argument is
passed to avoid crashes.

Change-Id: I6c39ba2b81333f24480fdf5b348934651e095be5
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
msm: kgsl: Modify kgsl_mmu_pagefault ftrace event format

The kgsl_mmu_pagefault event is the only ftrace event with
it's format field being multiline. All other ftrace events
in the kernel have the format field in a single line.
Make the kgsl_mmu_pagefault event format consistent with
all other ftrace events.

Change-Id: I99ab00f6319ae13a6f99a31bc11511d05835b50c
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
coresight: read block size for tmc-etr to usb transfers from DT

Reading block size to use for tmc-etr to usb transfers from DT
allows the flexibility to configure a different block size per
target.

Change-Id: I5b52db194ebb6fab7d3a02e8fb031bd9936fddd8
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: remove cpu hotplug locking for smp_calls

smp_calls are cpu hotplug safe and so cpu hotplug locking isn't
required to safeguard them. Remove get_online_cpus() and
put_online_cpus() cpu hotplug locking calls that are currently
safeguarding smp_calls against cpu hoplugging.

Change-Id: I527403f4ffe088f3ee65b0b0899b398e1449ab48
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: hotplug enable/disable etm only for round robin access

Enable and disable ETM during hotplug operations only if ETM is
allowed round-robin access by the funnel when all the ETMs share
the same funnel priority.

For 8960, 8064, etc it is observed that sometimes a core's ETM is
starved by other core ETMs constantly producing data. This works
around an issue seen where setting the prog bit of a core's ETMCR
(i.e. ETMCR[10]) doesn't result in that core's ETMSR[1] getting
set thereby triggering the "timeout while setting prog bit"
warning. Subsequently performaing a manual ETB flush as part of
disabling ETB to retrieve the collected trace data also fails.

Change-Id: I6dd37979058644495d945e80e6a2de4696fc5a20
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: turn on etm during first cpu hotplug if enabled in boot

When ETM is enabled via kernel command line or config item but we
boot with maxcpus parameter value of less than number of present
cpus, cpus that are not included as part of maxcpus don't
get ETM enabled during kernel init since those cpus would not be
online.

This change ensures that for such cpus, first hotplug after the
respective cpu's ETM probe is done, enables ETM if it is enabled
via kernel command line or config item but hasn't already been
enabled.

Change-Id: Ie3613819896e781732b80d6be20f930b474418e8
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Revert "coresight: enable and disable STM during probe"

RPM is no longer mucking with STM during init so this workaround
is no longer required.

This reverts commit 946cb81bc1a6c9810bdf02559436b10ffe9055e5.

Change-Id: Iace5d9e98a95bc8fda4fd9d71c1d933b64d42aea
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: reset bam before making etr to usb connection

Since USB recently started resetting USB BAM before calling the
cable connect callback, it is recommended that QDSS BAM is reset
before TMC ETR to USB connection is made in the TMC driver.

Change-Id: I37639b9ada69c9d5077812463c05ce5e6176a181
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: implement new tmc etr to usb flush procedure

Recommended ETR to usb flush procedure changed. This implements
the new recommended procedure.

Conflicts:

	drivers/coresight/coresight-priv.h

CRs-Fixed: 443106
Change-Id: I18a6d457686905cbee75ce081ee4c6b4f6fdc62c
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: improve error handling for exported coresight apis

Enhance error handling to provide graceful behavior in the case
of incorrect topology representation by the user. This
specifically improves the behavior when some of the required
device DT nodes are missed or required driver(s) are not
compiled.

CRs-Fixed: 446155
Change-Id: I1bb72732a6f2d230775d8ce1ffec574adc3890d0
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
qseecom: Remove extra call to disable clock.

Currently the qseecom driver calls qsee_disable_clock_vote() in
the release function. This reduces the reference count during
disabling of the clock and results in turning off the bus clocks
inconsistently.
This change fixes the inconsistency.

Change-Id: I37d048928373f0539da9fee0910fc9a20239c307
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Revert "pm8xxx-adc: add the functions to set tuning parameters"

This reverts commit b19ebbc8e9ae70752e7e03b345d8a480b9ca8afa.

Change-Id: Idf994d04e69387a4e86c28e97e3ee5be80bcbd93
Signed-off-by: Uma Maheshwari Bhiram <ubhira@codeaurora.org>
power: pm8921-charger: don't apply kickstart unless it is 8921 pmic

The current driver applies the kickstart routine in probe regardless of
the pmic variant. The kickstart is only required for 8921 pmic.
Fix this.

Change-Id: Ibe48766663e60f0a4febef983d97bb6e5370ea1a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Uma Maheshwari Bhiram <ubhira@codeaurora.org>
msm_fb: hdmi: HDMI suspend resume event handling

This change makes sure that we do the proper HDMI ON settings at resume
and also send the events to user-space about current status of HPD after
resume.

CRs-Fixed: 422372
Change-Id: I8ca79fd07840b3227c9472588853b0ca2749760b
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
qup_i2c: Add runtime PM support to I2C QUP controller

Runtime PM is used to turn clocks on and off when the
controller is not in use. When the controller is used
for messaging, pm_runtime_get_sync is called before
sending the message. pm_runtime_mark_last_busy and
pm_runtime_put_autosuspend are called when message
is sent and/or response is received.

Change-Id: Icb1d6e6ad222663c9a3598da10bdc154845083a0
CRs-Fixed: 406910
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Signed-off-by: Manish Kumar <manishku@codeaurora.org>
qup_i2c: Manage gpio configuration from runtime pm.

Due to gpio_request and gpio_free calls are made from
multiple places in i2c driver code and can cause erroneous
condition where same gpios are assigned/freed multiple times.

Move the gpio reques/free calls under runtime pm to
manage better.

CRs-Fixed: 432971
Change-Id: Ic44202e0743fa56806a0612243d3b800bad1433f
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Signed-off-by: Manish Kumar <manishku@codeaurora.org>
msm: wfd: Amend the log priority of debug message

This change disables the excess kernel logs in wfd.

Change-Id: I66eb92f8997523d71557e3e22cc330bc7ad0b1df
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>