OSDN Git Service

sagit-ice-cold/kernel_xiaomi_msm8998.git
8 years agomsm: ipa3: fix odu debugfs
Skylar Chang [Thu, 19 May 2016 20:41:35 +0000 (13:41 -0700)]
msm: ipa3: fix odu debugfs

Fix a bug in IPA ODU where debugfs directory was deleted after
creation.

CRs-Fixed: 1015545
Change-Id: I5aad7032f3f8048216a41765f1cf91fde98f6ade
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
8 years agomsm: ipa3: WA for incorrect state retention for GSI channel 20
Skylar Chang [Tue, 17 May 2016 22:27:19 +0000 (15:27 -0700)]
msm: ipa3: WA for incorrect state retention for GSI channel 20

This change in a software workaround for a hardware limitation
to not use GSI channel 20.

CRs-Fixed: 1005061
Change-Id: I4ed9f1c6ad089f80dcd19762fda151ce1572f471
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
8 years agoARM: dts: Add qrng driver support for msmcobalt
Zhen Kong [Tue, 24 May 2016 19:55:54 +0000 (12:55 -0700)]
ARM: dts: Add qrng driver support for msmcobalt

Add qrng driver support for msmcobalt. This enables qrng
to be used from hlos side.

Change-Id: I2c808713aaac42345b97665a8990f5bbb9b9145e
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
8 years agomsm: mdss: fix possible out-of-bounds and overflow issue in mdp debugfs
Veera Sundaram Sankaran [Wed, 16 Mar 2016 01:42:27 +0000 (18:42 -0700)]
msm: mdss: fix possible out-of-bounds and overflow issue in mdp debugfs

There are few cases where the count argument passed by the user
space is not validated, which can potentially lead to out of bounds
or overflow issues. In some cases, kernel might copy more data than
what is requested. Add necessary checks to avoid such cases.

Change-Id: Ifa42fbd475665a0ca581c907ce5432584ea0e7ed
[veeras@codeaurora.org: Resolve conflicts in mdss_debug.c]
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
8 years agonet: Warn for cloned packets in ingress path on SMP systems only
Subash Abhinov Kasiviswanathan [Fri, 22 Apr 2016 03:44:00 +0000 (21:44 -0600)]
net: Warn for cloned packets in ingress path on SMP systems only

GRO is currently enabled only on SMP systems so move the check for
cloned packets from commit b8a7d12f33ecba4 ("net: Warn for cloned
packets in ingress path") within CONFIG_RPS to prevent printing an
unnecessary warning on single core systems.

CRs-Fixed: 1006937
Change-Id: Ib8cb979136def6696861a7835bcde763dabe874f
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
8 years agoARM: dts: msm: Add nfc device to msmcobalt
Gaurav Singhal [Wed, 11 May 2016 14:00:38 +0000 (19:30 +0530)]
ARM: dts: msm: Add nfc device to msmcobalt

DT changes for nfc are required on msmcobalt describing
the GPIO behavior for the nfc controller chip.

Modified dtsi files for MTP and CDP device.

Change-Id: Id19733e6e075a427c4aa745b5bedc93f29a2dd4f
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
8 years agotrace: prevent NULL pointer dereference
Kishor PK [Fri, 29 Jan 2016 05:43:25 +0000 (11:13 +0530)]
trace: prevent NULL pointer dereference

Prevent unintended NULL pointer dereference in trace_event_perf.

Change-Id: I35151c460b4350ebd414b67c655684c2019f799f
Signed-off-by: Kishor PK <kpbhat@codeaurora.org>
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
8 years agomsm: kgsl: Avoid race condition in ioctl_syncsource_destroy
Divya Ponnusamy [Fri, 6 May 2016 19:24:37 +0000 (13:24 -0600)]
msm: kgsl: Avoid race condition in ioctl_syncsource_destroy

If the ioctl syncsource_destroy is accessed by parallel
threads, where the spinlock is acquired by threads after
getting syncsource, then the simultaneous processes try
to remove the already destroyed syncsource->refcount by
the first thread that acquires this spinlock. This leads
to race condition while removing syncsource->idr.

Avoid separate lock inside getting syncsource, instead
acquire spinlock before we get the syncsource in
destroy ioctl so that the threads access the spinlock
and operate on syncsource without use-after-free issue.

Change-Id: I6add3800c40cd09f6e6e0cf2720e69059bd83cbc
Signed-off-by: Divya Ponnusamy <pdivya@codeaurora.org>
8 years agomsm: kgsl: Correction of VBIF debug bus data in snapshot
Sunil Khatri [Thu, 14 Apr 2016 06:54:10 +0000 (12:24 +0530)]
msm: kgsl: Correction of VBIF debug bus data in snapshot

The debug bus information for VBIF block was not dumped
correctly for A5XX GPU during the snapshot dump.

Change-Id: I75089e210a6fc72683dcf98cdd4da9d6ab3e6fcf
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
8 years agoregulator: cpr3-regulator: support corner bands with no adjustments
Osvaldo Banuelos [Thu, 19 May 2016 17:47:48 +0000 (10:47 -0700)]
regulator: cpr3-regulator: support corner bands with no adjustments

Corner bands used on CPRh controllers may not necessarily define
per-online-core or per-temperature adjustments. Do not
attempt to program adjustments on corner bands whose sdelta
tables do not have either core-count or temperature based
adjustments defined.

Change-Id: I87d18778fef81671c5e7cc261cc70ce07c662933
CRs-Fixed: 1020505
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
8 years agoregulator: cpr3-regulator: support step quot for CPRh controllers
Osvaldo Banuelos [Thu, 19 May 2016 00:42:34 +0000 (17:42 -0700)]
regulator: cpr3-regulator: support step quot for CPRh controllers

The step quotient is used for target quotient adjustment when
sdelta table margins are used. Add support for fixed or dynamic
step quotient for CPRh controllers to allow per-core-count and
per temperature adjustments to work in conjunction with
closed-loop operation.

Change-Id: I6b9d663b44c96dafba26ad25bcfc4b61c8c86d56
CRs-Fixed: 1020505
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
8 years agosoc: qcom: print raw data for gladiator error registers
Runmin Wang [Mon, 23 May 2016 18:41:17 +0000 (11:41 -0700)]
soc: qcom: print raw data for gladiator error registers

Dump the value in gladiator error registers in raw format.

CRs-Fixed: 1019798
Change-Id: I7bccd68866457bb0635ae5166ec935f9e82ba760
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
8 years agoedac: cortex: Update the error strings to reflect Kryo2xx processor
Trilok Soni [Tue, 24 May 2016 20:55:43 +0000 (13:55 -0700)]
edac: cortex: Update the error strings to reflect Kryo2xx processor

Update the single and double bit error strings to reflect the Kryo2xx
silver and gold processors.

CRs-Fixed: 1020529
Change-Id: Ia4f54bfee8111f9f039f772a8bcc7c9a0400d5aa
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
8 years agoARM: dts: msm: add extra destination scaler properties for MSMcobalt
Naseer Ahmed [Tue, 8 Mar 2016 00:43:39 +0000 (16:43 -0800)]
ARM: dts: msm: add extra destination scaler properties for MSMcobalt

This change adds maximum input and output width for destination scaler.

CRs-Fixed: 988990
Change-Id: I9a4b9701e078fa39783f33f023eef2da75c1c162
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
8 years agomsm: mdss: Adding support for destination scaler
Naseer Ahmed [Tue, 5 Apr 2016 19:19:25 +0000 (15:19 -0400)]
msm: mdss: Adding support for destination scaler

Destination scaling is a new hardware feature in MSM mdss 3xx hw. When user
mode enabled the destination upscaling, framebuffer will get upscaled
and then transmitted to the primary panel.

CRs-Fixed: 988990
Change-Id: I19aa5983316bec4a87811c8aa8b54f770001c45f
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
8 years agoARM: dts: msm: Change csi clock voting from ispif node
Sagar Gore [Tue, 15 Dec 2015 18:14:07 +0000 (10:14 -0800)]
ARM: dts: msm: Change csi clock voting from ispif node

ISPIF hardware also needs csi clock along with vfe clock, but csi
hardware controls clock rates hence changed clock control type
so that ispif won't alter clock rate set by csi.

CRs-Fixed: 972998
Change-Id: I6a99fa6961e9205d7d9ccb470873c26adde8a91f
Signed-off-by: Sagar Gore <sgore@codeaurora.org>
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
8 years agothermal: qpnp-temp-alarm: update thermal callback parameters
David Collins [Mon, 23 May 2016 22:52:00 +0000 (15:52 -0700)]
thermal: qpnp-temp-alarm: update thermal callback parameters

Change the type of temperatures in the qpnp-temp-alarm driver
from unsigned long to int.  This ensures that the driver can be
compiled successfully when the following commit is in place
which changed temperatures in the  thermal framework from
unsigned long to int: commit 17e8351a7739 ("thermal: consistently
use int for temperatures").

Change-Id: I38c637936b398f2fb1665c8233ed5e49e83bf296
CRs-Fixed: 1019272
Signed-off-by: David Collins <collinsd@codeaurora.org>
8 years agodefconfig: msm: Remove incorrect ISPIF version
Shubhraprakash Das [Tue, 24 May 2016 23:25:39 +0000 (16:25 -0700)]
defconfig: msm: Remove incorrect ISPIF version

ISPIF version was incorrectly defined in the defconfig
used for 8996, remove it.

CRs-Fixed: 1020515
Change-Id: I2c1fb7dcc698142f9ce42f40164521b8a78268e1
Signed-off-by: Harshal Trivedi <htrivedi@codeaurora.org>
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
8 years agomsm: camera: isp: Fix warning and errors based on static analysis
Jing Zhou [Sat, 12 Mar 2016 01:30:50 +0000 (17:30 -0800)]
msm: camera: isp: Fix warning and errors based on static analysis

This change fixes the warning/errors from static analysis

CRs-fixed: 992942
Change-Id: Iaf90ab4c1d17f903d03458d76cab1b4c0a5c8836
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>
8 years agoarm64: defconfig: update config options for msm-perf_defconfig
Satya Durga Srinivasu Prabhala [Thu, 5 May 2016 23:55:58 +0000 (16:55 -0700)]
arm64: defconfig: update config options for msm-perf_defconfig

update config options for msm-perf_defconfig to match with options
on 3.18.

CRs-Fixed: 1013947
Change-Id: I7df9aeb55a95185077c679a217ed8772eb83c8b9
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
8 years agoarm64: defconfig: update config options for msmcortex-perf_defconfig
Satya Durga Srinivasu Prabhala [Wed, 11 May 2016 03:37:49 +0000 (20:37 -0700)]
arm64: defconfig: update config options for msmcortex-perf_defconfig

update config options for msmcortex-perf_defconfig with required
options.

CRs-Fixed: 1013948
Change-Id: If024f55095a951329976b6c2736ad5760eae1f4f
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
8 years agousb: pd: Add support to notify plug orientation via extcon
Hemant Kumar [Thu, 12 May 2016 23:07:40 +0000 (16:07 -0700)]
usb: pd: Add support to notify plug orientation via extcon

Policy engine needs to provide the plug orientation upon
type-c cable plug in. qmp phy driver needs to program phy
lane based upon this information.

Change-Id: Idd236136c9f0a9163b4ae7a8405c412f1d69ca9e
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agousb: phy: qmp: Configure phy lane based on plug orientation
Hemant Kumar [Thu, 12 May 2016 21:09:10 +0000 (14:09 -0700)]
usb: phy: qmp: Configure phy lane based on plug orientation

In order to support super speed mode using type-c cable, phy
driver needs to programe the phy with appropriate lane based
upon plug orientation.

Change-Id: I893c0b729015cd22791d168453309168246961e2
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agousb: dwc3: Add support handle type-c plug orientation
Hemant Kumar [Thu, 12 May 2016 20:57:03 +0000 (13:57 -0700)]
usb: dwc3: Add support handle type-c plug orientation

Register callbacks for plug orientations in order to
cache the current plug orientation reported by extcon.
This allows super speed phy driver to configure the
appropriate lane upon phy initialization.

Change-Id: I906005680b4cc90cc38dc3d403beebf7aa515ad7
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agoqcom-charger: qpnp-smb2: disable Type-C factory mode
Nicholas Troast [Fri, 20 May 2016 23:15:36 +0000 (16:15 -0700)]
qcom-charger: qpnp-smb2: disable Type-C factory mode

Type-C factory mode is unreliable and causes the Type-C mode to be
incorrectly detected in some cases. Disable it.

CRs-Fixed: 1019313
Change-Id: I5f66be80899c33816c886df526db9e50d7e9aff9
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
8 years agomsm: vidc: Add SEI extradata
Vikash Garodia [Mon, 2 May 2016 20:53:47 +0000 (13:53 -0700)]
msm: vidc: Add SEI extradata

The change extend the support in video driver
to enable few SEI extradata. Also update the
extradata menu V4L2 control with all the
available list of extradata.

CRs-Fixed: 1007521
Change-Id: I6d060afb48aca34c2bb54221c5babc0ac55aff7c
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
8 years agomsm: ipa3: add ipa_mhi to ipa_clients
Amir Levy [Tue, 24 May 2016 17:19:07 +0000 (20:19 +0300)]
msm: ipa3: add ipa_mhi to ipa_clients

As part of of IPA driver refactoring a separation has been made
between IPA core driver and the IPA clients.
MHI specific code in ipa_mhi.c has been transferred to a new file
called ipa_mhi_client.c.
IPA clients drivers are the interface between IPA core driver
and external drivers. Specifically, ipa_mhi driver is the
interface between the MHI driver and IPA core.

CRs-fixed: 989505
Change-Id: Iebcde6d233ff8580aa83b1885f1e8a01644dd1f4
Signed-off-by: Amir Levy <alevy@codeaurora.org>
8 years agomsm: mdss: Defer wb probe until mdss probe done
Abhijit Kulkarni [Mon, 23 May 2016 17:54:56 +0000 (10:54 -0700)]
msm: mdss: Defer wb probe until mdss probe done

Defer wb driver probe until mdss probe is completed, this is
required for supporting bin parts where multimedia hw is not
functional.

CRs-Fixed: 993024
Change-Id: Ic21c25a33a8b2430903e9c1f3d339022551d81d6
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
8 years agomsm: kgsl: Create sysfs entry to control GPU NAP state
Oleg Perelet [Wed, 18 May 2016 22:33:02 +0000 (15:33 -0700)]
msm: kgsl: Create sysfs entry to control GPU NAP state

Create sysfs entry to have option to disable software clockgating
NAP state.

CRs-Fixed: 973565
Change-Id: I2376f10161040dbf426887ce146ac597f401153f
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
8 years agodefconfig: msmcortex: enable qcom hw crypto drivers
Zhen Kong [Mon, 23 May 2016 18:11:39 +0000 (11:11 -0700)]
defconfig: msmcortex: enable qcom hw crypto drivers

enable qcom hw crypto drivers for msmcortex

Change-Id: Ic2b623bf871bc3918d3d58f99966ac7f746d7b8a
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
8 years agocrypto: msm: Update Kconfig to enable hw crypto driver for msmcobalt
Zhen Kong [Mon, 23 May 2016 18:09:39 +0000 (11:09 -0700)]
crypto: msm: Update Kconfig to enable hw crypto driver for msmcobalt

Update Kconfig to enable qcom hw crypto driver for msmcobalt

Change-Id: Iab07f3dd933a9faf8a7ada737c9e9389d185d6e3
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
8 years agoUSB: dwc3: debugfs: Add boundary check in dwc3_store_ep_num()
Vijayavardhan Vennapusa [Thu, 5 May 2016 09:07:08 +0000 (14:37 +0530)]
USB: dwc3: debugfs: Add boundary check in dwc3_store_ep_num()

User can pass arguments as part of write to requests and endpoint number
will be calculated based on the arguments. There is a chance that driver
can access ep structue that is not allocated due to invalid arguments
passed by user. Hence fix the issue by having check and return error in
case of invalid arguments.

Change-Id: I060ea878b55ce0f9983b91c50e58718c8a2c2fa1
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
8 years agoicnss: Remove unused APIs
Prashanth Bhatta [Tue, 24 May 2016 00:43:46 +0000 (17:43 -0700)]
icnss: Remove unused APIs

Remove unused APIs icnss_register_ce_irq &
icnss_unregister_ce_irq. These APIs are divided into multiple APIs
to provide flexibility to WLAN driver.

Change-Id: Icd56b61a372cb18e6600617184d8b185b78ce99d
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
8 years agosoc: qcom: watchdog_v2: Support userspace watchdog
Patrick Daly [Sat, 9 Apr 2016 02:27:24 +0000 (19:27 -0700)]
soc: qcom: watchdog_v2: Support userspace watchdog

Provide a hw guarantee that a userspace watchdog process receives cpu time.
Move ping_other_cpus() prior to waiting for the userspace signal in order
to minimize the effect of a late userspace pet on the safety margin.  The
safety margin is the difference between the workqueue's timer interval and
the bite interval.

Change-Id: I715cf7ad7975c6e020458f623262dc02927795a7
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
8 years agoARM: dts: configure trigout function for gpio 58
Shashank Mittal [Tue, 17 May 2016 21:37:07 +0000 (14:37 -0700)]
ARM: dts: configure trigout function for gpio 58

GPIO 58 is connected to CTI2's trigout 4. Add node to configure this gpio
when trigout 4 of CTI2 is mapped on msmcobalt.

Change-Id: I064c208557bc7b74bcb342fea76df9c9e10c8405
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agoARM: dts: Add qcedev & qcrypto drivers support for msmcobalt
Zhen Kong [Sat, 21 May 2016 00:31:17 +0000 (17:31 -0700)]
ARM: dts: Add qcedev & qcrypto drivers support for msmcobalt

Add qcedev and qcrypto driver support for msmcobalt.
This enables crypto engine to be used from hlos side.

Change-Id: I5d2861bdb934ac0224fa73b59b350d0d360f5c95
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
8 years agoARM: dts: msm: add support for nt35597 DSC panels on msmcobalt
Aravind Venkateswaran [Mon, 9 May 2016 22:06:57 +0000 (15:06 -0700)]
ARM: dts: msm: add support for nt35597 DSC panels on msmcobalt

Add necessary GPIO and regulator bindings for nt35597 DSC (command
and video mode) panels on msmcobalt CDP. Add these panels to the
list of supported panels so that they can be selected at runtime
from kernel command line.

CRs-Fixed: 1019289
Change-Id: Ie3a2da3c306bc8a85aaf1495afb365c38cf805aa
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
8 years agoARM: dts: msm: add nt35597 dual dsi cmd mode panel for msmcobalt
Aravind Venkateswaran [Fri, 6 May 2016 00:33:50 +0000 (17:33 -0700)]
ARM: dts: msm: add nt35597 dual dsi cmd mode panel for msmcobalt

Add gpio, regulator and other required settings for nt35597 dual-dsi
command mode panel for msmcobalt CDP. Add this panel to the list of
supported panels for msmcobalt to allow selecting this panel at runtime
using kernel command line.

CRs-Fixed: 1019289
Change-Id: If5e6a6b0d7753e3fc83ed6df5d866a62eb5cd60b
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
8 years agoARM: dts: msm: Add extra clocks for ispif node for msmcobalt
Shubhraprakash Das [Thu, 21 Apr 2016 21:59:53 +0000 (14:59 -0700)]
ARM: dts: msm: Add extra clocks for ispif node for msmcobalt

Add extra clocks required for ispif node and fix the order of
clocks.

CRs-Fixed: 987962
Change-Id: Id0f46265b10fa06f71a9085aa302536c5f14d295
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
8 years agomsm: pcie: add support to get PCIe port PHY sequence from DT
Tony Truong [Mon, 23 May 2016 22:05:58 +0000 (15:05 -0700)]
msm: pcie: add support to get PCIe port PHY sequence from DT

PCIe PHY varies between each chipset. Thus, the port PHY init
sequence on each of these chipsets are also different. Therefore,
add the support to read PCIe port PHY init sequence from devicetree.

Change-Id: I92969b7b59a64018b80470566567887248ced2bd
Signed-off-by: Tony Truong <truong@codeaurora.org>
8 years agosoc: qcom: set default enable for MSM_JTAGV8
Shashank Mittal [Mon, 23 May 2016 16:57:12 +0000 (09:57 -0700)]
soc: qcom: set default enable for MSM_JTAGV8

Enable MSM_JTAGV8 config if CORESIGHT_SOURCE_ETM4X is selected.
This will make sure that ETM registers are properly saved and restored
across CPU power collapse.

Change-Id: Iafc718d5fe3ee392836035c7d301ad2ed6d5f148
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agousb: gadget: Iterate over all IN EPs for allocation of TX FIFOs
Devdutt Patnaik [Thu, 19 May 2016 21:22:37 +0000 (14:22 -0700)]
usb: gadget: Iterate over all IN EPs for allocation of TX FIFOs

GSI EPs are assigned to the last 2 IN EPs. While allocating
the TX FIFO sizes we need to iterate over all IN EPs to correctly
allocate larger TX FIFOs for GSI accelerated endpoints.
Update the logic from using min_t(int, dwc->num_in_eps,
cdev->config->num_ineps_used + 1) to just use dwc->num_in_eps.
The EPs that are not enabled will be given the default TX FIFO
size while the ones that are enabled are given TX FIFO sizes
based on the burst size configured for that EP.

Change-Id: Ie9a21544966fb54cf9920e9c719309cc66157846
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
8 years agoextcon: Add support for USB connector speed
Hemant Kumar [Thu, 19 May 2016 20:56:25 +0000 (13:56 -0700)]
extcon: Add support for USB connector speed

This allows extcon to notify the USB controller driver
to enumerate host/peripheral in high or super speed mode.

Change-Id: I425087a02b680a5a1bc0579fd4d1410eb92d8e4c
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
8 years agosoc: qcom: watchdog_v2: Change completion to wait_queue
Patrick Daly [Sat, 9 Apr 2016 01:38:39 +0000 (18:38 -0700)]
soc: qcom: watchdog_v2: Change completion to wait_queue

Prepare for future changes which will require waiting on several
conditions prior to petting the watchdog.

Change-Id: I1a62b6ec73e7cd581a535316029956ea7ce23ba0
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
8 years agomsm: mdss: Set dither matrix len to 0 for default configuration
Benet Clark [Tue, 3 May 2016 02:35:32 +0000 (19:35 -0700)]
msm: mdss: Set dither matrix len to 0 for default configuration

When default dither is configured at boot, the default dither matrix
should be used. In order to use the default dither matrix, the len
parameter should be set to 0.

CRs-Fixed: 1010839
Change-Id: I2ed58d3e61ca4c64cf72569541fc6ee7f6ba651f
Signed-off-by: Benet Clark <benetc@codeaurora.org>
8 years agomsm: mdss: dsi: add ulps support for DSI PHY v3
Aravind Venkateswaran [Fri, 13 May 2016 00:45:58 +0000 (17:45 -0700)]
msm: mdss: dsi: add ulps support for DSI PHY v3

Implement the recommended programming sequence for configuring the DSI
lanes to Ultra-Low Power State (ULPS) for the DSI PHY v3.

Change-Id: I5dc7d8ed4407df5baa94e069b00897086bd02ab8
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
8 years agoASoC: wcd_cpe_core: Connect to input AFE port during LSM start
Bhalchandra Gajare [Tue, 19 Apr 2016 02:14:12 +0000 (19:14 -0700)]
ASoC: wcd_cpe_core: Connect to input AFE port during LSM start

Currently the AFE input port is connected to LSM while sending operation
mode parameter to CPE. It is possible that in certain cases, the operation
mode does not need to be sent at all. In such case, the input port still
needs to be connected. Fix this by moving the connection to AFE input port
during LSM_START so everytime LSM is started, it is connected to the
correct AFE port.

CRs-fixed: 1012715
Change-Id: I6dbc344d5d7063c7cfd2fb29c2c39fdee1250bbf
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
8 years agoinput: qpnp-power-on: modify the bit range to store restart reason
Osvaldo Banuelos [Fri, 20 May 2016 20:44:17 +0000 (13:44 -0700)]
input: qpnp-power-on: modify the bit range to store restart reason

Use 7 bits in SOFT_RB_SPARE PON register to store device
restart reasons.

Change-Id: I136c0d3583cef15b3ba22fbf6b8acbe014f9e8ab
CRs-Fixed: 1019225
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
8 years agoarch: arm64: disable HW breakpoint
Shashank Mittal [Mon, 16 May 2016 16:15:32 +0000 (09:15 -0700)]
arch: arm64: disable HW breakpoint

HW breakpoint driver interferes with debug registers save and restore
code and causes loss of HW breakpoints across power collapse.

Disabling this driver to enable debug registers save and restore
functionality across power collapse.

Change-Id: Iff5ba04b2e494f7a5de00e4d05606878ee3d8148
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agocoresight: add stm logging to support optimization in trace printk
Aparna Das [Tue, 22 Oct 2013 01:33:52 +0000 (18:33 -0700)]
coresight: add stm logging to support optimization in trace printk

The function trace_printk() performs optimization by determining if
there are no format parameters in argument string and calls appropriate
apis to write to ftrace buffer. Add STM logging to support this
optimization in order to allow CoreSight STM tracing for optimized
trace_printk path.

Change-Id: I1a77291e77410c6ed99474335a6d25742c409e47
Signed-off-by: Aparna Das <adas@codeaurora.org>
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agocoresight: enable stm logging for trace events, marker and printk
Shashank Mittal [Fri, 20 May 2016 20:06:09 +0000 (13:06 -0700)]
coresight: enable stm logging for trace events, marker and printk

Dup ftrace event traffic and writes to trace_marker file from
userspace to STM. Also dup trace printk traffic to STM. This
allows Linux tracing and log data to be correlated with other
data transported over STM.

Change-Id: I4fcb42f2e97ab963fdc85853f4f3ea1f208bfc3c
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
[spjoshi@codeaurora.org: 3.18 code fixup]
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
[mittals@codeaurora.org: 4.4 code fixup]
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agocpuidle: lpm_levels: Remove duplicate cpuidle tracepoints
Archana Sathyakumar [Wed, 6 Apr 2016 15:04:02 +0000 (09:04 -0600)]
cpuidle: lpm_levels: Remove duplicate cpuidle tracepoints

Since the cpuidle driver considers the mode selected by qcom governor
for trace events now, remove duplicate traces that report the same
information.

CRs-fixed: 991557
Change-Id: I2a470fb906bb9747f0e1b2c08a231edecc184036
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
8 years agoclk: msm: mdss: fix DSI PLL programming for msmcobalt
Aravind Venkateswaran [Wed, 18 May 2016 22:18:34 +0000 (15:18 -0700)]
clk: msm: mdss: fix DSI PLL programming for msmcobalt

VCO configuration should be based on the requested vco
clock rate and should not factor in the bit clock source
divider. In addition, the bit clock source divider for
the slave controller should always be set to 1. This will
ensure that the PLL is locked at the correct rate.

CRs-Fixed: 1019289
Change-Id: Ie5c171e13dcccc711ba03acb38fcd7876e792cee
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
8 years agoARM: dts: add remote etm devices for msmcobalt
Shashank Mittal [Thu, 12 May 2016 20:29:03 +0000 (13:29 -0700)]
ARM: dts: add remote etm devices for msmcobalt

Add audio, modem and rpm etm devices for msmcobalt. These devices can be
used to configure traces on remote processors.

Change-Id: Idf381b86cd44679ea1f8b6fbfe85b2616232f533
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agojtagv8: add jtagv8 support snapshot
Shashank Mittal [Wed, 27 Apr 2016 22:21:47 +0000 (15:21 -0700)]
jtagv8: add jtagv8 support snapshot

This snapshot is taken as of msm-3.18 commit:
89be600 (Merge "msm: camera: Fix KW issues in sensor code")

Jtagv8 driver can be used to save and restore debug and ETM registers
across power collapse.

Change-Id: I1537c92ac86964fdbe9abb012f972d5f3b36047a
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agoARM: dts: add CSR device for msmcobalt
Shashank Mittal [Wed, 4 May 2016 18:38:19 +0000 (11:38 -0700)]
ARM: dts: add CSR device for msmcobalt

Add CSR device for msmcobalt target. CSR device can be used to configure
Coresight slave registers.

Change-Id: I4da057a32b57af6431ead37522f877b114188699
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
8 years agopwm: qpnp: Enable glitch removal selectively
Subbaraman Narayanamurthy [Thu, 5 May 2016 01:45:28 +0000 (18:45 -0700)]
pwm: qpnp: Enable glitch removal selectively

Currently, glitch removal is enabled by default when the PWM
channel is configured. However, that adds delay to the PWM
output which is undesirable for longer PWM period. Disable the
glitch removal when PWM is configured and enable it after the
PWM is enabled.

CRs-Fixed: 1009283
Change-Id: Ibf4abb99e5e3e7aa9a9212b57094876f6ec6e9f0
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
8 years agopwm: qpnp: configure PWM period during bootup
Subbaraman Narayanamurthy [Mon, 11 Apr 2016 19:35:24 +0000 (12:35 -0700)]
pwm: qpnp: configure PWM period during bootup

Currently, PWM period is configured only when the client request
to configure period explicitly. However, there are requirements
to get it configured during bootup based upon the device tree
configuration. Add support for it.

While at it, add some pr_debug statements to the driver so that
it can provide some useful log of PWM specific calculations
runtime.

CRs-Fixed: 984628
Change-Id: I50de4488c32ef78efec1587305c56ab06fb32fed
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
8 years agopwm: qpnp: support DTEST configuration for PWM subtype
Subbaraman Narayanamurthy [Fri, 11 Dec 2015 01:36:33 +0000 (17:36 -0800)]
pwm: qpnp: support DTEST configuration for PWM subtype

Currently, DTEST configuration is supported only based on the
DTEST line and output values for LPG subtype. Though this will
help configuring DTEST mode for PWM subtype, input validation
has to be fixed for supporting the latter properly. Add support
for that.

Also, rename the "lpg-dtest-line" device tree property to
"dtest-line" as this will apply for both LPG and PWM subtypes.

CRs-Fixed: 949595
Change-Id: I96bf477a14bb135cf9196532cf4bf39a45c9ff77
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
8 years agomsm: mdss: Fix elements ordering of all YUV interleaved formats
Ramkumar Radhakrishnan [Fri, 20 May 2016 03:10:42 +0000 (20:10 -0700)]
msm: mdss: Fix elements ordering of all YUV interleaved formats

Pack the elements of all YUV interleaved formats in the same order
in which the elements are stored in the memory.

CRs-Fixed: 1019201
Change-Id: I64472af6e9983929e0d3ea08601d17c7a2b7c4ef
Signed-off-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org>
8 years agomsm: mdss: Add remaining interleaved YUV format to definition table
Benet Clark [Wed, 11 May 2016 06:26:52 +0000 (23:26 -0700)]
msm: mdss: Add remaining interleaved YUV format to definition table

One remaining supported format for YUV interleaved forats table. Adding
format in this change.

CRs-Fixed: 978785
Change-Id: I025a59d92aca2585335768c94f7a188c339aa788
Signed-off-by: Benet Clark <benetc@codeaurora.org>
8 years agoclk: msm: clock-gpu-cobalt: Correct the CRC enable sequence
Deepak Katragadda [Thu, 19 May 2016 22:28:47 +0000 (15:28 -0700)]
clk: msm: clock-gpu-cobalt: Correct the CRC enable sequence

Correct the sequence to turn on the GPU_GX gdsc as part of
enabling the GFX CRC.

CRs-Fixed: 1018785
Change-Id: I64d0abe7091f81f85e83747f09ece4bc524a4057
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
8 years agoASoC: msm: qdsp6v2: Change audio drivers to use %pK
Ben Romberger [Thu, 19 May 2016 00:15:50 +0000 (17:15 -0700)]
ASoC: msm: qdsp6v2: Change audio drivers to use %pK

Change all qdsp6v2 audio driver to use %pK instead
of %p. %pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.

Change-Id: I7baa9f127266726fecf9238167a1e0128a258847
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
8 years agosoc: qcom: socinfo: Add soc ids for MSM8996pro and APQ8096pro
Sanrio Alvares [Thu, 14 Jan 2016 19:37:42 +0000 (11:37 -0800)]
soc: qcom: socinfo: Add soc ids for MSM8996pro and APQ8096pro

Adding new SOC IDs for MSM8996pro and APQ8096pro variants.

CRs-Fixed: 1019089
Change-Id: If6aaef3b04a9da15c7f8cfaf1308706b8a2fe793
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
8 years agoicnss: Provide test mode through debugfs
Prashanth Bhatta [Mon, 16 May 2016 23:46:02 +0000 (16:46 -0700)]
icnss: Provide test mode through debugfs

Provide a test mode mechanism through debugfs interface for WLAN
firmware CCPM module so that WLAN enable and disable can be
tested without loading WLAN functional driver.

Change-Id: I8d411e067690443eefea645f4ff8130cf786c32f
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
8 years agodiag: Fix to proper updation of buffering flag
Manoj Prabhu B [Tue, 17 May 2016 09:00:28 +0000 (14:30 +0530)]
diag: Fix to proper updation of buffering flag

This patch adresses the proper updation of
buffering flag with the check for streaming buffering
mode against the peripheral's buffering mode.

CRs-Fixed: 1017305
Change-Id: Idc4556e568a42aa2441295c9e3caa3f2c92c4cc6
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
8 years agodiag: Fix for possible dci error notification
Manoj Prabhu B [Wed, 4 May 2016 10:16:03 +0000 (15:46 +0530)]
diag: Fix for possible dci error notification

This patch provides the protection on dci session by
checking for the session pid and task pid to be same.

CRs-Fixed: 1008138
Change-Id: I7d78a13032365a42097ad71cfd0abab2792a1b98
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
8 years agomsm: ADSPRPC: Map pages with execute permissions
Sathish Ambley [Tue, 17 May 2016 05:32:01 +0000 (22:32 -0700)]
msm: ADSPRPC: Map pages with execute permissions

Allow for mappings to have execute permissions in Stage 2 SMMU
as dynamic shared object may get loaded and executed from these
pages on the remote processor.

Change-Id: I3d7fb2829defd8efc362253866587652f35e316b
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
8 years agomsm: ADSPRPC: Provide process information in context
Sathish Ambley [Mon, 16 May 2016 23:42:32 +0000 (16:42 -0700)]
msm: ADSPRPC: Provide process information in context

Provide process information as part of context being passed that
allows for messages to be queued appropriately on remote processor.

Change-Id: I93e3c6faa400121612d90f9be8fd5befe45fb39c
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
8 years agomsm: ADSPRPC: Provide SMMU information
Sathish Ambley [Sat, 14 May 2016 22:31:34 +0000 (15:31 -0700)]
msm: ADSPRPC: Provide SMMU information

Expose new IOCTL to provide SMMU information that allows for
userspace to determine the appropriate ION heap to be used.

Change-Id: Iead0966d76acb2d2bbc41fa9cd5d09a252a3429e
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
8 years agodiag: Fix for possible stale task entries
Manoj Prabhu B [Wed, 11 May 2016 03:55:56 +0000 (09:25 +0530)]
diag: Fix for possible stale task entries

The task entries were cleared while closing the
md session and hence are stale while notifying the client.
This patch provides the protection on md session and
also checks for the session pid and task pid being same.

CRs-Fixed: 1008137
Change-Id: I999db2865d10464c7f1ab4a5a940d23c725ac033
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
8 years agodiag: Fix for possible dci stale entries
Manoj Prabhu B [Wed, 18 May 2016 11:18:36 +0000 (16:48 +0530)]
diag: Fix for possible dci stale entries

This patch provides the protection to dci client
entries from corruption.

CRs-Fixed: 984942 992683
Change-Id: Ifcd9f14dc03d9e42a31b3e126839489881e98303
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
8 years agoARM: dts: msm: Enable the GCC clock driver on MSMCOBALT v2
Deepak Katragadda [Fri, 13 May 2016 20:37:46 +0000 (13:37 -0700)]
ARM: dts: msm: Enable the GCC clock driver on MSMCOBALT v2

Enable the linux clock driver support for peripheral
clocks on MSMCOBALT v2.

CRs-Fixed: 1015446
Change-Id: Ibf5a8d7b6bc484281f414dd8491845e509d80123
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
8 years agoclk: msm: clock: Support peripheral clocks on MSMCOBALT v2
Deepak Katragadda [Fri, 6 May 2016 21:43:50 +0000 (14:43 -0700)]
clk: msm: clock: Support peripheral clocks on MSMCOBALT v2

Add support for controlling the peripheral clocks on
MSMCOBALT v2.

CRs-Fixed: 1015446
Change-Id: If69f3752c4295f4cc49cf41854edc03aa90dbbc5
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
8 years agodefconfig: msmcortex: enable wil driver
Maya Erez [Mon, 11 Apr 2016 19:59:52 +0000 (22:59 +0300)]
defconfig: msmcortex: enable wil driver

Enable wil driver as module for msmcobalt.
Wil driver is needed for 11ad wireless card.

CRs-Fixed: 1001827
Change-Id: Ib2118f323b5dc1d64eaa5aa1f600e4725187f05b
Signed-off-by: Maya Erez <merez@codeaurora.org>
8 years agodefconfig: msmcortex: Enable watchdog bite on panic
Runmin Wang [Thu, 12 May 2016 00:31:05 +0000 (17:31 -0700)]
defconfig: msmcortex: Enable watchdog bite on panic

Enable QCOM_FORCE_WDOG_BITE_ON_PANIC flag.

CRs-Fixed: 1017697
Change-Id: I6597746b87c0b7545401a4d51e07d3c8dbfd5906
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
8 years agoclk: msm: clock-alpha-pll: Fix incorrect fabia PLL settings
Deepak Katragadda [Thu, 19 May 2016 18:59:33 +0000 (11:59 -0700)]
clk: msm: clock-alpha-pll: Fix incorrect fabia PLL settings

For the fabia PLL to be in STANDBY mode, the RESET_N bit should
be set so that the PLL comes out of reset. Else, the PLL is
at OFF state and changing it's frequencies would not cause the
ACK_LATCH to be set.

CRs-Fixed: 1018752
Change-Id: I30f1ee0f4fdb8d92a9f6e187c1d8b797a0bdc94d
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
8 years agomsm: camera: cpp: Support conditional reset of micro
Rajakumar Govindaram [Sat, 14 May 2016 00:35:06 +0000 (17:35 -0700)]
msm: camera: cpp: Support conditional reset of micro

The micro clock needs to be conditionally reset based on
target. This can help to avoid probe failures on targets
where it is not supported.

CRs-Fixed: 1017151
Change-Id: Idd7e7255ebc8a08f418289fa172c37f72a21ced0
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
8 years agomsm: defconfig: Enable camera
Seemanta Dutta [Fri, 13 May 2016 01:38:09 +0000 (18:38 -0700)]
msm: defconfig: Enable camera

Enable camera in the kernel by enabling the
camera specific CONFIG_* macros in the kernel defconfig.

Change-Id: I4f812f280688984bd21fc68ae4d18355c9b2aac8
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
8 years agomsm: defconfig: Enable CONFIG_QCOM_KGSL in msmcortex-perf_defconfig
Lokesh Batra [Wed, 11 May 2016 21:24:15 +0000 (14:24 -0700)]
msm: defconfig: Enable CONFIG_QCOM_KGSL in msmcortex-perf_defconfig

Enable CONFIG_QCOM_KGSL config in msmcortex-perf_defconfig file. This
will enable compiling KGSL for msmcortex target perf builds.

CRs-Fixed: 1018471
Change-Id: I41d6520eea1d4a5ef1ad002797cf2c8433078570
Signed-off-by: Lokesh Batra <lbatra@codeaurora.org>
8 years agomsm: camera: isp: For testgen disable camif on frame boundary
Shubhraprakash Das [Wed, 20 Apr 2016 22:41:22 +0000 (15:41 -0700)]
msm: camera: isp: For testgen disable camif on frame boundary

When testgen is used then we cannot gate the input testgen on a frame
boundary and then stop camif. In this case if camif is stopped
immediately then it causes hardware failures on next camif start.
To avoid these errors from hardware always stop camif on frame
boundary when testgen is used.

Change-Id: I4e8e58626e5e8bd8468f3d216eadb2b326a84f75
CRs-Fixed: 987962
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
8 years agomsm: camera: isp: Set init rate for mnoc_maxi_clk
Shubhraprakash Das [Thu, 21 Apr 2016 22:13:22 +0000 (15:13 -0700)]
msm: camera: isp: Set init rate for mnoc_maxi_clk

The mnoc_maxi_clk requires a rate to be set before voting, set
the initial rate for this clock.

CRs-Fixed: 987962
Change-Id: I6c4f8fd494b6206b0e1fae8ddfe9d7bc708723d2
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
8 years agoiommu/arm-smmu: Don't enable/disable clocks in inv_range_nosync
Mitchel Humpherys [Tue, 23 Feb 2016 21:35:08 +0000 (13:35 -0800)]
iommu/arm-smmu: Don't enable/disable clocks in inv_range_nosync

TLB invalidation is done during unmap with clocks already enabled, but
we still have calls to enable/disable clocks in
arm_smmu_tlb_inv_range_nosync.  Remove the extra calls.

CRs-Fixed: 997751
Change-Id: Ic5f890fda6b4fc8bb2dcd5e6ff49050d5a934c31
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/io-pgtable-fast: Prove correctness of TLB maintenance
Mitchel Humpherys [Mon, 21 Dec 2015 23:06:34 +0000 (15:06 -0800)]
iommu/io-pgtable-fast: Prove correctness of TLB maintenance

A common software error when it comes to page table code is missing TLB
maintenance.  Add some checks to the io-pgtable-fast code to detect when
an address that might be stale in the TLB is being re-used.  This can be
accomplished by writing a "stale TLB" flag value to the reserved bits of
the PTE during unmap and then removing the flag value when the TLBs are
invalidated (by sweeping the entire page table).  That way, whenever we
map we can know that there might be a stale TLB in the location being
mapped into if it contains the "stale TLB" flag value.

CRs-Fixed: 997751
Change-Id: Icf9c1e41977cb71e8b137190adb3b4a201c339da
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/iommu-debug: Add debugfs file to enable config clocks
Mitchel Humpherys [Tue, 2 Feb 2016 00:53:39 +0000 (16:53 -0800)]
iommu/iommu-debug: Add debugfs file to enable config clocks

It's fairly common while debugging to need to enable the config clocks
for an SMMU so that you can poke around at the registers.  Add a debugfs
file to do this.

CRs-Fixed: 997751
Change-Id: I31b90d64c2facb0a681f9da586e2c90803776819
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/iommu-debug: Add functional test for ARM DMA IOMMU mapper
Mitchel Humpherys [Wed, 16 Dec 2015 02:45:57 +0000 (18:45 -0800)]
iommu/iommu-debug: Add functional test for ARM DMA IOMMU mapper

The vanilla ARM DMA IOMMU mapper is used by many clients in our system,
but we have no functional test coverage of it.  Add some functional
testing for it by leveraging the tests that were recently added for the
Fast DMA mapper.  Since the Fast mapper and the ARM mapper are both DMA
API implementations we can share most of the code.

CRs-Fixed: 997751
Change-Id: I58734a82f4dc3e4658ab7995b6682205097da991
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/iommu-debug: Add functional tests for fast mapper
Mitchel Humpherys [Fri, 11 Dec 2015 23:22:15 +0000 (15:22 -0800)]
iommu/iommu-debug: Add functional tests for fast mapper

Functional tests are good.  Add some for the fast DMA mapper.

CRs-Fixed: 997751
Change-Id: Iefb80124c335d65ea5bd8a15406c685125030003
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/iommu-debug: Add file for profiling the fast DMA APIs
Mitchel Humpherys [Thu, 8 Oct 2015 22:08:01 +0000 (15:08 -0700)]
iommu/iommu-debug: Add file for profiling the fast DMA APIs

The fast DMA API implementation that was recently needs to be profiled.
Add a new debugfs file (similar to the original "profiling" file) to do
this.

CRs-Fixed: 997751
Change-Id: I1236d9b6aaeab9d34b39e7f5d7b285691d1779da
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu: Add DMA mapper for io-pgtable-fast
Mitchel Humpherys [Thu, 8 Oct 2015 22:03:09 +0000 (15:03 -0700)]
iommu: Add DMA mapper for io-pgtable-fast

io-pgtable-fast does some underhanded tricks to achieve performance.
One of those tricks is that it expects clients to call its map function
directly, rather than going through the IOMMU framework.  Add a DMA API
implementation that goes through io-pgtable-fast.

CRs-Fixed: 997751
Change-Id: Iebcafeb630d9023f666078604898069e9f26dfdd
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/arm-smmu: Implement DOMAIN_ATTR_PGTBL_INFO
Mitchel Humpherys [Fri, 12 Feb 2016 22:18:02 +0000 (14:18 -0800)]
iommu/arm-smmu: Implement DOMAIN_ATTR_PGTBL_INFO

The DOMAIN_ATTR_PGTBL_INFO attribute will be useful in implementing DMA
APIs that can leverage the fast page table mapping routines.  Implement
it.

CRs-Fixed: 997751
Change-Id: Id3acec0089b126e7d6ad44d8d322bf473614f716
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu: Add domain attribute for getting page table info
Mitchel Humpherys [Fri, 12 Feb 2016 22:10:31 +0000 (14:10 -0800)]
iommu: Add domain attribute for getting page table info

For certain DMA API implementations, the overhead of going through the
IOMMU framework is too much.  Such an implementation might want to
perform some rudimentary page table management using bits of information
from the underlying page tables.  Add a domain attribute and structure
for querying this type of information.  For now, the only information
supported is the kernel virtual address of the PMDs (assumed to be
virtually contiguous).

CRs-Fixed: 997751
Change-Id: I29d31e9649c24d30a5a7ffaa4b238a0203846594
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/arm-smmu: Implement {enable,disable}_config_clocks
Mitchel Humpherys [Tue, 15 Dec 2015 00:12:00 +0000 (16:12 -0800)]
iommu/arm-smmu: Implement {enable,disable}_config_clocks

Some of our users need to be able to call
iommu_{enable,disable}_config_clocks on domains for SMMUs that we
control.  Implement them.

CRs-Fixed: 997751
Change-Id: Idc3692679409093faf8f458d53326e669d7f6479
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu: Add {enable,disable}_config_clocks ops
Mitchel Humpherys [Tue, 15 Dec 2015 00:04:46 +0000 (16:04 -0800)]
iommu: Add {enable,disable}_config_clocks ops

There are certain use cases where it might be necessary to leave the
IOMMU's configuration clocks on.  This might happen in places where an
IOMMU's clocks might not be known.  A good example of this would be a
test library that needs to be able to do TLB invalidation from atomic
context.  It would need to enable clocks up front (outside of atomic
context) and leave them on for the duration of the test.

Add some ops for enabling and disabling configuration clocks.

CRs-Fixed: 997751
Change-Id: I95056952f60494fe5745f2183f9af8aab3a40315
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/arm-smmu: Implement the .tlbi_domain op
Mitchel Humpherys [Thu, 3 Dec 2015 19:20:03 +0000 (11:20 -0800)]
iommu/arm-smmu: Implement the .tlbi_domain op

The upcoming "fast" DMA mapper will need to take control of TLB
invalidation.  Doing so allows us to perform fewer TLB invalidation
operations since the DMA mapper layer has more knowledge about when
"stale" TLB entries might actually become a problem, so it can do TLB
invalidation much less frequently.  Implement the tlbi_domain op for
this purpose.

CRs-Fixed: 997751
Change-Id: Iba9f499dba89db91c1150947b9599d85ade65b0e
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu: Add tlbi_domain op
Mitchel Humpherys [Thu, 3 Dec 2015 19:17:23 +0000 (11:17 -0800)]
iommu: Add tlbi_domain op

Some higher-level DMA mappers might be able to squeeze out more
performance if TLB invalidation can be delegated to them, since they
might have more knowledge about when a stale TLB is problem than the
IOMMU driver.  Add a callback for this purpose that can be implemented
by individual IOMMU drivers.

CRs-Fixed: 997751
Change-Id: If817f5514fdd5d24b9c592440760b81b88ec71a8
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/iommu-debug: Add file for profiling fast mapper
Mitchel Humpherys [Mon, 5 Oct 2015 21:44:58 +0000 (14:44 -0700)]
iommu/iommu-debug: Add file for profiling fast mapper

We'd like to understand the performance of the fast page table mapper,
which only supports 4K page sizes.  Add a debugfs file to profile the
new mapper.

CRs-Fixed: 997751
Change-Id: I5adc3c3ecd432552386b600b9e66e3db42e73138
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/arm-smmu: Wire up io-pgtable-fast for domains that request it
Mitchel Humpherys [Wed, 7 Oct 2015 21:03:50 +0000 (14:03 -0700)]
iommu/arm-smmu: Wire up io-pgtable-fast for domains that request it

An io-pgtable implementation for fast 4K mappings was recently added,
and we've now implemented all of the domain attributes necessary to use
it.  Wire it up.

CRs-Fixed: 997751
Change-Id: I9ddd2dd2cad91ac3d3ccce7c0cd0abb37cd57075
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu: Add DOMAIN_ATTR_FAST for requesting a fast domain
Mitchel Humpherys [Fri, 12 Feb 2016 21:53:20 +0000 (13:53 -0800)]
iommu: Add DOMAIN_ATTR_FAST for requesting a fast domain

Some IOMMU drivers offer "fast" page table management routines for
special cases.  There is often a trade-off with memory, etc. with these
so make their usage explicit with a domain attribute.

CRs-Fixed: 997751
Change-Id: Ia9f8ad6d924b294b6758970da2e9767f183b5649
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agodefconfig: msm: Enable the "fast" IOMMU page table mapper
Mitchel Humpherys [Wed, 30 Sep 2015 22:24:32 +0000 (15:24 -0700)]
defconfig: msm: Enable the "fast" IOMMU page table mapper

It's fast for use cases that require super fast IOMMU mappings (in
exchange for memory).  Enable it.

CRs-Fixed: 997751
Change-Id: I016937309ac8e16775d13e63b630bb98469c9fca
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
8 years agoiommu/io-pgtable: Add fast page table mapper for ARMv8L
Mitchel Humpherys [Wed, 30 Sep 2015 21:23:58 +0000 (14:23 -0700)]
iommu/io-pgtable: Add fast page table mapper for ARMv8L

Certain use cases require performance that can't be achieved with the
general-purpose SMMU page table code.  By limiting ourselves to 4K page
mappings (no block mappings) and pre-populating the first and second
levels of the page tables up front, we can eliminate a lot of the work
needed for page table mapping and unmapping.

Add a performance-tuned io-pgtable implementation for ARMv8L page tables
that only supports 4K page mappings.  Any size can be mapped, but only
4K page mappings will be installed in the page tables.

CRs-Fixed: 997751
Change-Id: I5861270709675016988052360d196e0a16a0d103
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>