Commit Graph

233 Commits

Author SHA1 Message Date
Nathan Chancellor 597e0c0a08 Android 8.1.0 Release 0.81 (OPM6.171019.030.E1,bullhead)
-----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCWzqrkwAKCRDorT+BmrEO
 eEXHAJ9/sH2vpR/1jb8Wipa4cRmW88yxpwCeJ0Z8mWzMyXnwHBUDn9tTe0Kneok=
 =lGEU
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEJDfLduVEy2qz2d/TmXOSYMtstxYFAls6tUQACgkQmXOSYMts
 txYAtQ/+JJqWFaVB/RA2guSB+6y2I8ReiR7LpzqeC34ksRjFKjyfrtXzEsJmJrIM
 By7U5b62k0FxwpcuSMYfo4srAJo0t/1b8P84iogvHYb1jOkXP9IIbtYmaoknhorS
 zSsyEV8oW2rXadFHjsL95zxU2N+aqNC9qAUFLKOy7bwbiZsAlnHLU9i6zcLn9TLI
 0Ip0MIWXfmUycFrL6DHz27S+DE9ph8k5KFJuhUb7ZRJthNCcitwLykOTxX4Dy4TK
 x7wY0SvVBTUy0jM8XY1K1nlWxGCCLdbjVREMPjqvnqWSjKmzwZR0KAjXXA2/oH6p
 5g2mmNTiaNYcwnmKwkkRmEKWWNJGA5dw8ZwZuayLPBCfHDYd8oEntOVq3gGjRP27
 EBNcc/8tuoU/JHsDoADo526AnJIwENfyH/hvxh/6Z1LHWEG+EJlPnCRgAcQbnNjS
 5mLkF+PvY7Q8P83zjWVikWszi/CQLsunRl5a1E+KB6JlJwBS3/PqTLymg/1/qjNK
 MmR7k/0LsZ/YEXaS7EldWZxJFMYo9qRIoTsGngE7rpTWOhSaOs/8Z+qBSRH6Kcfr
 4SW3vLJat7b8vlkaxS0sflYgOPRKVMYsMAtC88ds6bXOcXEFiX8hS03BQL9i2R4e
 EbCgXVPPl7HLDDSqMloAL7i88QYifYlb7jsnQbAvTMENy0NUuBk=
 =xjfK
 -----END PGP SIGNATURE-----

Merge tag 'android-8.1.0_r0.81' into android-msm-bullhead-3.10

Android 8.1.0 Release 0.81 (OPM6.171019.030.E1,bullhead)

* tag 'android-8.1.0_r0.81':
  qcacld-2.0: add validation check for APFIND event
  ASoC: msm: qdsp6v2: check for buffer size before read
  qcacld-2.0: Fix integer underflow and buffer over-read in fwlog
  qcacld-2.0: Add sanity check for wmi TLV length
  msm: mdss: fix race condition between rotator api's
  BACKPORT: futex: Prevent overflow by strengthen input validation
  UPSTREAM: scsi: sg: don't return bogus Sg_requests
  BACKPORT: futex: Remove requirement for lock_page() in get_futex_key()
  drivers: cpuidle: lpm-levels: Fix untrusted pointer dereference.
  BACKPORT: msm: adsprpc: Use unsigned integer for length values
  udp: consistently apply ufo or fragmentation
  msm: sensor: ois: add conditional check for ioctl
  soc: q6dspv2: apr: fix client registration refcount

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-07-02 16:20:07 -07:00
Mahesh Sivasubramanian aeb0104f34 drivers: cpuidle: lpm-levels: Fix untrusted pointer dereference.
The list_for_each macro was not used correctly, where the intermediate
variable would be LIST_POISON, resulting in a untrusted pointer
dereference. Switch to using list_for_each_entry_safe to for safe
removal of a list entry.

Bug: 72956998
Change-Id: I0e0fd5dd9f251b5093d6e9d6335387512ec59249
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
2018-05-10 21:47:02 +00:00
Nathan Chancellor f55d0eed2e This is the 3.10.85 stable release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJVv5fSAAoJEDjbvchgkmk+cCEP/08rxgFQc0/T4NHeojs8WJHm
 lJKa+EqW9zEPiuCQ9b+MpXHHnvvwCLQ/aSW0f4kg6795jXW9xmea0iUDiGHV8sck
 3M6Mg4rnrpOxfDUQYf6n1ajOGCtyCunjbekSD+qt5+gyjmj7Zn1xU+1iuyvaFouY
 mnEH5VdBpOLkYLLH5mz996yFi95cSUrXUDNWEybUG0ce+T5rAPmwrzoqs6VAQ+8f
 sPHYtWCY1Rdnww203L02Ske57GXk/yikEbEqTruVjg4i43XANfMUOYPZ6gfQV12J
 Rzfb54XhXkMfgH5BYirKcAy3h/CMqw0AlxRWazyrJGshSIlw4Ftznrr1q9ba2720
 4haXDmc5apJ0FG1Xl63+zhpQvJgKPAJ/BrFUqM7nQC4+IkcWNGfslygJCUcnoizT
 SlmohUSYyeFZtqKtr5uO7FIVP6M73g7ZBDGOgWjWXTuFlqVCEM+14Tn/2acIBuBU
 R5/c+ZNEjm/XQXHdHJIPNztG+hDxhHTrCtG8MwVabC+/2IjMyzJZFctEErKC7jI4
 +n4TG2SfU06ypVHFRmhCc7xRrC29W0GYQ2nMgWVslL2E2cT3ttZeQA0osOT7vvtO
 CgNZFub/bWXvhh9yeKeWr2tRijCcnjH4tK0Tf9SuY+JYz3lIkQb9MdaScuZKxl2g
 mwDqJkXxXNwaNI6KeL09
 =OvlT
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEJDfLduVEy2qz2d/TmXOSYMtstxYFAlpqbtgACgkQmXOSYMts
 txZsgQ/6AsdHDYDrjM4MPw0EGej1oLq3QlYuCfRSFhtPYVPimDZJ7uc+8s5Cx143
 M1ifgn9ZFXhteg0sMnwbV410CXaqc/4WZWnj0yMpTsP/SoMWPs/3gJhc+9wYnFvD
 nP95ykDsH/vXlMyLjreQTZaRRhUWhMjJ8zTkzC+HaPw71B6k+KKBDEwdkxgu8u7p
 TihWxAjqKULv41on088TdzX33lBsFD57z9JASjC27gxtlxBdYZsU3ZR1LiYHrXSb
 Mc9CiETcj7reBQZzLo+IkLQK5S3WxMo/wMAUGh+20i4iEn07HGymsSgg1YsjtJ/a
 aSmnqwPnGdcipM+RY0G4pGV4bit6OUp5La32rXnFGpp7JTYebp3C5f2NJGs/I7HY
 KVwhmbS9lfHA8fpS6IG/WF/by9DsR/VTenBkCX3sQ3fggnkmIDceVv+TdnaITik0
 /edZYK3vhENXfzeP1ZzpxE5husF9s63RwoStMvrEJot406KN72EBkrXcr0r2Jx/t
 gzq+HSua929RjwE6MNMRMXPgGZA0if7JoWMXnBVHfWDFzvjgq68nI406imPN4ENM
 kPJhclaHI+sgedO3PXlmnVSa44re37PQlUlQkmGGJjIRjWeI/GOC78+StDvRiJnn
 4rj30RgwOJPvYTCpFPCjwNlkBlBPw79XiHaqIR5uU7uMCqhZ4E4=
 =xdrR
 -----END PGP SIGNATURE-----

Merge 3.10.85 into android-msm-bullhead-3.10-oreo-m5

Changes in 3.10.85: (90 commits)
        ipr: Increase default adapter init stage change timeout
        Disable write buffering on Toshiba ToPIC95
        ALSA: hda - Add headset support to Acer Aspire V5
        ALSA: hda - Fix the dock headphone output on Fujitsu Lifebook E780
        ARC: add compiler barrier to LLSC based cmpxchg
        arm64: Do not attempt to use init_mm in reset_context()
        arm64: mm: Fix freeing of the wrong memmap entries with !SPARSEMEM_VMEMMAP
        arm64: vdso: work-around broken ELF toolchains in Makefile
        cpuidle / menu: Return (-1) if there are no suitable states
        regmap: Fix regmap_bulk_read in BE mode
        regulator: core: fix constraints output buffer
        spi: pl022: Specify 'num-cs' property as required in devicetree binding
        mtd: fix: avoid race condition when accessing mtd->usecount
        mtd: dc21285: use raw spinlock functions for nw_gpio_lock
        pinctrl: mvebu: armada-370: fix spi0 pin description
        pinctrl: mvebu: armada-xp: remove non-existing NAND pins
        pinctrl: mvebu: armada-xp: remove non-existing VDD cpu_pd functions
        pinctrl: mvebu: armada-xp: fix functions of MPP48
        Bluetooth: btusb: Fix memory leak in Intel setup routine
        ath9k: fix DMA stop sequence for AR9003+
        staging: rtl8712: prevent buffer overrun in recvbuf2recvframe
        ext4: fix race between truncate and __ext4_journalled_writepage()
        ext4: call sync_blockdev() before invalidate_bdev() in put_super()
        ext4: don't retry file block mapping on bigalloc fs with non-extent file
        ext4: fix reservation release on invalidatepage for delalloc fs
        ext4: be more strict when migrating to non-extent based file
        ext4: correctly migrate a file with a hole at the beginning
        ext4: replace open coded nofail allocation in ext4_free_blocks()
        jbd2: use GFP_NOFS in jbd2_cleanup_journal_tail()
        jbd2: fix ocfs2 corrupt when updating journal superblock fails
        i2c: at91: fix a race condition when using the DMA controller
        iio: DAC: ad5624r_spi: fix bit shift of output data value
        af9013: Don't accept invalid bandwidth
        s5h1420: fix a buffer overflow when checking userspace params
        cx24116: fix a buffer overflow when checking userspace params
        ASoC: wm8737: Fixup setting VMID Impedance control register
        ASoC: wm8955: Fix setting wrong register for WM8955_K_8_0_MASK bits
        ASoC: wm8903: Fix define for WM8903_VMID_RES_250K
        ASoC: wm8960: the enum of "DAC Polarity" should be wm8960_enum[1]
        libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER
        libata: increase the timeout when setting transfer mode
        usb: dwc3: gadget: return error if command sent to DGCMD register fails
        usb: dwc3: gadget: return error if command sent to DEPCMD register fails
        usb: dwc3: Reset the transfer resource index on SET_INTERFACE
        USB: devio: fix a condition in async_completed()
        USB: cp210x: add ID for Aruba Networks controllers
        USB: option: add 2020:4000 ID
        usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function
        dm btree remove: fix bug in redistribute3
        dm btree: silence lockdep lock inversion in dm_btree_del()
        mmc: block: Add missing mmc_blk_put() in power_ro_lock_show()
        drm/qxl: Do not cause spice-server to clean our objects
        drm/radeon: take the mode_config mutex when dealing with hpds (v2)
        drm/radeon: Don't flush the GART TLB if rdev->gart.ptr == NULL
        drm: add a check for x/y in drm_mode_setcrtc
        xfs: fix remote symlinks on V5/CRC filesystems
        vTPM: set virtual device before passing to ibmvtpm_reset_crq
        libata: add ATA_HORKAGE_NOTRIM
        libata: force disable trim for SuperSSpeed S238
        tracing/filter: Do not WARN on operand count going below zero
        tracing/filter: Do not allow infix to exceed end of string
        tracing: Have branch tracer use recursive field of task struct
        dmaengine: mv_xor: bug fix for racing condition in descriptors cleanup
        hwmon: (mcp3021) Fix broken output scaling
        md: fix a build warning
        Btrfs: use kmem_cache_free when freeing entry in inode cache
        fuse: initialize fc->release before calling it
        crush: fix a bug in tree bucket decode
        ACPICA: Tables: Fix an issue that FACS initialization is performed twice
        iscsi-target: Convert iscsi_thread_set usage to kthread.h
        iser-target: Fix possible deadlock in RDMA_CM connection error
        iser-target: release stale iser connections
        mmc: card: Fixup request missing in mmc_blk_issue_rw_rq
        __bitmap_parselist: fix bug in empty string handling
        mac80211: prevent possible crypto tx tailroom corruption
        USB: usbfs: allow URBs to be reaped after disconnection
        watchdog: omap: assert the counter being stopped before reprogramming
        NFS: Fix size of NFSACL SETACL operations
        fixing infinite OPEN loop in 4.0 stateid recovery
        nfs: increase size of EXCHANGE_ID name string buffer
        SUNRPC: Fix a memory leak in the backchannel code
        9p: forgetting to cancel request on interrupted zero-copy RPC
        9p: don't leave a half-initialized inode sitting around
        rbd: use GFP_NOIO in rbd_obj_request_create()
        agp/intel: Fix typo in needs_ilk_vtd_wa()
        hpfs: hpfs_error: Remove static buffer, use vsprintf extension %pV instead
        Fix firmware loader uevent buffer NULL pointer dereference
        qla2xxx: Mark port lost when we receive an RSCN for it.
        MIPS: KVM: Do not sign extend on unsigned MMIO load
        Linux 3.10.85

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Conflicts:
	drivers/usb/dwc3/gadget.c
2018-01-25 16:57:12 -07:00
Patrick Daly 0a14e064d8 msm: lpm-levels-of: Fix lockdep warnings
Properly initialize dynamically allocated sysfs attributes.

Change-Id: Ia2bf222ca7496af2c057c8361a653afc6add00cd
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2015-09-11 00:33:57 -07:00
Rafael J. Wysocki c24d75b729 cpuidle / menu: Return (-1) if there are no suitable states
commit 3836785a1bdcd6706c68ad46bf53adc0b057b310 upstream.

If there is a PM QoS latency limit and all of the sufficiently shallow
C-states are disabled, the cpuidle menu governor returns 0 which on
some systems is CPUIDLE_DRIVER_STATE_START and shouldn't be returned
if that C-state has been disabled.

Fix the issue by modifying the menu governor to return (-1) in such
situations.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[shilpab: Backport to 3.10.y
 - adjust context
 - add a check if 'next_state' is less than 0 in 'cpuidle_idle_call()',
   this ensures that we exit 'cpuidle_idle_call()' if governor->select()
   returns  negative value]
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 09:29:41 -07:00
Riley Andrews d6212979ad cpuidle: Add nop idle governor.
The lpm cpuidle driver does all its idle state calculations
in the driver, as opposed to in the governor. To avoid pointless
work, add a null cpuidle governor that returns fixed idle
state to move to, the result of which can be ignored.

Change-Id: I7e29513126e91023af13794792235bc4b5500d06
Signed-off-by: Riley Andrews <riandrews@google.com>
2015-07-23 22:07:10 +00:00
Mohammed Khajapasha 97c52b7b61 lpm: Free the allocated resource to avoid memory leak
Free the allocated memory for level_name to avoid the
memory leak in regsiter_cpu_lpm_stats().

Change-Id: I24f0feff2e05963986eaaf54610a8a5ed079b692
Signed-off-by: Mohammed Khajapasha <mkhaja@codeaurora.org>
2015-06-09 16:40:50 -07:00
Murali Nalajala 16323e6eef cpu_pm: Add level to the cluster pm notification
Cluster pm notifications without level information increases difficulty
and complexity for the registered drivers to figure out when the last
coherency level is going into power collapse.

Send notifications with level information that allows the registered
drivers to easily determine the cluster level that is going in/out of
power collapse.

There is an issue with this implementation. GIC driver saves and
restores the distributed registers as part of cluster notifications. On
newer platforms there are multiple cluster levels are defined (e.g l2,
cci etc). These cluster level notofications can happen independently.
On MSM platforms GIC is still active while the cluster sleeps in idle,
causing the GIC state to be overwritten with an incorrect previous state
of the interrupts. This leads to a system hang. Do not save and restore
on any L2 and higher cache coherency level sleep entry and exit.

Change-Id: I31918d6383f19e80fe3b064cfaf0b55e16b97eb6
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
2015-01-07 22:31:58 -08:00
Linux Build Service Account 2562b7bc69 Merge "msm: lpm-levels: Initialize last level for cluster at probe" 2015-01-02 14:48:09 -08:00
Srinivas Rao L 91a033ad82 cpuidle: lpm-workarounds: Add module lpm-workarounds
Add new module lpm-workarounds to support workarounds for
low power modes driver. Add workaround support for unvote
CX turbo vote during exit of rpm assisted power collapse.
On some targets rpm bumps up the CX to turbo while
coming out of power collapse, to reduce the power impact
of this the workaround is necessary.

Change-Id: I11b6e96f02dd3a0dec189ee568a1f7baa3e8894a
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>
2014-12-29 15:55:35 +05:30
Srinivas Rao L 1fd2a2caaf msm: lpm-levels: Initialize last level for cluster at probe
Cluster lpm's last executed level info needs to be initialized at probe.
This data when left uninitialized would result in the top level cluster
having an incorrect, lpm state, view of a child cluster. This incorrect
view could result in one of the following race conditions. CCI could be
programmed to enter a low power mode even though one of the cores is
online. RPM SPM interrupt may be masked by a core that is not the last
core in the system.

Change-Id: I663da7e9b5972ed572546c0d87ce8851ecf8e56b
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>
2014-12-22 09:47:30 -08:00
Abhijeet Dharmapurikar 0fad2540ff msm: lpm-levels: use correct enums for level modes
struct lpm_cluster_level's mode is an array of enum representing
SPM low power modes. The current code compares the values in it
with enum msm_pm_sleep_mode which represents cpu sleep modes.

Fix this by comparing mode with SPM low power modes.

Change-Id: I49ae054298f4f8f71a4a4476c541db3ec69935d0
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2014-12-16 10:08:38 -08:00
Karthik Parsha 6220429a63 msm: lpm-levels: Add support for CCI auto hardware clock gating
CCI auto hardware clock gating is exercised independent of CCI
SPM. To support auto hardware clock gating, disable CCI SPM when
clock gating lpm level is chosen.

Change-Id: Iec20be34708c85161675c977153ef7198d926346
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
2014-12-11 09:11:04 -08:00
Karthik Parsha 657774e422 msm: spm: Add support to use SPM for clock gating mode
On targets that support auto clock gating, spm needs to be disabled
for the hardware to do auto clock gating. If auto clock gating is not
supported or not used, spm needs to be left enabled when programmed
for clock gating.

Add driver support to keep the spm enabled, and, if qchannel interface
is present then add driver support to enable spm legacy mode. This
would keep the spm enabled for clock gating. Use the dt flag
qcom,use-spm-clock-gating to determine if spm needs to be used for
clock gating.

Also, fix lpm-levels driver to support clock gating and auto clock gating
modes.

Change-Id: I4c796d7e063633e41910e780ee2a05e5205db0bd
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
2014-11-19 13:01:55 -08:00
Linux Build Service Account 3201425365 Merge "msm: lpm: Fix cpu and cluster pm notifications" 2014-11-13 18:56:45 -08:00
Linux Build Service Account 13c4f09da1 Merge "msm: lpm-levels: Add support for CCI auto hardware clock gating" 2014-11-12 20:51:32 -08:00
Archana Sathyakumar 1c3ce9135b msm: lpm: Fix cpu and cluster pm notifications
Issue:
System hangs as soon as USB is unplugged from the device.
Cpu pm notifications are to be sent only in the power collapse path,
but it is sent when cpu enters any low power modes. This results in
undesired and unexpected behavior.

Send cpu pm notifications only for power collapse and idle path.

Change-Id: I779152cd05c65b116e9ac88856de729c1212fe16
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
2014-11-12 17:28:59 -07:00
Linux Build Service Account 42dc0a7daf Merge "qcom: msm: event-timer: Add eventimer migration framework" 2014-11-12 09:47:23 -08:00
Karthik Parsha 560abc3679 msm: lpm-levels: Add support for CCI auto hardware clock gating
CCI auto hardware clock gating is exercised independent of CCI
SPM. To support auto hardware clock gating, disable CCI SPM when
clock gating lpm level is chosen.

Change-Id: Ice9cfdb9277e8604b9ac02541907caa6d30e160a
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
2014-11-11 12:08:23 -08:00
Murali Nalajala 85ecb4f722 qcom: msm: event-timer: Add eventimer migration framework
Currently, all the event timers are associated to CPU0. These event
timers are not bind to any of the IRQs and always handled(hrtimer)
by CPU0. This event timers framework make sure event timers are
bound to clients IRQs and when the IRQ affinity has changed event
timer framework will make sure to move associated event timer to
a new CPU based on IRQ affinity.

CRs-fixed: 719258
Change-Id: Idbce3d5195655f558f74c208216f75515d235b8e
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
2014-11-09 15:17:50 -08:00
Archana Sathyakumar 57fdc6cd37 msm: lpm: Send cluster pm notifications
Similar to cpu pm notifications, send cluster notifications whenever a
cluster goes into low power mode.  Ensure that cpu pm notifications are
sent out for the all the cpus on the power domain before cluster
notification is sent out.

CRs-fixed: 751893
Change-Id: Ib098d41c4ec750c7af8142bb99977d9b417bf2f0
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
2014-11-07 10:49:26 -07:00
Venkat Devarasetty 9e84f2e110 lpm-levels: Add a NULL check of next event time
The next event value could be NULL if there is no event
queued. Add a NULL check to avoid wrong calculation of
next wakeup time.

Change-Id: I1ddd8db1803c8f88e99c050e8e40fb6cb5326bda
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
2014-10-31 13:58:36 +05:30
Linux Build Service Account 5a1d0037b2 Merge "ARM64: smp: Prevent cluster LPM modes when pending IPIs on cluster CPUs" 2014-10-29 09:20:26 -07:00
Mahesh Sivasubramanian 50711f8b45 ARM64: smp: Prevent cluster LPM modes when pending IPIs on cluster CPUs
LPM modes can fail if there is a pending IPI interrupt at GIC CPU
interface. On some usecases frequent failure of LPM modes can
cause power and performance degradation. Hence, prevent cluster
low power modes when there is a pending IPI on cluster CPUs.

Change-Id: Id8a0ac24e4867ef824e0a6f11d989f1e1a2b0e93
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
2014-10-24 17:10:40 -07:00
Linux Build Service Account 16b81bb8b2 Merge "msm: spm: Support RPM handshake control bit in SPM" 2014-10-23 21:49:34 -07:00
Linux Build Service Account ef21ffcfcc Merge "msm: lpm: Add support for registering lpm clock gating mode" 2014-10-22 15:58:05 -07:00
Murali Nalajala e6ac510186 msm: lpm-levels-of: fix accessing out of bound memory
CPU's lpm level kobjects are dynamically allocated based on the
number of CPU's in that cluster. The kobject's are then indexed
using the cpu number. This results in the driver writing to and
using memory not allocated to it. Fix this by using an index
starting from zero to index into the allocated kobject array.

CRs-fixed: 739886
Change-Id: I033590c89ad800087007ed6ba60fe558c2221767
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
2014-10-17 15:59:47 -07:00
Praveen Chidambaram fe6c032d63 msm: spm: Support RPM handshake control bit in SPM
SAW2 3.0 supports RPM handshake using SAW2_SPM_CTL register for the
sleep command in the SPM sequence. This allows a single power collapse
sequence for both cases when we don't want to notify RPM on apps power
down and when we want to.

This implementation is the same across all IPs in the apps processor
subsystem, but only a few SAW modules are allowed to notify RPM and
handshake with RPM when executing the 0x03 sleep command. Disallow and
check incorrect call on SPM, based on the flag provided in the device
tree.

Based on this flag in DT, set the SLP_CMD_MODE bit in SPM_CTL
register. Fail to set the low power mode if we are trying to send
rpm notification for a mode that does not support rpm notification.

Change-Id: I5527bd8da62673d68867842dbd80000d67965e6a
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
2014-10-15 17:31:27 -06:00
Karthik Parsha 455347d19f msm: lpm: Add support for registering lpm clock gating mode
An SPM is able to support Clock Gating along with the other low power
modes. Add support for parsing clock gating lpm mode in the lpm driver.

Change-Id: Idac6f7d415cfbe9490aef5c7933d72626e15acae
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
2014-10-14 10:35:22 -07:00
Linux Build Service Account 4ad24a1129 Merge "lpm-levels: Move cpuidle tracepoints within lpm_levels" 2014-10-11 18:12:46 -07:00
Linux Build Service Account cd300ee01f Merge "msm: lpm: Fix race condition in entering system level power collapse" 2014-09-13 17:25:37 -07:00
Linux Build Service Account 3c67f73f9d Merge "cpuidle: Wakeup only cpus for which qos has changed." 2014-09-11 21:59:50 -07:00
Archana Sathyakumar ba83fb899c lpm-levels: Move cpuidle tracepoints within lpm_levels
Currently the cpuidle driver considers the mode selected by menu
governor for trace events. lpm_levels recalculates the cpu and system
modes within the enter_sleep function and overwrites the menu governor
mode selection with its decision. Due to this other modules that are
dependent on these tracepoints collect incorrect low power mode
information.

Move the tracepoint within lpm_levels such that the mode selected within
lpm-levels is correctly reported and traced.

Change-Id: I9059a107da21ceebe11ae83427d36a28cf3f1a8e
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
2014-09-11 18:37:38 -06:00
Karthik Parsha ce2aba5b4c msm: lpm: Fix race condition in entering system level power collapse
System level power collapse should only be configured from the last core
entering power collapse. Incorrect input parameters, when configuring
system level cluster power collapse, would result in the system having an
inconsistent view of the lpm status of one or more cores in a cluster.
This race condition would allow multiple cores to program the system level
cluster to enter power collapse. As part of configuring the system level
cluster to enter power collapse several operations are performed. Due to
the race condition these operations can end up being executed on a core
that is not the last core in the cluster. This duplicate execution could
result in a system state that is critical and nonrecoverable.

When configuring system level cluster power collapse, use a child mask that
identifies the current low power mode status of the children, to make sure
that the system level cluster power collapse is only configured by the last
child entering power collapse.

The check to see if the core that is attempting to configure system level
cluster for power collapse is indeed the last core, is a critical section.
Protect this check inside a spinlock.

CRs-fixed: 714779
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
Change-Id: Ic44f1e12253ae508aa3a5d4962f77b1408b860f8
2014-09-11 11:38:38 -07:00
Mahesh Sivasubramanian 51616fd9a3 cpuidle: Wakeup only cpus for which qos has changed.
The pm_qos framework passes down a mask of cpus for which the qos has
changed.  cpuidle driver uses this info to wakeup only those cpus for the
new qos to take effect. This would prevent waking up cpus for which the qos
values remains unchanged.

Change-Id: Ibb79937674a8f16920c6b8f224a21d2f72a0f9ce
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
2014-09-09 15:06:14 -06:00
Syed Rameez Mustafa a7692d8d88 cpuidle: lpm-levels: Report correct C-states to the scheduler
The scheduler currently receives the low power mode level that a CPU
is about to enter whereby 0 indicates the shallowest sleep state and
higher numbers indicate deeper sleep states. The scheduler, however,
operates on the notion of C-states whereby 0 indicates an active state
and a higher numbers indicate different sleep states. Due to this
mismatch the scheduler is unable to distinguish between an active CPU
and a CPU in the shallowest sleep state. Fix this by translating the
low power mode level to the appropriate C-state before communicating
it to the scheduler.

Change-Id: I60d985626cb799d436172c00861f05538c2b382a
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2014-09-08 11:29:12 -07:00
Linux Build Service Account b1eb9a8872 Merge "cpuidle: check for need_resched() after the idle entry trace event" 2014-08-31 08:25:20 -07:00
Mahesh Sivasubramanian 1ba5d3ee9b cpuidle: lpm-levels: Flush L2 cache when hotplug happens before probe
If CPU hotplug is initiated before probe, the L2 of the cluster is not
configured for any low power mode and is not flushed. This results in data
incoherencies in ramdumps in particular, if the system crashed after.

To ensure that L2 is flushed, flush L2 during hotplug until lpm-levels
module is probed

CRs-fixed: 715757
Change-Id: I0fb203da68e78d4f0c4acf96db9e5863268d1f52
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
2014-08-27 14:02:20 -06:00
Syed Rameez Mustafa 46e90497d8 cpuidle: check for need_resched() after the idle entry trace event
trace_cpu_idle_rcuidle() can end up waking ksoftirqd under certain
conditions. Since there is no check for need_resched() following
this wake up, the cpu ends up going into an idle state despite there
being a runnable task on that runqueue. Furthermore, since the
resched flag is set, any sucessive waking up tasks on the idle cpu
will not result in an IPI being sent to that cpu. Consequently tasks
on that runqueue will starve until the cpu exits idle by itself. Fix
this problem by adding a need_resched() check after the idle entry
trace event.

A side effect of this change is that the idle trace entry and exit
event may be recorded for an extremely short duration even though
the cpu does not actually enter idle.

Change-Id: I370c39a1e39ecd829e44ac783b4888a00ab05eae
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2014-08-26 12:15:42 -07:00
Linux Build Service Account 043aad2e86 Merge "Merge remote-tracking branch 'remotes/origin/tmp-e0de3bc' into msm-3.10" 2014-08-18 06:39:34 -07:00
Peter Zijlstra c5ac12693f arch: Mass conversion of smp_mb__*()
Mostly scripted conversion of the smp_mb__* barriers.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 4e857c58efeb99393cba5a5d0d8ec7117183137c
[joonwoop@codeaurora.org: fixed trivial merge conflict.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2014-08-15 11:45:28 -07:00
Karthik Parsha c7742f7c06 msm: lpm: Ignore cluster level with notify rpm if rpm acks are pending
When selecting a cluster level, if a level can result in sleep set
transition and there are pending rpm acks, then ignore that level in the
search for the best cluster level.

CRs-fixed: 705303
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
Change-Id: I915297b0b74c013bdeb69026e69204e7c6dc39b1
2014-08-14 15:13:51 +05:30
Mahesh Sivasubramanian b15fe8e06e msm: lpm-levels: Fix issue with coresight save/restore
The coresight save/restore functions needs to be called when the L2 of the
respective clusters are placed in power collapse/GDHS. On a multi-cluster
system, keeping track of this using a static variable could result in
incorrect save/restore of CTI registers. Fix by using a variable
associated with a cluster.

Change-Id: Ib4ba5790af2a9e3bc245f1ef5010930b5cf4921c
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
2014-08-06 14:09:46 -06:00
Venkat Devarasetty c80cf034c0 msm: lpm-levels-of: avoid NULL pointer dereference
Cpu node name is printed in error case when its matching
node is not found. If cpu_node is NULL we must avoid its
dereference. Move the print statement so that it is not
accessed when cpu node variable is NULL.

Change-Id: I373d668403c61e9fce76d1d5b4d0f225fa277d16
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
2014-08-01 18:53:07 +05:30
Linux Build Service Account d4a22ea9d3 Merge "Merge remote-tracking branch 'quic/tmp-hmp' into msm-3.10" 2014-07-23 19:19:22 -07:00
Linux Build Service Account df0a158a87 Merge "msm: rpm-smd: Increase the max outstanding sleep set messages to 24" 2014-07-23 14:01:03 -07:00
Srivatsa Vaddagiri 5652270c3f msm: lpm_levels: inform the scheduler about cpu C-states
Scheduler needs to distinguish cpus that are in different C-states.
Having information on C-states, especially the cost of exiting a
particular state will help the scheduler make better task placement
decisions.

This patch extends the msm power management driver to provide required
information to the scheduler.

Change-Id: I569d5f8b3e18b0444e5517be500e82bf27d3d22f
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2014-07-22 14:23:02 -07:00
Karthik Parsha 29282e892d msm: rpm-smd: Increase the max outstanding sleep set messages to 24
When sending sleep-set requests send up 24 requests before reading any
acks.  The RX FIFO can hold 24 acks. Increase the threshold to the
max number of acks the FIFO can hold, so as to delay the process of
emptying the FIFO.

Also check and return an err on timeout and propagate that error up the
call chain.

Change-Id: Ic774fad65fbaa1906fcc7c51ab0d8b3766b8a987
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
2014-07-21 13:34:20 -07:00
Archana Sathyakumar 8875045cef lpm-levels: Log cluster_enter event only for non default levels
Only cluster_enter events log for default levels causes
inconsistency. Log them only if the any low power mode is selected.

CRs-fixed: 692014
Change-Id: I5c549c1f9139d67a73e288a0393a19e52e9d2412
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
2014-07-15 15:50:27 -06:00
Linux Build Service Account ad983c2fa6 Merge "lpm_levels: Select mode based on steady state power for hotplug" 2014-07-15 01:51:32 -07:00