msm: kgsl: Fix range checking for profile wrapping

There is a chance that the profile code will not wrap correctly.
This can cause the in stream profiling to cause buffer pre-run
or undershoot (accessing data before the buffer). Fix logic to
cause the correct wrapping.

Change-Id: I9aa68228ff5be1bd26ee1cf1a486859346a8027f
CRs-Fixed: 585754
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
msm: kgsl: Don't open kgsl device in erroneous case

If kgsl_get_process_private() returns NULL, it goes to
err_stop with result = -ENOMEM. If open_count is 0,
adreno_stop() overwrites the result variable with 0.
This leads to kgsl_open() to be successful while it
shouldn't.

Change-Id: Ic12d92a099280e4d958fa192fa5128211120d361
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
ARM: dts: msm: Allow L2 to be in GDHS during Standalone PC for msm8974

Add a new low power level that puts L2 in GDHS mode during standalone
PC. This low power mode will give additional savings by putting L2 into
GDHS mode while the core does power collapse.

This can only be done in single core cases, the pm driver code takes
care of ensuring that L2 can be put into GDHS only when one core is online.

Change-Id: I71d237283820974c4d509606a01b67f5791d2fb9
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
arm: dts: msm8974: Enable L2 power collapse during sleep

The L2 power collapse was removed to address DDR corruption associated
with voltage droop on the MX rail. Power collapsing the MX rail doesn't
cause the Voltage to droop on the MX rail

Change-Id: Ia4ce5d374ed1197b924ae9f8fb4a5a325f81dbba
CRs-fixed: 497712
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
arm/dt: 8974: Add enabled interrupts to bypass list

The following interrupts were added to Bypass list
to enable XO shutdown for smart panel during static
display

hwirq: 56 ->  modem_wdog
hwirq: 70 ->  msm_iommu_pmon_nonsecure_irq
hwirq: 97 ->  msm_iommu_nonsecure_irq
hwirq: 105 -> msm_iommu_pmon_nonsecure_irq
hwirq: 181 -> wcnss_wdog
hwirq: 211 -> dwc3_otg

Signed-off-by: Badhri Jagan Sridharan <badhris@codeaurora.org>
Change-Id: I554e8090bcc8168f0f7e60f6962e55871ea44b1b
ARM: dts:  msm: Add BAM interrupt to bypass list

Since BAM irq originates at the Modem, marking this interrupt as a
bypass as modem is halted when the system enters a deep sleep mode.

Change-Id: I3b06e504f3aea8f567a3a4f910719c3165fd5f03
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
msm_sdcc: Fix building without BROADCOM_WIFI_RESERVED_MEM

There's no DMA QoS support when a static buffer isn't in use

Change-Id: If34a11c1f4362d08e3198558f7e0830f47447b5d