Commit Graph

259 Commits

Author SHA1 Message Date
Santosh Mardi
49eea524be devfreq: update freq variable in compute_freq function
Update freq variable from unsigned long to uint64_t of
compute_freq function  to be in compliance with 32 bit
environment.

Change-Id: Ia9183b0e593daf3780135a8e1ae8ddb36db16f86
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2018-05-18 17:17:03 +05:30
Jonathan Avila
5a2f4ce3fa PM / devfreq: Introduce a sysfs lock
Currently, concurrent writes to sysfs entries leave the	possibility for
race conditions within the devfreq framework.  For example, concurrently
executing max_freq_store and governor_store can result in attempting to
perform an update_devfreq() before the new governor's start handler can be
executed.

A more concrete case is a race between polling_interval_store and
governor_store.  Because no lock is used after calling into the event
handler of the old governor and there's nothing preventing work from being
queued after the monitor is stopped, it's possible to accidentally cause
delayed work to be queued on the governor being switched to.  This can be
seen if you create two threads, one which changes a device's governor
between simple_ondemand and performance, and one which changes its polling
interval between 45 and 50.

All of these races can be addressed with the introduction of a lock that
prevents sysfs operations from interleaving in this fashion.

Change-Id: Ia6887dcb2d69dc2576837a6c09fed55a28943abc
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
2018-04-11 13:28:37 -07:00
Blagovest Kolenichev
e06a1054bd Merge android-4.9.84 (a9d0273) into msm-4.9
* refs/heads/tmp-a9d0273:
  Linux 4.9.84
  crypto: s5p-sss - Fix kernel Oops in AES-ECB mode
  KVM: nVMX: invvpid handling improvements
  KVM: VMX: clean up declaration of VPID/EPT invalidation types
  KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously
  x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug
  usb: phy: msm add regulator dependency
  arm64: fix warning about swapper_pg_dir overflow
  idle: i7300: add PCI dependency
  spi: bcm-qspi: shut up warning about cfi header inclusion
  binfmt_elf: compat: avoid unused function warning
  arm64: sunxi: always enable reset controller
  drm/i915: hide unused intel_panel_set_backlight function
  kasan: rework Kconfig settings
  clk: meson: gxbb: fix build error without RESET_CONTROLLER
  ISDN: eicon: reduce stack size of sig_ind function
  tw5864: use dev_warn instead of WARN to shut up warning
  em28xx: only use mt9v011 if camera support is enabled
  go7007: add MEDIA_CAMERA_SUPPORT dependency
  tc358743: fix register i2c_rd/wr functions
  shmem: fix compilation warnings on unused functions
  KVM: add X86_LOCAL_APIC dependency
  Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning
  drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized
  rbd: silence bogus -Wmaybe-uninitialized warning
  drm: exynos: mark pm functions as __maybe_unused
  security/keys: BIG_KEY requires CONFIG_CRYPTO
  cw1200: fix bogus maybe-uninitialized warning
  reiserfs: avoid a -Wmaybe-uninitialized warning
  ALSA: hda/ca0132 - fix possible NULL pointer use
  arm64: Kconfig: select COMPAT_BINFMT_ELF only when BINFMT_ELF is set
  scsi: advansys: fix uninitialized data access
  x86/vm86: Fix unused variable warning if THP is disabled
  x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG
  dmaengine: zx: fix build warning
  x86: add MULTIUSER dependency for KVM
  thermal: fix INTEL_SOC_DTS_IOSF_CORE dependencies
  x86/build: Silence the build with "make -s"
  tools build: Add tools tree support for 'make -s'
  x86/fpu/math-emu: Fix possible uninitialized variable use
  arm64: define BUG() instruction without CONFIG_BUG
  gpio: xgene: mark PM functions as __maybe_unused
  x86/ras/inject: Make it depend on X86_LOCAL_APIC=y
  scsi: advansys: fix build warning for PCI=n
  video: fbdev: via: remove possibly unused variables
  perf: xgene: Include module.h
  PCI: Change pci_host_common_probe() visibility
  usb: musb: fix compilation warning on unused function
  platform/x86: intel_mid_thermal: Fix suspend handlers unused warning
  gpio: intel-mid: Fix build warning when !CONFIG_PM
  PCI: vmd: Fix suspend handlers defined-but-not-used warning
  perf/x86: Shut up false-positive -Wmaybe-uninitialized warning
  vmxnet3: prevent building with 64K pages
  clk: sunxi-ng: fix build error without CONFIG_RESET_CONTROLLER
  shmem: avoid maybe-uninitialized warning
  drm/i915: fix intel_backlight_device_register declaration
  crypto: talitos - fix Kernel Oops on hashing an empty file
  powerpc/64s: Improve RFI L1-D cache flush fallback
  powerpc/64s: Simple RFI macro conversions
  powerpc/64s: Fix conversion of slb_miss_common to use RFI_TO_USER/KERNEL
  hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close
  xen: XEN_ACPI_PROCESSOR is Dom0-only
  platform/x86: dell-laptop: Fix keyboard max lighting for Dell Latitude E6410
  x86/mm/kmmio: Fix mmiotrace for page unaligned addresses
  mm/early_ioremap: Fix boot hang with earlyprintk=efi,keep
  usb: dwc3: of-simple: fix missing clk_disable_unprepare
  usb: dwc3: gadget: Wait longer for controller to end command processing
  dmaengine: jz4740: disable/unprepare clk if probe fails
  drm/armada: fix leak of crtc structure
  xfrm: Fix stack-out-of-bounds with misconfigured transport mode policies.
  spi: sun4i: disable clocks in the remove function
  ASoC: rockchip: disable clock on error
  clk: fix a panic error caused by accessing NULL pointer
  dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved
  dmaengine: ioat: Fix error handling path
  gianfar: Disable EEE autoneg by default
  509: fix printing uninitialized stack memory when OID is empty
  net: ethernet: arc: fix error handling in emac_rockchip_probe
  brcmfmac: Avoid build error with make W=1
  btrfs: Fix possible off-by-one in btrfs_search_path_in_tree
  net_sched: red: Avoid illegal values
  net_sched: red: Avoid devision by zero
  gianfar: fix a flooded alignment reports because of padding issue.
  ARM: dts: Fix elm interrupt compiler warning
  s390/dasd: prevent prefix I/O error
  powerpc/perf: Fix oops when grouping different pmu events
  m68k: add missing SOFTIRQENTRY_TEXT linker section
  ipvlan: Add the skb->mark as flow4's member to lookup route
  scripts/kernel-doc: Don't fail with status != 0 if error encountered with -none
  sctp: only update outstanding_bytes for transmitted queue when doing prsctp_prune
  RDMA/cma: Make sure that PSN is not over max allowed
  i40iw: Correct ARP index mask
  pinctrl: sunxi: Fix A64 UART mux value
  pinctrl: sunxi: Fix A80 interrupt pin bank
  media: s5k6aa: describe some function parameters
  perf bench numa: Fixup discontiguous/sparse numa nodes
  perf top: Fix window dimensions change handling
  ARM: dts: am437x-cm-t43: Correct the dmas property of spi0
  ARM: dts: am4372: Correct the interrupts_properties of McASP
  ARM: dts: logicpd-somlv: Fix wl127x pinmux
  ARM: dts: logicpd-som-lv: Fix gpmc addresses for NAND and enet
  ARM: dts: Fix omap4 hang with GPS connected to USB by using wakeupgen
  ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function
  ARM: OMAP2+: Fix SRAM virt to phys translation for save_secure_ram_context
  usb: build drivers/usb/common/ when USB_SUPPORT is set
  usbip: keep usbip_device sockfd state in sync with tcp_socket
  staging: iio: ad5933: switch buffer mode to software
  staging: iio: adc: ad7192: fix external frequency setting
  binder: check for binder_thread allocation failure in binder_poll()
  staging: android: ashmem: Fix a race condition in pin ioctls
  dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock
  arm64: dts: add #cooling-cells to CPU nodes
  ARM: 8743/1: bL_switcher: add MODULE_LICENSE tag
  video: fbdev/mmp: add MODULE_LICENSE
  ASoC: ux500: add MODULE_LICENSE tag
  crypto: hash - prevent using keyed hashes without setting key
  crypto: hash - annotate algorithms taking optional key
  net: avoid skb_warn_bad_offload on IS_ERR
  rds: tcp: atomically purge entries from rds_tcp_conn_list during netns delete
  netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert
  netfilter: xt_cgroup: initialize info->priv in cgroup_mt_check_v1()
  netfilter: on sockopt() acquire sock lock only in the required scope
  netfilter: ipt_CLUSTERIP: fix out-of-bounds accesses in clusterip_tg_check()
  netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_{match|target}
  netfilter: x_tables: fix int overflow in xt_alloc_table_info()
  kcov: detect double association with a single task
  KVM: x86: fix escape of guest dr6 to the host
  blk_rq_map_user_iov: fix error override
  staging: android: ion: Switch from WARN to pr_warn
  staging: android: ion: Add __GFP_NOWARN for system contig heap
  crypto: x86/twofish-3way - Fix %rbp usage
  selinux: skip bounded transition processing if the policy isn't loaded
  selinux: ensure the context is NUL terminated in security_context_to_sid_core()
  Provide a function to create a NUL-terminated string from unterminated data
  ptr_ring: fail early if queue occupies more than KMALLOC_MAX_SIZE
  drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
  blktrace: fix unlocked registration of tracepoints
  sctp: set frag_point in sctp_setsockopt_maxseg correctly
  xfrm: check id proto in validate_tmpl()
  xfrm: Fix stack-out-of-bounds read on socket policy lookup.
  mm,vmscan: Make unregister_shrinker() no-op if register_shrinker() failed.
  xfrm: skip policies marked as dead while rehashing
  cfg80211: check dev_set_name() return value
  kcm: Only allow TCP sockets to be attached to a KCM mux
  kcm: Check if sk_user_data already set in kcm_attach
  vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
  ANDROID: sdcardfs: Hold i_mutex for i_size_write
  UPSTREAM: ANDROID: binder: synchronize_rcu() when using POLLFREE.
  BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck64-XTS
  BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck128-XTS
  BACKPORT, FROMGIT: crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS
  FROMGIT: crypto: speck - export common helpers
  BACKPORT, FROMGIT: crypto: speck - add support for the Speck block cipher
  f2fs: updates on v4.16-rc1
  Linux 4.9.83
  media: r820t: fix r820t_write_reg for KASAN
  ARM: dts: Delete bogus reference to the charlcd
  arm: dts: mt2701: Add reset-cells
  ARM: dts: s5pv210: add interrupt-parent for ohci
  arm64: dts: msm8916: Add missing #phy-cells
  ARM: pxa/tosa-bt: add MODULE_LICENSE tag
  ARM: dts: exynos: fix RTC interrupt for exynos5410
  vfs: don't do RCU lookup of empty pathnames
  x86: fix build warnign with 32-bit PAE
  x86/cpu: Change type of x86_cache_size variable to unsigned int
  x86/spectre: Fix an error message
  x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
  selftests/x86/mpx: Fix incorrect bounds with old _sigfault
  x86/speculation: Add <asm/msr-index.h> dependency
  nospec: Move array_index_nospec() parameter checking into separate macro
  x86/speculation: Fix up array_index_nospec_mask() asm constraint
  selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c
  selftests/x86: Do not rely on "int $0x80" in test_mremap_vdso.c
  selftests/x86/pkeys: Remove unused functions
  x86/speculation: Clean up various Spectre related details
  X86/nVMX: Properly set spec_ctrl and pred_cmd before merging MSRs
  KVM/x86: Reduce retpoline performance impact in slot_handle_level_range(), by always inlining iterator helper methods
  x86/speculation: Correct Speculation Control microcode blacklist again
  x86/speculation: Update Speculation Control microcode blacklist
  compiler-gcc.h: Introduce __optimize function attribute
  x86/entry/64/compat: Clear registers for compat syscalls, to reduce speculation attack surface
  arm: spear13xx: Fix spics gpio controller's warning
  arm: spear13xx: Fix dmas cells
  arm: spear600: Add missing interrupt-parent of rtc
  ARM: dts: nomadik: add interrupt-parent for clcd
  ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property
  ARM: lpc3250: fix uda1380 gpio numbers
  arm64: dts: msm8916: Correct ipc references for smsm
  s390: fix handling of -1 in set{,fs}[gu]id16 syscalls
  ocfs2: try a blocking lock before return AOP_TRUNCATED_PAGE
  PM / devfreq: Propagate error from devfreq_add_device()
  cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin
  RDMA/rxe: Fix a race condition related to the QP error state
  kselftest: fix OOM in memory compaction test
  IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports
  IB/qib: Fix comparison error with qperf compare/swap test
  powerpc: fix build errors in stable tree
  dm: correctly handle chained bios in dec_pending()
  usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT
  mvpp2: fix multicast address filter
  ALSA: seq: Fix racy pool initializations
  ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204
  ALSA: hda/realtek: PCI quirk for Fujitsu U7x7
  ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform
  ALSA: usb-audio: Fix UAC2 get_ctl request with a RANGE attribute
  ALSA: hda - Fix headset mic detection problem for two Dell machines
  mtd: nand: vf610: set correct ooblayout
  9p/trans_virtio: discard zero-length reply
  Btrfs: fix unexpected -EEXIST when creating new inode
  Btrfs: fix btrfs_evict_inode to handle abnormal inodes correctly
  Btrfs: fix extent state leak from tree log
  Btrfs: fix crash due to not cleaning up tree log block's dirty bits
  Btrfs: fix deadlock in run_delalloc_nocow
  target/iscsi: avoid NULL dereference in CHAP auth error path
  rtlwifi: rtl8821ae: Fix connection lost problem correctly
  console/dummy: leave .con_font_get set to NULL
  video: fbdev: atmel_lcdfb: fix display-timings lookup
  PCI: keystone: Fix interrupt-controller-node lookup
  MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN
  mm: Fix memory size alignment in devm_memremap_pages_release()
  mm: hide a #warning for COMPILE_TEST
  ext4: correct documentation for grpid mount option
  ext4: save error to disk in __ext4_grp_locked_error()
  ext4: fix a race in the ext4 shutdown path
  jbd2: fix sphinx kernel-doc build warnings
  mbcache: initialize entry->e_referenced in mb_cache_entry_create()
  rtc-opal: Fix handling of firmware error codes, prevent busy loops
  drm/radeon: adjust tested variable
  drm/radeon: Add dpm quirk for Jet PRO (v2)
  scsi: smartpqi: allow static build ("built-in")
  BACKPORT: tee: shm: Potential NULL dereference calling tee_shm_register()
  BACKPORT: tee: shm: don't put_page on null shm->pages
  BACKPORT: tee: shm: make function __tee_shm_alloc static
  BACKPORT: tee: optee: check type of registered shared memory
  BACKPORT: tee: add start argument to shm_register callback
  BACKPORT: tee: optee: fix header dependencies
  BACKPORT: tee: shm: inline tee_shm_get_id()
  BACKPORT: tee: use reference counting for tee_context
  BACKPORT: tee: optee: enable dynamic SHM support
  BACKPORT: tee: optee: add optee-specific shared pool implementation
  BACKPORT: tee: optee: store OP-TEE capabilities in private data
  BACKPORT: tee: optee: add registered buffers handling into RPC calls
  BACKPORT: tee: optee: add registered shared parameters handling
  BACKPORT: tee: optee: add shared buffer registration functions
  BACKPORT: tee: optee: add page list manipulation functions
  BACKPORT: tee: optee: Update protocol definitions
  BACKPORT: tee: shm: add page accessor functions
  BACKPORT: tee: shm: add accessors for buffer size and page offset
  BACKPORT: tee: add register user memory
  BACKPORT: tee: flexible shared memory pool creation
  BACKPORT: optee: support asynchronous supplicant requests
  BACKPORT: tee: add TEE_IOCTL_PARAM_ATTR_META
  BACKPORT: tee: add tee_param_is_memref() for driver use
  UPSTREAM: tcp: fix access to sk->sk_state in tcp_poll()
  BACKPORT: tcp: fix potential double free issue for fastopen_req
  BACKPORT: xfrm: Fix return value check of copy_sec_ctx.
  time: Fix ktime_get_raw() incorrect base accumulation
  FROMLIST: coresight: ETM: Add support for ARM Cortex-A73
  FROMLIST: coresight: tmc: implementing TMC-ETR AUX space API
  UPSTREAM: coresight: etm_perf: Fix using uninitialised work
  UPSTREAM: coresight: fix kernel panic caused by invalid CPU
  UPSTREAM: coresight: Fix disabling of CoreSight TPIU
  UPSTREAM: coresight: perf: Add a missing call to etm_free_aux
  UPSTREAM: coresight: tmc: Remove duplicate memset
  UPSTREAM: coresight: tmc: Get rid of mode parameter for helper routines
  UPSTREAM: coresight: tmc: Cleanup operation mode handling
  UPSTREAM: coresight: reset "enable_sink" flag when need be
  sched/fair: prevent possible infinite loop in sched_group_energy
  ANDROID: qtaguid: Fix the UAF probelm with tag_ref_tree
  UPSTREAM: ANDROID: binder: remove waitqueue when thread exits.
  ANDROID: sdcardfs: Protect set_top
  ANDROID: fsnotify: Notify lower fs of open
  Revert "ANDROID: sdcardfs: notify lower file of opens"
  ANDROID: sdcardfs: Use lower getattr times/size
  ANDROID: sched: EAS: check energy_aware() before calling select_energy_cpu_brute() in up-migrate path
  UPSTREAM: eventpoll.h: add missing epoll event masks
  BACKPORT: thermal/drivers/hisi: Add support for hi3660 SoC
  BACKPORT: thermal/drivers/hisi: Prepare to add support for other hisi platforms
  BACKPORT: thermal/drivers/hisi: Add platform prefix to function name
  BACKPORT: thermal/drivers/hisi: Put platform code together
  BACKPORT: thermal/drivers/hisi: Use round up step value
  BACKPORT: thermal/drivers/hisi: Move the clk setup in the corresponding functions
  BACKPORT: thermal/drivers/hisi: Remove mutex_lock in the code
  BACKPORT: thermal/drivers/hisi: Remove thermal data back pointer
  BACKPORT: thermal/drivers/hisi: Convert long to int
  BACKPORT: thermal/drivers/hisi: Rename and remove unused field
  BACKPORT: thermal/drivers/hisi: Remove costly sensor inspection
  BACKPORT: thermal/drivers/hisi: Fix configuration register setting
  BACKPORT: thermal/drivers/hisi: Encapsulate register writes into helpers
  BACKPORT: thermal/drivers/hisi: Remove pointless lock
  BACKPORT: thermal/drivers/hisi: Remove the multiple sensors support
  BACKPORT: thermal: hisilicon: constify thermal_zone_of_device_ops structures
  ANDROID: xattr: Pass EOPNOTSUPP to permission2
  ANDROID: sdcardfs: Move default_normal to superblock
  UPSTREAM: tcp: fix a request socket leak
  UPSTREAM: tcp: fix possible deadlock in TCP stack vs BPF filter
  UPSTREAM: tcp: Add a tcp_filter hook before handle ack packet
  FROMLIST: arm64: kpti: Fix the interaction between ASID switching and software PAN
  FROMLIST: arm64: Move post_ttbr_update_workaround to C code
  fscrypt: updates on 4.15-rc4
  ANDROID: uid_sys_stats: fix the comment
  BACKPORT: optee: fix invalid of_node_put() in optee_driver_init()
  BACKPORT: tee: optee: sync with new naming of interrupts
  BACKPORT: tee: indicate privileged dev in gen_caps
  BACKPORT: tee: optee: interruptible RPC sleep
  BACKPORT: tee: optee: add const to tee_driver_ops and tee_desc structures
  BACKPORT: tee: tee_shm: Constify dma_buf_ops structures.
  BACKPORT: tee: add forward declaration for struct device
  BACKPORT: tee: optee: fix uninitialized symbol 'parg'
  BACKPORT: tee.txt: standardize document format
  BACKPORT: tee: add ARM_SMCCC dependency
  clocksource: arch_timer: make virtual counter access configurable
  arm64: issue isb when trapping CNTVCT_EL0 access
  BACKPORT: arm64: Add CNTFRQ_EL0 trap handler
  BACKPORT: arm64: Add CNTVCT_EL0 trap handler
  ANDROID: sdcardfs: Fix missing break on default_normal
  ANDROID: arm64: kaslr: fixup Falkor workaround for 4.9
  ANDROID: usb: f_fs: Prevent gadget unbind if it is already unbound
  arm64: Kconfig: Reword UNMAP_KERNEL_AT_EL0 kconfig entry
  arm64: use RET instruction for exiting the trampoline
  UPSTREAM: arm64: kaslr: Put kernel vectors address in separate data page
  UPSTREAM: arm64: mm: Introduce TTBR_ASID_MASK for getting at the ASID in the TTBR
  UPSTREAM: arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0
  UPSTREAM: arm64: entry: Add fake CPU feature for unmapping the kernel at EL0
  UPSTREAM: arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks
  UPSTREAM: arm64: erratum: Work around Falkor erratum #E1003 in trampoline code
  UPSTREAM: arm64: entry: Hook up entry trampoline to exception vectors
  UPSTREAM: arm64: entry: Explicitly pass exception level to kernel_ventry macro
  UPSTREAM: arm64: mm: Map entry trampoline into trampoline and kernel page tables
  UPSTREAM: arm64: entry: Add exception trampoline page for exceptions from EL0
  UPSTREAM: arm64: mm: Invalidate both kernel and user ASIDs when performing TLBI
  UPSTREAM: arm64: mm: Add arm64_kernel_unmapped_at_el0 helper
  UPSTREAM: arm64: mm: Allocate ASIDs in pairs
  UPSTREAM: arm64: mm: Fix and re-enable ARM64_SW_TTBR0_PAN
  UPSTREAM: arm64: mm: Rename post_ttbr0_update_workaround
  UPSTREAM: arm64: mm: Move ASID from TTBR0 to TTBR1
  UPSTREAM: arm64: mm: Temporarily disable ARM64_SW_TTBR0_PAN
  UPSTREAM: arm64: mm: Use non-global mappings for kernel space
  UPSTREAM: arm64: factor out entry stack manipulation
  ANDROID: sdcardfs: Add default_normal option
  ANDROID: sdcardfs: notify lower file of opens
  blkdev: Refactoring block io latency histogram codes
  UPSTREAM: netfilter: conntrack: use power efficient workqueue
  ANDROID: binder: Remove obsolete proc waitqueue.
  UPSTREAM: arm64: setup: introduce kaslr_offset()
  UPSTREAM: kcov: fix comparison callback signature
  UPSTREAM: kcov: support comparison operands collection
  UPSTREAM: kcov: remove pointless current != NULL check
  UPSTREAM: kcov: support compat processes
  UPSTREAM: kcov: simplify interrupt check
  UPSTREAM: kcov: make kcov work properly with KASLR enabled
  UPSTREAM: kcov: add more missing includes
  BACKPORT: irq: Make the irqentry text section unconditional
  UPSTREAM: kasan: make get_wild_bug_type() static
  UPSTREAM: kasan: separate report parts by empty lines
  UPSTREAM: kasan: improve double-free report format
  UPSTREAM: kasan: print page description after stacks
  UPSTREAM: kasan: improve slab object description
  UPSTREAM: kasan: change report header
  UPSTREAM: kasan: simplify address description logic
  UPSTREAM: kasan: change allocation and freeing stack traces headers
  UPSTREAM: kasan: unify report headers
  UPSTREAM: kasan: introduce helper functions for determining bug type
  BACKPORT: kasan: report only the first error by default
  UPSTREAM: kasan: fix races in quarantine_remove_cache()
  UPSTREAM: kasan: resched in quarantine_remove_cache()
  UPSTREAM: kasan, sched/headers: Uninline kasan_enable/disable_current()
  UPSTREAM: kasan: drain quarantine of memcg slab objects
  UPSTREAM: kasan: eliminate long stalls during quarantine reduction
  UPSTREAM: kasan: support panic_on_warn
  ANDROID: dma-buf/sw_sync: Rename active_list to link
  ANDROID: initramfs: call free_initrd() when skipping init
  BACKPORT: Documentation: tee subsystem and op-tee driver
  BACKPORT: tee: add OP-TEE driver
  BACKPORT: tee: generic TEE subsystem
  BACKPORT: dt/bindings: add bindings for optee
  BACKPORT: schedutil: Reset cached freq if it is not in sync with next_freq
  sched: EAS/WALT: Don't take into account of running task's util
  sched: EAS/WALT: take into account of waking task's load
  sched: EAS: upmigrate misfit current task
  sched: avoid pushing tasks to an offline CPU
  sched: Extend active balance to accept 'push_task' argument
  sched: walt: Correct WALT window size initialization
  sched: WALT: account cumulative window demand
  sched: EAS/WALT: finish accounting prior to task_tick
  sched/fair: prevent meaningless active migration
  sched: walt: Leverage existing helper APIs to apply invariance
  UPSTREAM: net: xfrm: allow clearing socket xfrm policies.
  UPSTREAM: time: Clean up CLOCK_MONOTONIC_RAW time handling
  UPSTREAM: arm64: vdso: fix clock_getres for 4GiB-aligned res
  f2fs: updates on 4.15-rc1
  UPSTREAM: android: binder: fix type mismatch warning
  BACKPORT: arm64: Use __pa_symbol for empty_zero_page
  UPSTREAM: arm64: Use __pa_symbol for kernel symbols
  UPSTREAM: mm: Introduce lm_alias
  FROMLIST: binder: fix proc->files use-after-free
  BACKPORT: xfrm: Clear sk_dst_cache when applying per-socket policy.
  sched: WALT: fix potential overflow
  sched: Update task->on_rq when tasks are moving between runqueues
  sched: WALT: fix window mis-alignment
  sched: EAS: kill incorrect nohz idle cpu kick
  sched: EAS: fix incorrect energy delta calculation due to rounding error
  sched: EAS/WALT: use cr_avg instead of prev_runnable_sum
  sched: WALT: fix broken cumulative runnable average accounting
  sched: deadline: WALT: account cumulative runnable avg
  ANDROID: binder: clarify deferred thread work.
  BACKPORT: net/tcp-fastopen: Add new API support
  UPSTREAM: net: Remove __sk_dst_reset() in tcp_v6_connect()
  UPSTREAM: net/tcp-fastopen: refactor cookie check logic
  sched: compute task utilisation with WALT consistently
  FROMLIST: arm64: Avoid aligning normal memory pointers in __memcpy_{to,from}io
  UPSTREAM: security: bpf: replace include of linux/bpf.h with forward declarations
  UPSTREAM: selinux: bpf: Add addtional check for bpf object file receive
  UPSTREAM: selinux: bpf: Add selinux check for eBPF syscall operations
  BACKPORT: security: bpf: Add LSM hooks for bpf object related syscall
  BACKPORT: bpf: Add file mode configuration into bpf maps
  cpufreq: Drop schedfreq governor
  ANDROID: Revert "arm64: move ELF_ET_DYN_BASE to 4GB / 4MB"
  ANDROID: Revert "arm: move ELF_ET_DYN_BASE to 4MB"
  sched: EAS: Fix the condition to distinguish energy before/after
  sched: EAS: update trg_cpu to backup_cpu if no energy saving for target_cpu
  sched/fair: consider task utilization in group_max_util()
  sched/fair: consider task utilization in group_norm_util()
  sched/fair: enforce EAS mode
  sched/fair: ignore backup CPU when not valid
  sched/fair: trace energy_diff for non boosted tasks
  UPSTREAM: sched/fair: Sync task util before slow-path wakeup
  UPSTREAM: sched/core: Add missing update_rq_clock() call in set_user_nice()
  UPSTREAM: sched/core: Add missing update_rq_clock() call for task_hot()
  UPSTREAM: sched/core: Add missing update_rq_clock() in detach_task_cfs_rq()
  UPSTREAM: sched/core: Add missing update_rq_clock() in post_init_entity_util_avg()
  UPSTREAM: sched/fair: Fix task group initialization
  cpufreq/sched: Consider max cpu capacity when choosing frequencies
  cpufreq/sched: Use cpu max freq rather than policy max
  sched/fair: remove erroneous RCU_LOCKDEP_WARN from start_cpu()
  FROMLIST: ALSA: usx2y: Suppress kernel warning at page allocation failures
  FROMLIST: kbuild: clang: fix build failures with sparse check
  Revert "Revert "BACKPORT: efi/libstub/arm64: Set -fpie when building the EFI stub""
  BACKPORT: efi/libstub: Unify command line param parsing
  ANDROID: sched/walt: Fix divide by zero error in cpufreq notifier
  ANDROID: binder: show high watermark of alloc->pages.
  ANDROID: binder: Add thread->process_todo flag.
  ANDROID: sched/fair: Select correct capacity state for energy_diff
  ANDROID: cpufreq-dt: Set sane defaults for schedutil rate limits
  BACKPORT: cpufreq: schedutil: Use policy-dependent transition delays
  Revert "BACKPORT: efi/libstub/arm64: Set -fpie when building the EFI stub"
  FROMLIST: android: binder: Fix null ptr dereference in debug msg
  FROMLIST: android: binder: Change binder_shrinker to static
  UPSTREAM: arm64: compat: Remove leftover variable declaration
  ANDROID: HACK: arm64: use -mno-implicit-float instead of -mgeneral-regs-only
  ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple
  CHROMIUM: arm64: Disable asm-operand-width warning for clang
  CHROMIUM: kbuild: clang: Disable the 'duplicate-decl-specifier' warning
  BACKPORT: x86/asm: Fix inline asm call constraints for Clang
  BACKPORT: efi/libstub/arm64: Set -fpie when building the EFI stub
  UPSTREAM: efi/libstub/arm64: Force 'hidden' visibility for section markers
  UPSTREAM: efi/libstub/arm64: Use hidden attribute for struct screen_info reference
  UPSTREAM: x86/build: Use cc-option to validate stack alignment parameter
  UPSTREAM: x86/build: Fix stack alignment for CLang
  UPSTREAM: compiler, clang: always inline when CONFIG_OPTIMIZE_INLINING is disabled
  UPSTREAM: x86/boot: #undef memcpy() et al in string.c
  UPSTREAM: llist: clang: introduce member_address_is_nonnull()
  UPSTREAM: crypto: arm64/sha - avoid non-standard inline asm tricks
  UPSTREAM: kbuild: clang: Disable 'address-of-packed-member' warning
  UPSTREAM: x86/build: Specify stack alignment for clang
  UPSTREAM: x86/build: Use __cc-option for boot code compiler options
  UPSTREAM: kbuild: Add __cc-option macro
  UPSTREAM: x86/mm/kaslr: Use the _ASM_MUL macro for multiplication to work around Clang incompatibility
  UPSTREAM: crypto, x86: aesni - fix token pasting for clang
  UPSTREAM: x86/kbuild: Use cc-option to enable -falign-{jumps/loops}
  UPSTREAM: compiler, clang: properly override 'inline' for clang
  UPSTREAM: compiler, clang: suppress warning for unused static inline functions
  UPSTREAM: modules: mark __inittest/__exittest as __maybe_unused
  UPSTREAM: kbuild: Add support to generate LLVM assembly files
  UPSTREAM: kbuild: use -Oz instead of -Os when using clang
  UPSTREAM: kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  UPSTREAM: kbuild: drop -Wno-unknown-warning-option from clang options
  UPSTREAM: kbuild: fix asm-offset generation to work with clang
  UPSTREAM: kbuild: consolidate redundant sed script ASM offset generation
  UPSTREAM: kbuild: Consolidate header generation from ASM offset information
  UPSTREAM: kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS
  UPSTREAM: kbuild: Add better clang cross build support
  FROMLIST: f2fs: expose some sectors to user in inline data or dentry case
  UPSTREAM: sched/fair: Fix usage of find_idlest_group() when the local group is idlest
  UPSTREAM: sched/fair: Fix usage of find_idlest_group() when no groups are allowed
  UPSTREAM: sched/fair: Fix find_idlest_group() when local group is not allowed
  UPSTREAM: sched/fair: Remove unnecessary comparison with -1
  UPSTREAM: sched/fair: Move select_task_rq_fair() slow-path into its own function
  UPSTREAM: sched/fair: Force balancing on NOHZ balance if local group has capacity
  UPSTREAM: f2fs: fix potential panic during fstrim
  f2fs: catch up to v4.14-rc1
  UPSTREAM: sched: use load_avg for selecting idlest group
  UPSTREAM: sched: fix find_idlest_group for fork
  ANDROID: binder: fix node sched policy calculation
  ANDROID: binder: init desired_prio.sched_policy before use it
  BACKPORT: net: xfrm: support setting an output mark.
  FROMLIST: tracing: Add support for preempt and irq enable/disable events
  FROMLIST: tracing: Prepare to add preempt and irq trace events

Conflicts:
	arch/arm64/Kconfig
	arch/arm64/include/asm/assembler.h
	arch/arm64/include/asm/cpucaps.h
	arch/arm64/include/asm/efi.h
	arch/arm64/include/asm/memory.h
	arch/arm64/include/asm/mmu.h
	arch/arm64/include/asm/mmu_context.h
	arch/arm64/kernel/cpufeature.c
	arch/arm64/kernel/io.c
	arch/arm64/kernel/setup.c
	arch/arm64/kernel/vdso.c
	arch/arm64/mm/context.c
	arch/arm64/mm/mmu.c
	drivers/Kconfig
	drivers/Makefile
	drivers/cpufreq/Kconfig
	drivers/hwtracing/coresight/coresight-etm4x.c
	drivers/hwtracing/coresight/coresight-priv.h
	drivers/hwtracing/coresight/coresight-tmc-etr.c
	drivers/hwtracing/coresight/coresight.c
	drivers/scsi/ufs/ufshcd.h
	drivers/staging/android/ion/ion-ioctl.c
	drivers/staging/android/ion/ion_system_heap.c
	drivers/usb/dwc3/gadget.c
	include/linux/sched.h
	include/trace/events/sched.h
	kernel/kcov.c
	kernel/sched/core.c
	kernel/sched/cpufreq_sched.c
	kernel/sched/cpufreq_schedutil.c
	kernel/sched/fair.c
	kernel/sched/sched.h
	kernel/sched/walt.c
	kernel/sched/walt.h
	mm/kasan/report.c
	security/security.c
	security/selinux/hooks.c

Change-Id: I0ec8cbca6cb6384e22fbbe8def8a9d228229dc48
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-03-19 04:18:31 -07:00
Maria Yu
4481a7df4f PM / devfreq: bw_hwmon: use unsigned parameter for bytes_to_mbps
In bytes_to_mbps function, the parameter is all unsigned,
so change the decleration of the function to include unsigned long
long to avoid compilation errors in 32 bit environment.
Also changed the return value as unsigned long to avoid
any data loss possible in 64 bit environment.

Change-Id: Ib3906bb4bc16086ae343764c5a718f6f005428c5
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
2018-03-05 15:03:04 +08:00
David Dai
272c4ce82e dev_freq: devfreq_spdm: add null terminator to prevent OOB access
Add null terminator to end of buffered copied from user to prevent
over reading.

Change-Id: I80cfcb087ea2c335fd65d8fcdaf372c7d34a533d
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Signed-off-by: phanendra yarra <pyarra@codeaurora.org>
2018-02-26 08:38:17 -08:00
Bjorn Andersson
b3685e8e2b PM / devfreq: Propagate error from devfreq_add_device()
commit d1bf2d30728f310f72296b54f0651ecdb09cbb12 upstream.

Propagate the error of devfreq_add_device() in devm_devfreq_add_device()
rather than statically returning ENOMEM. This makes it slightly faster
to pinpoint the cause of a returned error.

Fixes: 8cd84092d3 ("PM / devfreq: Add resource-managed function for devfreq device")
Cc: stable@vger.kernel.org
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22 15:43:52 +01:00
Linux Build Service Account
fcb32a6551 Merge "Revert "ARM: dts: msm: add MID details for BWMON counter in sdm670"" 2018-01-11 07:30:10 -08:00
Santosh Mardi
2aa2326167 PM / devfreq: disable certain interrupts events
As per the current algorithm the driver is only interested
in interrupts arising due to certain thresholds being crossed.
Program interrupt registers such that only those interrupts are
handled and the rest are ignored.

Change-Id: I8e344c28967a36f96116db5c1e8a2aa00883e948
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2018-01-10 14:26:59 +05:30
Maria Yu
e9293b044c devfreq: spdm: Fix for rpm creat request err
ERR value or NULL may returned from msm_rpm_create_request,
so correct the check as IS_ERR_OR_NULL.

Change-Id: I069f3c74e5d699ce394355dda192b662ba75f6a0
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
2018-01-04 17:42:54 +08:00
Odelu Kukatla
7382075343 devfreq: spdm: Add snapshot of devfreq-spdm driver
This is a snapshot of the devfreq-spdm driver as of msm-3.18
'commit fa156811a90f ("ASoC: msm: enable group config for both
tx and rx").

Change-Id: I11fbcbfbca8b9bc30b9b43d08557fd5774e1444d
Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org>
2017-12-18 21:32:14 -08:00
Linux Build Service Account
fcc6981b01 Merge "PM / devfreq: memlat: Add support for compute-bound logic" 2017-11-07 03:49:42 -08:00
Jonathan Avila
e71f95f68b PM / devfreq: memlat: Add support for compute-bound logic
Currently, an entirely separate governor is used to handle compute-bound
cases.  Roll this functionality into the existing memlat governor and
allow devices to choose which logic to target by specifying different
drivers in the 'compatible' field.

Change-Id: I8dc41bf0474309c3564dec8e6c813511b8a7fc02
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
2017-11-06 15:03:02 -08:00
Saravana Kannan
8b71d22c56 PM / devfreq: bw_hwmon: Delete "low power mode" feature
This feature didn't really give any power savings when tested on multiple
platforms. The tunables that come with this feature just make the
configuration of normal io_percent unnecessarily confusing. So, delete the
unused feature and the corresponding tunables.

Change-Id: I4a5ac4e627aa801fd6804eb3ad5672057b1ebf56
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2017-10-30 15:37:44 -07:00
Linux Build Service Account
411a7a1188 Merge "Merge remote-tracking branch '4.9/tmp-05a906d' into msm-4.9" 2017-10-24 19:57:25 -07:00
Kyle Yan
cd02e634b8 Merge remote-tracking branch '4.9/tmp-379e3b2' into 4.9
* 4.9/tmp-379e3b2:
  ANDROID: binder: fix transaction leak.
  ANDROID: binder: Add tracing for binder priority inheritance.
  Linux 4.9.53
  swiotlb-xen: implement xen_swiotlb_dma_mmap callback
  video: fbdev: aty: do not leak uninitialized padding in clk to userspace
  KVM: VMX: use cmpxchg64
  cxl: Fix driver use count
  KVM: VMX: remove WARN_ON_ONCE in kvm_vcpu_trigger_posted_interrupt
  KVM: VMX: do not change SN bit in vmx_update_pi_irte()
  timer/sysclt: Restrict timer migration sysctl values to 0 and 1
  gfs2: Fix debugfs glocks dump
  x86/fpu: Don't let userspace set bogus xcomp_bv
  x86/mm: Fix fault error path using unsafe vma pointer
  btrfs: prevent to set invalid default subvolid
  btrfs: propagate error to btrfs_cmp_data_prepare caller
  btrfs: fix NULL pointer dereference from free_reloc_roots()
  PCI: Fix race condition with driver_override
  etnaviv: fix gem object list corruption
  xfs: validate bdev support for DAX inode flag
  kvm: nVMX: Don't allow L2 to access the hardware CR8
  KVM: VMX: Do not BUG() on out-of-bounds guest IRQ
  kvm/x86: Handle async PF in RCU read-side critical sections
  KVM: VMX: simplify and fix vmx_vcpu_pi_load
  KVM: VMX: avoid double list add with VT-d posted interrupts
  KVM: VMX: extract __pi_post_block
  arm64: fault: Route pte translation faults via do_translation_fault
  arm64: Make sure SPsel is always set
  seccomp: fix the usage of get/put_seccomp_filter() in seccomp_get_filter()
  selftests/seccomp: Support glibc 2.26 siginfo_t.h
  iw_cxgb4: put ep reference in pass_accept_req()
  iw_cxgb4: remove the stid on listen create failure
  bsg-lib: don't free job in bsg_prepare_job
  nl80211: check for the required netlink attributes presence
  vfs: Return -ENXIO for negative SEEK_HOLE / SEEK_DATA offsets
  SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags
  SMB: Validate negotiate (to protect against downgrade) even if signing off
  SMB3: Warn user if trying to sign connection that authenticated as guest
  Fix SMB3.1.1 guest authentication to Samba
  PM: core: Fix device_pm_check_callbacks()
  s390/mm: fix write access check in gup_huge_pmd()
  powerpc/ftrace: Pass the correct stack pointer for DYNAMIC_FTRACE_WITH_REGS
  powerpc/tm: Flush TM only if CPU has TM feature
  powerpc/pseries: Fix parent_dn reference leak in add_dt_node()
  KEYS: prevent KEYCTL_READ on negative key
  KEYS: prevent creating a different user's keyrings
  KEYS: fix writing past end of user-supplied buffer in keyring_read()
  security/keys: rewrite all of big_key crypto
  security/keys: properly zero out sensitive key material in big_key
  crypto: talitos - fix hashing
  crypto: talitos - fix sha224
  crypto: talitos - Don't provide setkey for non hmac hashing algs.
  crypto: drbg - fix freeing of resources
  drm/radeon: disable hard reset in hibernate for APUs
  scsi: scsi_transport_iscsi: fix the issue that iscsi_if_rx doesn't parse nlmsg properly
  md/raid5: preserve STRIPE_ON_UNPLUG_LIST in break_stripe_batch_list
  md/raid5: fix a race condition in stripe batch
  tracing: Erase irqsoff trace with empty write
  tracing: Fix trace_pipe behavior for instance traces
  KVM: PPC: Book3S HV: Protect updates to spapr_tce_tables list
  KVM: PPC: Book3S: Fix race and leak in kvm_vm_ioctl_create_spapr_tce()
  genirq: Make sparse_irq_lock protect what it should protect
  mac80211: flush hw_roc_start work before cancelling the ROC
  mac80211_hwsim: Use proper TX power
  mac80211: fix VLAN handling with TXQs
  fs/proc: Report eip/esp in /prod/PID/stat for coredumping
  cifs: release auth_key.response for reconnect.
  cifs: release cifs root_cred after exit_cifs
  ANDROID: add script to fetch android kernel config fragments
  FROMLIST: binder: fix use-after-free in binder_transaction()
  UPSTREAM: ipv6: fib: Unlink replaced routes from their nodes
  Linux 4.9.52
  bcache: fix bch_hprint crash and improve output
  bcache: fix for gc and write-back race
  bcache: Correct return value for sysfs attach errors
  bcache: correct cache_dirty_target in __update_writeback_rate()
  bcache: do not subtract sectors_to_gc for bypassed IO
  bcache: Fix leak of bdev reference
  bcache: initialize dirty stripes in flash_dev_run()
  PM / devfreq: Fix memory leak when fail to register device
  media: uvcvideo: Prevent heap overflow when accessing mapped controls
  media: v4l2-compat-ioctl32: Fix timespec conversion
  s390/mm: fix race on mm->context.flush_mm
  s390/mm: fix local TLB flushing vs. detach of an mm address space
  net/netfilter/nf_conntrack_core: Fix net_conntrack_lock()
  PCI: pciehp: Report power fault only once until we clear it
  PCI: shpchp: Enable bridge bus mastering if MSI is enabled
  ARC: Re-enable MMU upon Machine Check exception
  tracing: Apply trace_clock changes to instance max buffer
  tracing: Add barrier to trace_printk() buffer nesting modification
  ftrace: Fix memleak when unregistering dynamic ops when tracing disabled
  ftrace: Fix selftest goto location on error
  scsi: qla2xxx: Fix an integer overflow in sysfs code
  scsi: qla2xxx: Correction to vha->vref_count timeout
  scsi: sg: fixup infoleak when using SG_GET_REQUEST_TABLE
  scsi: sg: factor out sg_fill_request_table()
  scsi: sg: off by one in sg_ioctl()
  scsi: sg: use standard lists for sg_requests
  scsi: sg: remove 'save_scat_len'
  scsi: storvsc: fix memory leak on ring buffer busy
  scsi: megaraid_sas: Return pended IOCTLs with cmd_status MFI_STAT_WRONG_STATE in case adapter is dead
  scsi: megaraid_sas: Check valid aen class range to avoid kernel panic
  scsi: megaraid_sas: set minimum value of resetwaittime to be 1 secs
  scsi: zfcp: trace high part of "new" 64 bit SCSI LUN
  scsi: zfcp: trace HBA FSF response by default on dismiss or timedout late response
  scsi: zfcp: fix payload with full FCP_RSP IU in SCSI trace records
  scsi: zfcp: fix missing trace records for early returns in TMF eh handlers
  scsi: zfcp: fix passing fsf_req to SCSI trace on TMF to correlate with HBA
  scsi: zfcp: fix capping of unsuccessful GPN_FT SAN response trace records
  scsi: zfcp: add handling for FCP_RESID_OVER to the fcp ingress path
  scsi: zfcp: fix queuecommand for scsi_eh commands when DIX enabled
  skd: Submit requests to firmware before triggering the doorbell
  skd: Avoid that module unloading triggers a use-after-free
  md/bitmap: disable bitmap_resize for file-backed bitmaps.
  block: Relax a check in blk_start_queue()
  powerpc: Fix DAR reporting when alignment handler faults
  ext4: fix quota inconsistency during orphan cleanup for read-only mounts
  ext4: fix incorrect quotaoff if the quota feature is enabled
  crypto: AF_ALG - remove SGL terminator indicator when chaining
  crypto: ccp - Fix XTS-AES-128 support on v5 CCPs
  MIPS: math-emu: <MADDF|MSUBF>.D: Fix accuracy (64-bit case)
  MIPS: math-emu: <MADDF|MSUBF>.S: Fix accuracy (32-bit case)
  MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Clean up "maddf_flags" enumeration
  MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix some cases of zero inputs
  MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix some cases of infinite inputs
  MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix NaN propagation
  MIPS: math-emu: Handle zero accumulator case in MADDF and MSUBF separately
  MIPS: math-emu: MINA.<D|S>: Fix some cases of infinity and zero inputs
  MIPS: math-emu: <MAXA|MINA>.<D|S>: Fix cases of both infinite inputs
  MIPS: math-emu: <MAXA|MINA>.<D|S>: Fix cases of input values with opposite signs
  MIPS: math-emu: <MAX|MIN>.<D|S>: Fix cases of both inputs negative
  MIPS: math-emu: <MAX|MAXA|MIN|MINA>.<D|S>: Fix cases of both inputs zero
  MIPS: math-emu: <MAX|MAXA|MIN|MINA>.<D|S>: Fix quiet NaN propagation
  Input: i8042 - add Gigabyte P57 to the keyboard reset table
  pinctrl/amd: save pin registers over suspend/resume
  tty: fix __tty_insert_flip_char regression
  tty: improve tty_insert_flip_char() slow path
  tty: improve tty_insert_flip_char() fast path
  IB/addr: Fix setting source address in addr6_resolve()
  drm/sun4i: Implement drm_driver lastclose to restore fbdev console
  IB/{qib, hfi1}: Avoid flow control testing for RDMA write operation
  orangefs: Don't clear SGID when inheriting ACLs
  mm: prevent double decrease of nr_reserved_highatomic
  NFSv4: Fix callback server shutdown
  SUNRPC: Refactor svc_set_num_threads()
  UPSTREAM: drm/atomic: Handle -EDEADLK with out-fences correctly
  UPSTREAM: sched/fair: Fix FTQ noise bench regression
  UPSTREAM: fib_rules: fix error return code
  UPSTREAM: ipv4: add missing initialization for flowi4_uid
  ANDROID: Squashfs: optimize reading uncompressed data
  ANDROID: Squashfs: implement .readpages()
  ANDROID: Squashfs: replace buffer_head with BIO
  ANDROID: Squashfs: refactor page_actor
  ANDROID: Squashfs: remove the FILE_CACHE option
  FROMLIST: android: binder: Don't get mm from task
  FROMLIST: android: binder: Remove unused vma argument
  FROMLIST: android: binder: Drop lru lock in isolate callback
  ANDROID: Use sk_uid to replace uid get from socket file
  ANDROID: nf: xt_qtaguid: fix handling for cases where tunnels are used.
  Revert "ANDROID: Use sk_uid to replace uid get from socket file"
  ANDROID: USB gadget: mtp: Fix hang in ioctl(MTP_RECEIVE_FILE) for WritePartialObject

Conflicts:
	drivers/android/binder_alloc.c
	drivers/media/v4l2-core/v4l2-compat-ioctl32.c
	drivers/scsi/sg.c
	drivers/usb/gadget/function/f_mtp.c
	net/netfilter/xt_qtaguid.c
	net/wireless/nl80211.c

Change-Id: I6af673bd4b920bb229fe238a3e96b2330fa18263
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
2017-10-17 14:48:18 -07:00
Linux Build Service Account
029f60a8e5 Merge "PM / devfreq: memlat: Look for min stall% in addition to ratio criteria" 2017-10-11 16:37:05 -07:00
Linux Build Service Account
b7da61d284 Merge "PM / devfreq: bw_hwmon: Fix event-based race condition" 2017-10-11 16:36:56 -07:00
Saravana Kannan
83f2846e94 PM / devfreq: memlat: Look for min stall% in addition to ratio criteria
Some workloads doing memory access might appear memory latency bound even
though they might not actually be memory latency bound.

This error can happen when the core that's running the workload is very
parallelized or can do out of order executions, etc so not all memory
accesses would actually stall the core.

This can also happen when the the memory access monitoring capabilities
aren't ideal and end up counting more kinds of memory accesses than what
would be ideal. In this case, the IPM ratio can be lower than what it would
be if we had ideal monitoring capabilities.

To account for these errors, if the core has a stall cycle counting
capabilities, check for a minimum stall% before the workload is considered
memory latency bound. This would help reduce the inaccuracies, but is not a
replacement for IPM ratio scheme because the stall% method doesn't allow us
to detect which level of memory the workload is latency bound on, but the
IPM ratio does (based on which memory accesses we use for calculating the
ratio).

Change-Id: I4363d7848584e5562f6683b5ad6b0f99017ec71b
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2017-10-10 15:00:20 -07:00
Jonathan Avila
52593752cc PM / devfreq: bw_hwmon: Fix event-based race condition
Two events caused by sysfs writes to the bw_hwmon governor, when properly
interleaved, can lead to a race condition due to needing to stop and
restart the hardware monitor.  Fix this by adding locking to the event
handler.

Change-Id: I85c120ac0cf53f59ec12b8f56aed494acc446258
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
2017-10-10 08:46:42 -07:00
Saravana Kannan
45994ff9d6 PM / devfreq: bimc-bwmon: Don't always round up BWMON5 measurements
All BWMON5 counters currently have very coarse resolution. So, rounding up
to the next resolvable measurement results in very high bandwidth
measurement event for use cases that generate almost no traffic. So,
instead of always rounding up to the next resolvable measurement, round up
only when the measurement is non-zero.

Change-Id: I347c9a9a3863291d2b94a4530d32faf2b1e996e0
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2017-10-02 15:57:41 -07:00
Saravana Kannan
52978b96a0 PM / devfreq: arm-memlat-mon: Simplify event initialization code
Instead of repeating the event initialization code for each event, just
keep an array of events and initialize them all using a for loop.

Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Change-Id: Id35078953aaecb1cb0a8b64980d92e873c4e6cb5
2017-09-29 16:13:24 -07:00
Saravana Kannan
a0ecf0067d PM / devfreq: memlat: Improve tracing of stats and votes
When the memlat governor votes for 0, it didn't generate any "update" trace
points to avoid spamming the trace buffer. But this can sometimes make it
harder to interpret some traces logs.

So, as a middle ground betweem making the trace harder to interpret vs
spamming the trace buffer, generate one trace point, when the vote
transitions from a non-zero value to a zero.

At the same time, the memlat governor was also generating "meas" trace
points for completely idle cores during every polling interval. This causes
a significant amount of spamming of the trace buffer. So, when a core is
idle, don't generate any "meas" trace points for it.

Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Change-Id: I3c72cde87bf56e45e31cc04fc4f80c030eed1e1a
2017-09-29 16:13:14 -07:00
Saravana Kannan
62e41b4473 PM / devfreq: arm-memlat-mon: Delete event count overflow handling code
The event counts that are u64 are unlikely to overflow before the system is
rebooted. And even if we never reboot the system in 100+ years and the
event counts overflow and we don't handle it, the worst case behavior would
be voting for the wrong memory frequency (bad power/performance) for a few
milliseconds. This extra code is definitely not worth it.

Change-Id: Ia7c8ac3966e96e6bc123bb26dfdba3ccae1e4a4c
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2017-09-28 19:36:43 -07:00
Chanwoo Choi
f5c3fd8328 PM / devfreq: Fix memory leak when fail to register device
commit 9e14de1077e9c34f141cf98bdba60cdd5193d962 upstream.

When the devfreq_add_device fails to register deivce, the memory
leak of devfreq instance happen. So, this patch fix the memory
leak issue. Before freeing the devfreq instance checks whether
devfreq instance is NULL or not because the device_unregister()
frees the devfreq instance when jumping to the 'err_init'.
It is to prevent the duplicate the kfee(devfreq).

Fixes: ac4b281176 ("PM / devfreq: fix duplicated kfree on devfreq pointer")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-27 14:39:24 +02:00
Saravana Kannan
6f67be817a PM / devfreq: memlat: Don't ignore extremely latency sensitive workloads
The ratio value that's compared against ratio_ceil tunable can be 0 for
workloads that are extremely latency sensitive. So, we can't ignore cores
that have a ratio of 0 (which was done to ignore idle cores). So, stop
ignoring cores with a ratio of 0 and instead check for instruction or
frequency being 0 to identify idle cores.

Change-Id: I8c6c14f374f016e6612c3b834589d065bad8f488
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2017-09-07 22:28:59 -07:00
Deepak Kumar
b668b4ef09 adreno_tz: Correct tz_buf pointer type to correct pointer arithmetic
Current tz_buf pointer type is causing the end address calcultion
of tz_buf to go wrong. "end_addr = tz_buf + PAGE_ALIGN(size)" is
resulting in an end address way beyond the allocated range because
tz_buf is of type unsigned int. This change changes the tz_buf
pointer type to u8 to fix this issue.

Change-Id: I16db09c565801b56c0c0ee8a8184f6e276512fa3
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-07-06 13:14:50 +05:30
Rohit Gupta
aa422df8ab devfreq: simple-dev: Make the freq-table property optional
The call to devfreq_add_device() tries to initialize frequency tables
for simple-dev. This can be a more efficient way of setting up
frequency tables in case there are multiple tables for a single device
depending on hardware version.
Make 'freq-tbl-khz' property an optional one so that probe doesn't
fail in its absence and devfreq_add_device() also gets a chance to
set up the freq table for simple-dev.

Change-Id: I96b5c2d4aef2085512d94dc6792f5ba2711de64b
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2017-06-15 18:12:35 -07:00
Linux Build Service Account
92b0fef624 Merge "adreno_tz: Remove unnecessary devfreq NULL check in tz_handler()" into msm-4.9 2017-06-01 10:42:28 -07:00
Hareesh Gundu
cb6c273fa2 adreno_tz: Remove unnecessary devfreq NULL check in tz_handler()
Caller of tz_handler() is having the NULL check for devfreq,So
we don’t need unnecessary NULL pointer check.

CRs-Fixed: 2046922
Change-Id: I42eb70ab19b4a5af193521d77bca86447a1ecdb8
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Signed-off-by: Abhilash Kumar <krabhi@codeaurora.org>
2017-06-01 15:37:28 +05:30
Santosh Mardi
19f4e0dace PM / devfreq: update macro GOVERNOR_BW_HWMON_H in memlat.
In memlat driver we should not use GOVERNOR_BW_HWMON
instead use GOVERNOR_MEMLAT_H.

Change-Id: Ie21259a990deecd1a90391157c72e59b5e72b252
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2017-05-25 19:10:50 +05:30
Linux Build Service Account
59af454625 Merge "PM / devfreq: memlat: Move per-CPU stats inside device nodes" into msm-4.9 2017-05-16 10:59:00 -07:00
Rohit Gupta
bb3ac62b94 PM / devfreq: memlat: Move per-CPU stats inside device nodes
Currently each memlat monitor stores details such as previous sample
timestamp and perf counts in per-CPU structures. This can result in
multiple monitors overwriting each others' data.
Move these stats within per device structures so that each of the
monitors have exclusive access to them.

Change-Id: I0a60e95eebd72f0e602cbf9cba05380324b75b3f
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2017-05-15 16:30:42 -07:00
Stephen Boyd
6d867b909d PM / devfreq: bw_hwmon: Add support for specifying count factor
Not all bandwidth monitors count in units of 1MB. Add a DT
property that indicates the number of bytes the monitor counts in
so we can properly scale the count we read from the hardware to
reflect the traffic. By default, we will assume 1MB units if the
property doesn't exist.

Change-Id: I1b581b2fffda04ba151df6e87221628368ff5b17
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2017-05-15 11:57:26 -07:00
Stephen Boyd
a510acd9f9 PM / devfreq: bw_hwmon: Add support for configuring byte MID match
Add support to configure the byte MID match value from DT.

Change-Id: I5848aef98f15c6de9fe0fae0a1188a17810a5ef5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2017-05-15 11:57:24 -07:00
Stephen Boyd
d863ed16c3 PM / devfreq: bw_hwmon: Add support for BWMON5 monitors
Add support for the fifth type of bandwidth monitor. This monitor
is similar to the other types of monitors, but the register
offset is slightly different, and it doesn't have a global
interrupt base.

Change-Id: Ib05602832b6d4712b783ebaaa5aae9e60c00e30b
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2017-05-15 11:56:23 -07:00
Stephen Boyd
d16cd622f0 PM / devfreq: bw_hwmon: Rename bwmon_type enum to confuse less
It's confusing to think of the monitor register interface types
as the bw monitor type, because we already have a compatible
string in DT for the bw monitor type that isn't following the
same numbering scheme. Rename this to MON1, MON2 so that we don't
confuse it with the compatible scheme of bwmon1, bwmon2, bwmon3,
etc.

Change-Id: I406fc09ab8b9c72c43135e3deac2a382bfca9f0e
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2017-05-11 13:33:01 -07:00
Linux Build Service Account
ab6cb71d85 Merge "PM / devfreq: bw_hwmon: Fix parsing of mbps_zones" into msm-4.9 2017-05-02 10:48:52 -07:00
Linux Build Service Account
fb205d5503 Merge "PM / devfreq: bw_hwmon: Split out sw and hw paths" into msm-4.9 2017-05-01 11:08:50 -07:00
Rohit Gupta
fe241a08e4 PM / devfreq: bw_hwmon: Fix parsing of mbps_zones
store_list_mbps_zones() uses kstrtoint() to parse the list of
integers. kstrtoint() accepts only null or newline terminated
strings as inputs and thus trying to echo a space separated list of
values into mbps_zones fails.
This patch fixes the parsing logic.

Change-Id: Ibc3e34638b589846a4ee6684db8d1ef09359c0ab
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2017-04-28 16:18:33 -07:00
Linux Build Service Account
239318833a Merge "PM / devfreq: bw_hwmon: Reflow some code" into msm-4.9 2017-04-28 10:59:29 -07:00
Linux Build Service Account
f89d94cd6b Merge "FROMLIST: PM / devfreq: set min/max freq limit from freq table" into msm-4.9 2017-04-27 14:33:14 -07:00
Linux Build Service Account
ea09d373f1 Merge "PM / devfreq: bw_hwmon: irq can be negative" into msm-4.9 2017-04-25 11:35:44 -07:00
Rajagopal Venkat
f517b3a4a7 FROMLIST: PM / devfreq: set min/max freq limit from freq table
Set devfreq device min and max frequency limits when device
is added to devfreq, provided frequency table is supplied.
This helps governors to suggest target frequency with in
limits.

Change-Id: Iab24aef59bfeffcfb3c3118c12ba58e25cd9d479
Signed-off-by: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Patch-mainline: linux-pm @ 01/08/13, 05:50
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
2017-04-24 16:44:42 -07:00
Stephen Boyd
a59c9182fa PM / devfreq: bw_hwmon: Split out sw and hw paths
Let's split out the sw and hw counter configuration code paths
indicated by has_hw_sampling() into inline functions for the two
different types of monitors. This allows us to add different
types of monitors in the future with minimal changes.

Change-Id: I5cf6a1fe4d84ee0958fe68601cb1e76836d10256
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2017-04-13 14:19:14 -07:00
Stephen Boyd
58b0a9432f PM / devfreq: bw_hwmon: Reflow some code
Fix up style in this driver probe routine to use newer mechanisms
like of_device_get_match_data() and to not use things like
addresses of functions to assign function pointers. This makes
the code more readable.

Change-Id: Ib07edc0051fe9319e9a40cda7ba79646ce59b7e4
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2017-04-13 14:19:13 -07:00
Stephen Boyd
eee4508884 PM / devfreq: bw_hwmon: irq can be negative
platform_get_irq() can return a negative number, but we assign it
to an unsigned integer, which can never be negative. Change the
type to int here so that we can detect irq errors.

Change-Id: I997063abfe5c9966f99014a099619e6bfe7aafe7
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2017-04-13 14:19:13 -07:00
Oleg Perelet
5d61210758 msm: kgsl: Add GPU bus governor from the msm-4.4 to msm-4.9
Adding the snapshot of the files from the msm-4.4 to msm-4.9.
Base commit in msm-4.4 tree is
Commit-Id: 8df0f9ec1df7b281f0a7a0f29321a90d19b3e381.

CRs-Fixed: 2017390
Change-Id: I45122ca1f0d1f7e443e7cdf1374e662625f17ee4
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2017-04-12 15:28:42 -07:00
Linux Build Service Account
920f7321eb Merge "devfreq: Kconfig: Use QTI properly" into msm-4.9 2017-04-05 10:45:18 -07:00
Stephen Boyd
f5dc008d39 devfreq: Kconfig: Use QTI properly
Replace instances of QCOM with QTI.

Change-Id: I0c8c52bcd8dd496ebbac569c62bb324befaba735
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2017-04-03 16:47:07 -07:00
Rohit Gupta
3862a343b8 PM / devfreq: memlat: Allow some events to be specified in DT
This patch introduces two new DT properties for the memlat monitor
for specifying PMU event ids for instruction and cache miss events.
This is done in order to minimize changes to driver code in case of
changes to those event ids across targets and maintain backward
compatibility. Additionally it makes it easier to specify multiple
drivers in the DT that can monitor events across multiple cache
levels using different cache miss event ids (provided they are
supported by hardware).

Change-Id: I0c464c80134e25db6304750ff7a98104ee2f0b9c
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2017-03-31 11:01:10 -07:00