# By Daniel Rosenberg (98) and others
# Via Greg Kroah-Hartman (219) and others
* google/common/android-4.4-p:
ANDROID: xt_qtaguid: fix UAF race
ANDROID: Make vsock virtio packet buff size configurable
ANDROID: cuttlefish_defconfig: add missing CONFIG_BLK_CGROUP
ANDROID: xt_qtaguid: Remove tag_entry from process list on untag
ANDROID: usb: f_accessory: Don't drop NULL reference in acc_disconnect()
ANDROID: usb: f_accessory: Avoid bitfields for shared variables
ANDROID: usb: f_accessory: Cancel any pending work before teardown
ANDROID: usb: f_accessory: Don't corrupt global state on double registration
ANDROID: usb: f_accessory: Fix teardown ordering in acc_release()
ANDROID: usb: f_accessory: Add refcounting to global 'acc_dev'
UPSTREAM: locking/atomic, kref: Add KREF_INIT()
ANDROID: usb: f_accessory: Wrap '_acc_dev' in get()/put() accessors
ANDROID: usb: f_accessory: Remove useless assignment
ANDROID: usb: f_accessory: Remove useless non-debug prints
ANDROID: usb: f_accessory: Remove stale comments
ANDROID: USB: f_accessory: Check dev pointer before decoding ctrl request
ANDROID: usb: gadget: f_accessory: fix CTS test stuck
ANDROID: cuttlefish_defconfig: Disable CONFIG_KSM
UPSTREAM: arm64: SW PAN: Point saved ttbr0 at the zero page when switching to init_mm
UPSTREAM: arm64: kaslr: Fix up the kernel image alignment
UPSTREAM: sched/fair: Fix FTQ noise bench regression
UPSTREAM: dm verity fec: fix bufio leaks
UPSTREAM: arm64: kernel: restrict /dev/mem read() calls to linear region
UPSTREAM: binder: fix incorrect cmd to binder_stat_br
UPSTREAM: arm64: SW PAN: Update saved ttbr0 value on enter_lazy_tlb
UPSTREAM: KVM: arm/arm64: Check pagesize when allocating a hugepage at Stage 2
UPSTREAM: fs/proc/kcore.c: use probe_kernel_read() instead of memcpy()
UPSTREAM: arm64: fix unwind_frame() for filtered out fn for function graph tracing
UPSTREAM: arm64: kpti: Use early_param for kpti= command-line option
UPSTREAM: arm64: kaslr: ensure randomized quantities are clean to the PoC
UPSTREAM: arm64: kaslr: ensure randomized quantities are clean also when kaslr is off
UPSTREAM: staging: android: vsoc: fix copy_from_user overrun
UPSTREAM: arm64/mm: Inhibit huge-vmap with ptdump
UPSTREAM: drivers/perf: arm_pmu: Fix failure path in PM notifier
UPSTREAM: fs/posix_acl.c: fix kernel-doc warnings
UPSTREAM: ext2: fix debug reference to ext2_xattr_cache
UPSTREAM: arm64: alternative: fix build with clang integrated assembler
UPSTREAM: dm verity fec: fix hash block number in verity_fec_decode
ANDROID: Temporarily disable XFRM_USER_COMPAT filtering
BACKPORT: xfrm/compat: Translate 32-bit user_policy from sockptr
BACKPORT: xfrm/compat: Add 32=>64-bit messages translator
UPSTREAM: xfrm/compat: Attach xfrm dumps to 64=>32 bit translator
BACKPORT: xfrm/compat: Add 64=>32-bit messages translator
BACKPORT: xfrm: Provide API to register translator module
UPSTREAM: mm/sl[uo]b: export __kmalloc_track(_node)_caller
ANDROID: Publish uncompressed Image on aarch64
ANDROID: Makefile: append BUILD_NUMBER to version string when defined
UPSTREAM: binder: fix UAF when releasing todo list
ANDROID: fix a bug in quota2
UPSTREAM: binder: Prevent context manager from incrementing ref 0
BACKPORT: xtables: extend matches and targets with .usersize
UPSTREAM: ip6tables: use match, target and data copy_to_user helpers
UPSTREAM: iptables: use match, target and data copy_to_user helpers
UPSTREAM: xtables: add xt_match, xt_target and data copy_to_user functions
ANDROID: cuttlefish_defconfig: Drop built-in cmdline (except nopti)
ANDROID: cuttlefish defconfig - enable mount/net/uts namespaces.
ANDROID: hid: steam: remove BT controller matching
UPSTREAM: HID: steam: Fix input device disappearing
Revert "ext2: fix empty body warnings when -Wextra is used"
Revert "net: ipv6: Fix processing of RAs in presence of VRF"
UPSTREAM: net: socket: set sock->sk to NULL after calling proto_ops::release()
BACKPORT: xfrm: Allow Output Mark to be Updated Using UPDSA
UPSTREAM: socket: close race condition between sock_close() and sockfs_setattr()
UPSTREAM: net: ipv6: Use passed in table for nexthop lookups
ANDROID: cuttlefish_defconfig: Fix dm-verity related options
Revert "ANDROID: dm verity: add minimum prefetch size"
ANDROID: mnt: Propagate remount correctly
BACKPORT: loop: Add LOOP_SET_BLOCK_SIZE in compat ioctl
UPSTREAM: loop: drop caches if offset or block_size are changed
UPSTREAM: loop: add ioctl for changing logical block size
BACKPORT: block/loop: set hw_sectors
ANDROID: cuttlefish_defconfig: Minimally enable EFI
UPSTREAM: bpf: Explicitly memset the bpf_attr structure
FROMLIST: HID: nintendo: add nintendo switch controller driver
UPSTREAM: staging: most: net: fix buffer overflow
UPSTREAM: ALSA: pcm: Add missing copy ops check before clearing buffer
ANDROID: selinux: modify RTM_GETLINK permission
UPSTREAM: HID: input: map digitizer battery usage
UPSTREAM: HID: input: ignore the battery in OKLICK Laser BTmouse
ANDROID: cuttlefish_defconfig: Disable TRANSPARENT_HUGEPAGE
commit e82b9b0727ff ("vhost: introduce vhost_exceeds_weight()")
UPSTREAM: HID: steam: fix deadlock with input devices.
UPSTREAM: HID: steam: fix boot loop with bluetooth firmware
UPSTREAM: HID: steam: remove input device when a hid client is running.
UPSTREAM: HID: steam: use hid_device.driver_data instead of hid_set_drvdata()
UPSTREAM: HID: steam: add missing fields in client initialization
UPSTREAM: HID: steam: add battery device.
UPSTREAM: HID: add driver for Valve Steam Controller
UPSTREAM: HID: sony: Fix memory corruption issue on cleanup.
UPSTREAM: HID: sony: Fix race condition between rumble and device remove.
UPSTREAM: HID: sony: remove redundant check for -ve err
UPSTREAM: HID: sony: Make sure to unregister sensors on failure
UPSTREAM: HID: sony: Make DS4 bt poll interval adjustable
UPSTREAM: HID: sony: Set proper bit flags on DS4 output report
UPSTREAM: HID: sony: DS4 use brighter LED colors
UPSTREAM: HID: sony: Improve navigation controller axis/button mapping
UPSTREAM: HID: sony: Use DS3 MAC address as unique identifier on USB
UPSTREAM: HID: sony: Perform duplicate device check earlier on
UPSTREAM: HID: sony: Expose DS3 motion sensors through separate device
UPSTREAM: HID: sony: Print error on failure to active DS3 / Navigation controllers
UPSTREAM: HID: sony: DS3 comply to Linux gamepad spec
UPSTREAM: HID: sony: Mark DS4 touchpad device as a pointer
UPSTREAM: HID: sony: Support motion sensor calibration on dongle
UPSTREAM: HID: sony: Make work handling more generic
UPSTREAM: HID: sony: Treat the ds4 dongle as a separate device
UPSTREAM: HID: sony: Remove report descriptor fixup for DS4
UPSTREAM: HID: sony: Report hardware timestamp for DS4 sensor values
UPSTREAM: HID: sony: Calibrate DS4 motion sensors
UPSTREAM: HID: sony: Report DS4 motion sensors through a separate device
UPSTREAM: HID: sony: Fix input device leak when connecting a DS4 twice using USB/BT
UPSTREAM: HID: sony: Use LED_CORE_SUSPENDRESUME
UPSTREAM: HID: sony: Ignore DS4 dongle reports when no device is connected
UPSTREAM: HID: sony: Use DS4 MAC address as unique identifier on USB
UPSTREAM: HID: sony: Fix error handling bug when touchpad registration fails
UPSTREAM: HID: sony: Comply to Linux gamepad spec for DS4
UPSTREAM: HID: sony: Make the DS4 touchpad a separate device
UPSTREAM: HID: sony: Fix memory issue when connecting device using both Bluetooth and USB
UPSTREAM: HID: sony: Adjust value range for motion sensors
UPSTREAM: HID: sony: Handle multiple touch events input record
UPSTREAM: HID: sony: Send ds4 output reports on output end-point
UPSTREAM: HID: sony: Perform CRC check on bluetooth input packets
UPSTREAM: HID: sony: Adjust HID report size name definitions
UPSTREAM: HID: sony: Fix race condition in sony_probe
UPSTREAM: HID: sony: Update copyright and add Dualshock 4 rate control note
UPSTREAM: HID: sony: Defer the initial USB Sixaxis output report
UPSTREAM: HID: sony: Relax duplicate checking for USB-only devices
UPSTREAM: HID: sony: underscores are unnecessary for u8, u16, s32
UPSTREAM: HID: sony: fix some warnings from scripts/checkpatch.pl
UPSTREAM: HID: sony: fix errors from scripts/checkpatch.pl
UPSTREAM: HID: sony: fix a typo in descriptors comments s/Joystik/Joystick/
UPSTREAM: HID: sony: Fixup output reports for the nyko core controller
UPSTREAM: HID: sony: Remove the size check for the Dualshock 4 HID Descriptor
UPSTREAM: HID: sony: Save and restore the controller state on suspend and resume
UPSTREAM: HID: sony: Refactor the output report sending functions
ANDROID: cpufreq: times: add /proc/uid_concurrent_{active,policy}_time
rtlwifi: Fix potential overflow on P2P code
ANDROID: clang: update to 9.0.8 based on r365631c
ANDROID: move up spin_unlock_bh() ahead of remove_proc_entry()
ANDROID: refactor build.config files to remove duplication
ANDROID: usb: gadget: Fix dependency for f_accessory
Remove taskname from lowmemorykiller kill reports
ANDROID: Fixes to locking around handle_lmk_event
Revert "ANDROID: regression introduced override_creds=off"
ANDROID: regression introduced override_creds=off
Fix fallout from changes to bootparam_utils.h
ANDROID: sched: Disallow WALT with CFS bandwidth control
ANDROID: fiq_debugger: remove
ANDROID: arm64: fix leftover RWX when using CONFIG_UNMAP_KERNEL_AT_EL0
ANDROID: fix kernelci build-break in lowmemorykiller
ANDROID: Avoid taking multiple locks in handle_lmk_event
UPSTREAM: net-ipv6-ndisc: add support for RFC7710 RA Captive Portal Identifier
ANDROID: fix binder change in merge of 4.4.183
Fix overlayfs build break
binder: binder: fix possible UAF when freeing buffer
ANDROID: Revert "f2fs: avoid out-of-range memory access"
ANDROID: overlayfs: Fix a regression in commit b24be4acd
ANDROID: enable CONFIG_RTC_DRV_TEST on cuttlefish
ANDROID: xfrm: remove in_compat_syscall() checks
BACKPORT: binder: Set end of SG buffer area properly.
UPSTREAM: binder: check for overflow when alloc for security context
BACKPORT: binder: fix race between munmap() and direct reclaim
ANDROID: cuttlefish 4.4: enable CONFIG_CRYPTO_AES_NI_INTEL=y
ANDROID: cuttlefish_defconfig: Disable DEVTMPFS
ANDROID: cuttlefish_defconfig: Enable CONFIG_CPUSETS and CONFIG_CGROUP_SCHEDTUNE
ANDROID: cuttlefish_defconfig: Drop dead CRYPTO options
UPSTREAM: virtio: new feature to detect IOMMU device quirk
UPSTREAM: vring: Use the DMA API on Xen
UPSTREAM: virtio_ring: Support DMA APIs
UPSTREAM: vring: Introduce vring_use_dma_api()
ANDROID: cuttlefish_defconfig: L2TP/PPTP to OLAC/OPNS
ANDROID: cuttlefish_defconfig: Enable DEBUG_SET_MODULE_RONX
ANDROID: Fix cuttlefish redundant vsock connection.
ANDROID: cuttlefish_defconfig: Enable CONFIG_RTC_HCTOSYS
ANDROID: Move from clang r349610 to r353983c.
Make arm64 serial port config compatible with crosvm
UPSTREAM: virt_wifi: Remove REGULATORY_WIPHY_SELF_MANAGED
ANDROID: cuttlefish_defconfig: Add support for AC97 audio
ANDROID: Move from clang r346389b to r349610.
ANDROID: cuttlefish_defconfig: Enable vsock options
UPSTREAM: vhost/vsock: fix reset orphans race with close timeout
UPSTREAM: vhost/vsock: fix use-after-free in network stack callers
UPSTREAM: vhost: correctly check the iova range when waking virtqueue
UPSTREAM: vhost: synchronize IOTLB message with dev cleanup
UPSTREAM: vhost: fix info leak due to uninitialized memory
UPSTREAM: vhost: fix vhost_vq_access_ok() log check
UPSTREAM: vhost: validate log when IOTLB is enabled
UPSTREAM: vhost_net: add missing lock nesting notation
UPSTREAM: vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
UPSTREAM: vhost/vsock: fix uninitialized vhost_vsock->guest_cid
UPSTREAM: vhost_net: correctly check tx avail during rx busy polling
UPSTREAM: vsock: use new wait API for vsock_stream_sendmsg()
UPSTREAM: vsock: cancel packets when failing to connect
UPSTREAM: vhost-vsock: add pkt cancel capability
UPSTREAM: vsock: track pkt owner vsock
UPSTREAM: vhost: fix initialization for vq->is_le
UPSTREAM: vhost/vsock: handle vhost_vq_init_access() error
UPSTREAM: vsock: lookup and setup guest_cid inside vhost_vsock_lock
UPSTREAM: vhost-vsock: fix orphan connection reset
UPSTREAM: vsock/virtio: fix src/dst cid format
UPSTREAM: VSOCK: Don't dec ack backlog twice for rejected connections
UPSTREAM: vhost/vsock: drop space available check for TX vq
UPSTREAM: virtio-vsock: fix include guard typo
UPSTREAM: vhost/vsock: fix vhost virtio_vsock_pkt use-after-free
UPSTREAM: VSOCK: Use kvfree()
BACKPORT: vhost: split out vringh Kconfig
UPSTREAM: vhost: drop vringh dependency
UPSTREAM: vhost: drop vringh dependency
UPSTREAM: vhost: detect 32 bit integer wrap around
UPSTREAM: VSOCK: Add Makefile and Kconfig
UPSTREAM: VSOCK: Introduce vhost_vsock.ko
UPSTREAM: VSOCK: Introduce virtio_transport.ko
BACKPORT: VSOCK: Introduce virtio_vsock_common.ko
UPSTREAM: VSOCK: defer sock removal to transports
UPSTREAM: VSOCK: transport-specific vsock_transport functions
UPSTREAM: vsock: make listener child lock ordering explicit
UPSTREAM: vhost: new device IOTLB API
BACKPORT: vhost: convert pre sorted vhost memory array to interval tree
UPSTREAM: vhost: introduce vhost memory accessors
UPSTREAM: vhost_net: stop polling socket during rx processing
UPSTREAM: VSOCK: constify vsock_transport structure
UPSTREAM: vhost: lockless enqueuing
UPSTREAM: vhost: simplify work flushing
UPSTREAM: VSOCK: Only check error on skb_recv_datagram when skb is NULL
BACKPORT: AF_VSOCK: Shrink the area influenced by prepare_to_wait
UPSTREAM: vhost_net: basic polling support
UPSTREAM: vhost: introduce vhost_vq_avail_empty()
UPSTREAM: vhost: introduce vhost_has_work()
UPSTREAM: vhost: rename vhost_init_used()
UPSTREAM: vhost: rename cross-endian helpers
UPSTREAM: vhost: fix error path in vhost_init_used()
UPSTREAM: virtio: make find_vqs() checkpatch.pl-friendly
UPSTREAM: net: move napi_hash[] into read mostly section
ANDROID: cuttlefish_defconfig: Enable VIRTIO_INPUT
ANDROID: cuttlefish_defconfig: Enable VIRT_WIFI
FROMGIT, BACKPORT: mac80211-next: rtnetlink wifi simulation device
ANDROID: Move from clang r328903 to r346389b.
ANDROID: arm64 defconfig / build config for cuttlefish
ANDROID: Communicates LMK events to userland where they can be logged
Fix merge issue with 4.4.178
Fix merge issue with 4.4.177
FROMGIT: binder: create node flag to request sender's security context
ion: Disable ION_HEAP_TYPE_SYSTEM_CONTIG
ANDROID: uid_sys_stats: Copy task_struct comm field to bigger buffer
UPSTREAM: binder: fix race that allows malicious free of live buffer
Makefile: Tidy up 4.4.165 merge
ANDROID: sdcardfs: Change current->fs under lock
ANDROID: sdcardfs: Don't use OVERRIDE_CRED macro
arm64/vdso: Fix nsec handling for CLOCK_MONOTONIC_RAW
ANDROID: arm64: mm: fix 4.4.154 merge
Fix backport of "tcp: detect malicious patterns in tcp_collapse_ofo_queue()"
tcp: detect malicious patterns in tcp_collapse_ofo_queue()
tcp: avoid collapses in tcp_prune_queue() if possible
x86_64_cuttlefish_defconfig: Enable android-verity
x86_64_cuttlefish_defconfig: enable verity cert
ANDROID: Fix massive cpufreq_times memory leaks
ANDROID: Reduce use of #ifdef CONFIG_CPU_FREQ_TIMES
UPSTREAM: binder: replace "%p" with "%pK"
UPSTREAM: binder: free memory on error
UPSTREAM: binder: fix proc->files use-after-free
UPSTREAM: Revert "FROMLIST: binder: fix proc->files use-after-free"
UPSTREAM: ANDROID: binder: change down_write to down_read
UPSTREAM: ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR
UPSTREAM: ANDROID: binder: remove 32-bit binder interface.
UPSTREAM: ANDROID: binder: re-order some conditions
UPSTREAM: android: binder: use VM_ALLOC to get vm area
UPSTREAM: android: binder: Use true and false for boolean values
UPSTREAM: android: binder: Use octal permissions
UPSTREAM: android: binder: Prefer __func__ to using hardcoded function name
UPSTREAM: ANDROID: binder: make binder_alloc_new_buf_locked static and indent its arguments
UPSTREAM: android: binder: Check for errors in binder_alloc_shrinker_init().
cpufreq: Kconfig: Remove CPU_FREQ_DEFAULT_GOV_SCHED
ANDROID: Add kconfig to make dm-verity check_at_most_once default enabled
ANDROID: sdcardfs: fix potential crash when reserved_mb is not zero
ANDROID: Update arm64 ranchu64_defconfig
FROMLIST: f2fs: run fstrim asynchronously if runtime discard is on
goldfish: pipe: ANDROID: address must be written as __pa(x), not x
goldfish: pipe: ANDROID: add missing check for memory allocated
goldfish: pipe: ANDROID: remove redundant blank lines
Update arch/x86/configs/x86_64_ranchu_defconfig
ANDROID: x86_64_cuttlefish_defconfig: Enable F2FS
ANDROID: Update x86_64_cuttlefish_defconfig
FROMLIST: f2fs: early updates queued for v4.18-rc1
Revert "vti4: Don't override MTU passed on link creation via IFLA_MTU"
UPSTREAM: sched/fair: Consider RT/IRQ pressure in capacity_spare_wake
BACKPORT, FROMLIST: fscrypt: add Speck128/256 support
cgroup: Disable IRQs while holding css_set_lock
Revert "cgroup: Disable IRQs while holding css_set_lock"
cgroup: Disable IRQs while holding css_set_lock
ANDROID: proc: fix undefined behavior in proc_uid_base_readdir
x86: vdso: Fix leaky vdso linker with CC=clang.
ANDROID: build: cuttlefish: Upgrade clang to newer version.
ANDROID: build: cuttlefish: Upgrade clang to newer version.
ANDROID: build: cuttlefish: Fix path to clang.
UPSTREAM: dm bufio: avoid sleeping while holding the dm_bufio lock
ANDROID: sdcardfs: Don't d_drop in d_revalidate
goldfish: pipe: ANDROID: mark local functions static
Revert "goldfish: pipe: ANDROID: Allocate memory with GFP_KERNEL."
UPSTREAM: ANDROID: binder: prevent transactions into own process.
goldfish: pipe: ANDROID: Add DMA support
UPSTREAM: f2fs: clear PageError on writepage - part 2
UPSTREAM: f2fs: avoid fsync() failure caused by EAGAIN in writepage()
ANDROID: build.config: enforce trace_printk check
ANDROID: x86_64_cuttlefish_defconfig: Disable KPTI
UPSTREAM: mac80211: ibss: Fix channel type enum in ieee80211_sta_join_ibss()
UPSTREAM: mac80211: Fix clang warning about constant operand in logical operation
UPSTREAM: nl80211: Fix enum type of variable in nl80211_put_sta_rate()
UPSTREAM: sysfs: remove signedness from sysfs_get_dirent
UPSTREAM: tracing: Use cpumask_available() to check if cpumask variable may be used
BACKPORT: clocksource: Use GENMASK_ULL in definition of CLOCKSOURCE_MASK
UPSTREAM: netpoll: Fix device name check in netpoll_setup()
FROMLIST: staging: Fix sparse warnings in vsoc driver.
FROMLIST: staging: vsoc: Fix a i386-randconfig warning.
FROMLIST: staging: vsoc: Create wc kernel mapping for region shm.
Revert "goldfish: pipe: ANDROID: remove a redundant target"
goldfish: pipe: ANDROID: Replace writel with gf_write_ptr
goldfish: pipe: ANDROID: Use dev_ logging instead of pr_
goldfish: pipe: ANDROID: fix checkpatch warnings
goldfish: pipe: ANDROID: Update module license
goldfish: pipe: ANDROID: Allocate memory with GFP_KERNEL.
goldfish: pipe: ANDROID: Do not crash
goldfish: pipe: ANDROID: remove redundant casting
goldfish: pipe: ANDROID: Add 'pipe' to pipe functions
goldfish: pipe: ANDROID: fix whitespace
goldfish: pipe: ANDROID: rename global variables
goldfish: pipe: ANDROID: remove a redundant target
goldfish: pipe: ANDROID: add blank lines
goldfish: pipe: ANDROID: replace 'BUG_ON' with 'BUILD_BUG_ON'
goldfish: pipe: ANDROID: use the 'BIT' macro for wakeup flags
goldfish: pipe: ANDROID: fix logging format strings
UPSTREAM: tracing: always define trace_{irq,preempt}_{enable_disable}
ANDROID: staging: ion: Obey kptr_restrict
ANDROID: sdcardfs: Set s_root to NULL after putting
ANDROID: sdcardfs: d_make_root calls iput
ANDROID: sdcardfs: Check for private data earlier
f2fs: check cap_resource only for data blocks
Revert "f2fs: introduce f2fs_set_page_dirty_nobuffer"
f2fs: clear PageError on writepage
UPSTREAM: timer: Export destroy_hrtimer_on_stack()
BACKPORT: dm verity: add 'check_at_most_once' option to only validate hashes once
f2fs: call unlock_new_inode() before d_instantiate()
f2fs: refactor read path to allow multiple postprocessing steps
fscrypt: allow synchronous bio decryption
ANDROID: Add build server config for cuttlefish.
ANDROID: Add defconfig for cuttlefish.
FROMLIST: staging: Android: Add 'vsoc' driver for cuttlefish.
Revert "proc: make oom adjustment files user read-only"
Revert "fixup! proc: make oom adjustment files user read-only"
ANDROID: proc: add null check in proc_uid_init
f2fs/fscrypt: updates to v4.17-rc1
Reduce amount of casting in drivers/tty/goldfish.c.
Replace #define with enum for better compilation errors.
Add missing include to drivers/tty/goldfish.c
Fix whitespace in drivers/tty/goldfish.c
ANDROID: fuse: Add null terminator to path in canonical path to avoid issue
ANDROID: sdcardfs: Fix sdcardfs to stop creating cases-sensitive duplicate entries.
ANDROID: add missing include to pdev_bus
ANDROID: pdev_bus: replace writel with gf_write_ptr
ANDROID: Cleanup type casting in goldfish.h
ANDROID: Include missing headers in goldfish.h
ANDROID: cpufreq: times: skip printing invalid frequencies
ANDROID: xt_qtaguid: Remove unnecessary null checks to device's name
ANDROID: xt_qtaguid: Remove unnecessary null checks to ifa_label
ANDROID: cpufreq: times: allocate enough space for a uid_entry
Revert "genirq: Use irqd_get_trigger_type to compare the trigger type for shared IRQs"
UPSTREAM: drm: virtio-gpu: set atomic flag
UPSTREAM: drm: virtio-gpu: transfer dumb buffers to host on plane update
UPSTREAM: drm: virtio-gpu: ensure plane is flushed to host on atomic update
UPSTREAM: drm: virtio-gpu: get the fb from the plane state for atomic updates
ANDROID: cpufreq: times: fix proc_time_in_state_show
dtc: turn off dtc unit address warnings by default
BACKPORT, FROMLIST: crypto: arm64/speck - add NEON-accelerated implementation of Speck-XTS
ANDROID: cpufreq: times: avoid prematurely freeing uid_entry
ANDROID: Use standard logging functions in goldfish_pipe
ANDROID: Fix whitespace in goldfish
staging: android: ashmem: Fix possible deadlock in ashmem_ioctl
llist: clang: introduce member_address_is_nonnull()
ANDROID: ranchu: 32 bit framebuffer support
ANDROID: Address checkpatch warnings in goldfishfb
ANDROID: Address checkpatch.pl warnings in goldfish_pipe
ANDROID: sdcardfs: fix lock issue on 32 bit/SMP architectures
ANDROID: goldfish: Fix typo in goldfish_cmd_locked() call
ANDROID: Address checkpatch.pl warnings in goldfish_pipe_v2
FROMLIST: f2fs: don't put dentry page in pagecache into highmem
ANDROID: Delete the goldfish_nand driver.
ANDROID: Add input support for Android Wear.
ANDROID: proc: fix config & includes for /proc/uid
FROMLIST: ARM: amba: Don't read past the end of sysfs "driver_override" buffer
UPSTREAM: ANDROID: binder: remove WARN() for redundant txn error
ANDROID: cpufreq: times: Add missing includes
ANDROID: cpufreq: Add time_in_state to /proc/uid directories
ANDROID: proc: Add /proc/uid directory
ANDROID: cpufreq: times: track per-uid time in state
ANDROID: cpufreq: track per-task time in state
ANDROID: keychord: Check for write data size
Revert "binder: add missing binder_unlock()"
ANDROID: sdcardfs: Set num in extension_details during make_item
ANDROID: sdcardfs: Hold i_mutex for i_size_write
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
UPSTREAM: ANDROID: binder: synchronize_rcu() when using POLLFREE.
f2fs: updates on v4.16-rc1
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
f2fs: fix build error with multiply defined inode_nohighmem()
BACKPORT: xfrm: Fix return value check of copy_sec_ctx.
time: Fix ktime_get_raw() incorrect base accumulation
sched/fair: prevent possible infinite loop in sched_group_energy
UPSTREAM: MIPS: Fix build of compressed image
ANDROID: qtaguid: Fix the UAF probelm with tag_ref_tree
UPSTREAM: ANDROID: binder: remove waitqueue when thread exits.
UPSTREAM: arm64/efi: Make strnlen() available to the EFI namespace
UPSTREAM: ARM: boot: Add an implementation of strnlen for libfdt
ANDROID: MIPS: Add ranchu[32r5|32r6|64]_defconfig
FROMLIST: tty: goldfish: Enable 'earlycon' only if built-in
FROMLIST: MIPS: ranchu: Add Ranchu as a new generic-based board
FROMLIST: MIPS: Add noexec=on|off kernel parameter
FROMLIST: MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base()
FROMLIST: dt-bindings: Document mti,mips-cpc binding
FROMLIST: MIPS: math-emu: Mark fall throughs in switch statements with a comment
FROMLIST: MIPS: math-emu: Avoid multiple assignment
FROMLIST: MIPS: math-emu: Avoid an assignment within if statement condition
FROMLIST: MIPS: math-emu: Declare function srl128() as static
FROMLIST: MIPS: math-emu: Avoid definition duplication for macro DPXMULT()
FROMLIST: MIPS: math-emu: Remove an unnecessary header inclusion
UPSTREAM: scripts/dtc: Update to upstream version 0931cea3ba20
UPSTREAM: scripts/dtc: dt_to_config - kernel config options for a devicetree
UPSTREAM: scripts/dtc: Update to upstream version 53bf130b1cdd
UPSTREAM: scripts/dtc: Update to upstream commit b06e55c88b9b
UPSTREAM: scripts/dtc: dtx_diff - add info to error message
UPSTREAM: dtc: create tool to diff device trees
UPSTREAM: config: android-base: disable CONFIG_NFSD and CONFIG_NFS_FS
UPSTREAM: config: android-base: add CGROUP_BPF
UPSTREAM: config: android-base: add CONFIG_MODULES option
UPSTREAM: config: android-base: add CONFIG_IKCONFIG option
UPSTREAM: config: android-base: disable CONFIG_USELIB and CONFIG_FHANDLE
UPSTREAM: config: android-base: enable hardened usercopy and kernel ASLR
UPSTREAM: config: android: enable CONFIG_SECCOMP
UPSTREAM: config: android: set SELinux as default security mode
UPSTREAM: config: android: move device mapper options to recommended
UPSTREAM: config/android: Remove CONFIG_IPV6_PRIVACY
UPSTREAM: config: add android config fragments
BACKPORT: MIPS: generic: Add a MAINTAINERS entry
BACKPORT: irqchip/irq-goldfish-pic: Add Goldfish PIC driver
UPSTREAM: dt-bindings/goldfish-pic: Add device tree binding for Goldfish PIC driver
UPSTREAM: MIPS: Allow storing pgd in C0_CONTEXT for MIPSr6
UPSTREAM: MIPS: CPS: Handle spurious VP starts more gracefully
UPSTREAM: MIPS: CPS: Handle cores not powering down more gracefully
UPSTREAM: MIPS: CPS: Prevent multi-core with dcache aliasing
UPSTREAM: MIPS: CPS: Select CONFIG_SYS_SUPPORTS_SCHED_SMT for MIPSr6
UPSTREAM: MIPS: CM: WARN on attempt to lock invalid VP, not BUG
UPSTREAM: MIPS: CM: Avoid per-core locking with CM3 & higher
UPSTREAM: MIPS: smp-cps: Avoid BUG() when offlining pre-r6 CPUs
UPSTREAM: MIPS: smp-cps: Add support for CPU hotplug of MIPSr6 processors
UPSTREAM: MIPS: generic: Bump default NR_CPUS to 16
UPSTREAM: MIPS: pm-cps: Change FSB workaround to CPU blacklist
UPSTREAM: MIPS: Fix early CM probing
UPSTREAM: MIPS: smp-cps: Stop printing EJTAG exceptions to UART
UPSTREAM: MIPS: smp-cps: Add nothreads kernel parameter
UPSTREAM: MIPS: smp-cps: Support MIPSr6 Virtual Processors
UPSTREAM: MIPS: smp-cps: Skip core setup if coherent
UPSTREAM: MIPS: smp-cps: Pull boot config retrieval out of mips_cps_boot_vpes
UPSTREAM: MIPS: smp-cps: Pull cache init into a function
UPSTREAM: MIPS: smp-cps: Ensure our VP ident calculation is correct
UPSTREAM: irqchip: mips-gic: Provide VP ID accessor
UPSTREAM: irqchip: mips-gic: Use HW IDs for VPE_OTHER_ADDR
UPSTREAM: MIPS: CM: Fix mips_cm_max_vp_width for UP kernels
UPSTREAM: MIPS: CM: Add CM GCR_BEV_BASE accessors
UPSTREAM: MIPS: CPC: Add start, stop and running CM3 CPC registers
UPSTREAM: MIPS: pm-cps: Avoid offset overflow on MIPSr6
UPSTREAM: MIPS: traps: Make sure secondary cores have a sane ebase register
UPSTREAM: MIPS: Detect MIPSr6 Virtual Processor support
UPSTREAM: Documentation: Add device tree binding for Goldfish FB driver
UPSTREAM: MIPS: math-emu: Use preferred flavor of unsigned integer declarations
UPSTREAM: MIPS: math-emu: <MADDF|MSUBF>.D: Fix accuracy (64-bit case)
UPSTREAM: MIPS: math-emu: <MADDF|MSUBF>.S: Fix accuracy (32-bit case)
UPSTREAM: MIPS: Update Goldfish RTC driver maintainer email address
UPSTREAM: MIPS: Update RINT emulation maintainer email address
UPSTREAM: MIPS: math-emu: do not use bools for arithmetic
UPSTREAM: rtc: goldfish: Add RTC driver for Android emulator
BACKPORT: dt-bindings: Add device tree binding for Goldfish RTC driver
UPSTREAM: tty: goldfish: Implement support for kernel 'earlycon' parameter
UPSTREAM: tty: goldfish: Use streaming DMA for r/w operations on Ranchu platforms
UPSTREAM: tty: goldfish: Refactor constants to better reflect their nature
UPSTREAM: MIPS: math-emu: Add FP emu debugfs stats for individual instructions
UPSTREAM: MIPS: math-emu: Add FP emu debugfs clear functionality
UPSTREAM: MIPS: math-emu: Add FP emu debugfs statistics for branches
BACKPORT: MIPS: math-emu: CLASS.D: Zero bits 32-63 of the result
BACKPORT: MIPS: math-emu: RINT.<D|S>: Fix several problems by reimplementation
UPSTREAM: MIPS: math-emu: CMP.Sxxx.<D|S>: Prevent occurrences of SIGILL crashes
UPSTREAM: MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Clean up "maddf_flags" enumeration
UPSTREAM: MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix some cases of zero inputs
UPSTREAM: MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix some cases of infinite inputs
UPSTREAM: MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Fix NaN propagation
UPSTREAM: tty: goldfish: Fix a parameter of a call to free_irq
UPSTREAM: MIPS: VDSO: Fix clobber lists in fallback code paths
UPSTREAM: MIPS: VDSO: Fix a mismatch between comment and preprocessor constant
UPSTREAM: MIPS: VDSO: Add implementation of gettimeofday() fallback
UPSTREAM: MIPS: VDSO: Add implementation of clock_gettime() fallback
UPSTREAM: MIPS: VDSO: Fix conversions in do_monotonic()/do_monotonic_coarse()
UPSTREAM: MIPS: unaligned: Add DSP lwx & lhx missaligned access support
UPSTREAM: MIPS: build: Fix "-modd-spreg" switch usage when compiling for mips32r6
UPSTREAM: MIPS: cmdline: Add support for 'memmap' parameter
UPSTREAM: MIPS: math-emu: Handle zero accumulator case in MADDF and MSUBF separately
UPSTREAM: MIPS: Support per-device DMA coherence
UPSTREAM: MIPS: dma-default: Don't check hw_coherentio if device is non-coherent
UPSTREAM: MIPS: Sanitise coherentio semantics
UPSTREAM: MIPS: CPC: Provide default mips_cpc_default_phys_base to ignore CPC
UPSTREAM: MIPS: generic: Introduce generic DT-based board support
UPSTREAM: MIPS: Support generating Flattened Image Trees (.itb)
UPSTREAM: MIPS: Allow emulation for unaligned [LS]DXC1 instructions
UPSTREAM: MIPS: math-emu: Fix BC1EQZ and BC1NEZ condition handling
UPSTREAM: MIPS: r2-on-r6-emu: Clear BLTZALL and BGEZALL debugfs counters
UPSTREAM: MIPS: r2-on-r6-emu: Fix BLEZL and BGTZL identification
UPSTREAM: MIPS: remove aliasing alignment if HW has antialising support
BACKPORT: MIPS: store the appended dtb address in a variable
UPSTREAM: MIPS: Fix FCSR Cause bit handling for correct SIGFPE issue
UPSTREAM: MIPS: kernel: Audit and remove any unnecessary uses of module.h
UPSTREAM: MIPS: c-r4k: Fix sigtramp SMP call to use kmap
UPSTREAM: MIPS: c-r4k: Fix protected_writeback_scache_line for EVA
UPSTREAM: MIPS: Spelling fix lets -> let's
UPSTREAM: MIPS: R6: Fix typo
UPSTREAM: MIPS: traps: Correct the SIGTRAP debug ABI in `do_watch' and `do_trap_or_bp'
UPSTREAM: MIPS: inst.h: Rename cbcond{0,1}_op to pop{1,3}0_op
UPSTREAM: MIPS: inst.h: Rename b{eq,ne}zcji[al]c_op to pop{6,7}6_op
UPSTREAM: MIPS: math-emu: Fix m{add,sub}.s shifts
UPSTREAM: MIPS: inst: Declare fsel_op for sel.fmt instruction
UPSTREAM: MIPS: math-emu: Fix code indentation
UPSTREAM: MIPS: math-emu: Fix bit-width in ieee754dp_{mul, maddf, msubf} comments
UPSTREAM: MIPS: math-emu: Add z argument macros
UPSTREAM: MIPS: math-emu: Unify ieee754dp_m{add,sub}f
UPSTREAM: MIPS: math-emu: Unify ieee754sp_m{add,sub}f
UPSTREAM: MIPS: math-emu: Emulate MIPSr6 sel.fmt instruction
UPSTREAM: MIPS: math-emu: Fix BC1{EQ,NE}Z emulation
UPSTREAM: MIPS: math-emu: Always propagate sNaN payload in quieting
UPSTREAM: MIPS: Fix misspellings in comments.
UPSTREAM: MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation
UPSTREAM: MIPS: math-emu: Add IEEE Std 754-2008 ABS.fmt and NEG.fmt emulation
UPSTREAM: MIPS: non-exec stack & heap when non-exec PT_GNU_STACK is present
UPSTREAM: MIPS: Add IEEE Std 754 conformance mode selection
UPSTREAM: MIPS: Determine the presence of IEEE Std 754-2008 features
UPSTREAM: MIPS: Define the legacy-NaN and 2008-NaN features
UPSTREAM: MIPS: ELF: Interpret the NAN2008 file header flag
UPSTREAM: ELF: Also pass any interpreter's file header to `arch_check_elf'
UPSTREAM: MIPS: Use a union to access the ELF file header
UPSTREAM: MIPS: Fix delay slot emulation count in debugfs
BACKPORT: exit_thread: accept a task parameter to be exited
UPSTREAM: mn10300: let exit_fpu accept a task
UPSTREAM: MIPS: Use per-mm page to execute branch delay slot instructions
BACKPORT: s390: get rid of exit_thread()
BACKPORT: exit_thread: remove empty bodies
UPSTREAM: MIPS: Make flush_thread
UPSTREAM: MIPS: Properly disable FPU in start_thread()
UPSTREAM: MIPS: Select CONFIG_HANDLE_DOMAIN_IRQ and make it work.
UPSTREAM: MIPS: math-emu: Fix typo
UPSTREAM: MIPS: math-emu: dsemul: Remove an unused bit in ADDIUPC emulation
UPSTREAM: MIPS: math-emu: dsemul: Reduce `get_isa16_mode' clutter
UPSTREAM: MIPS: math-emu: dsemul: Correct description of the emulation frame
UPSTREAM: MIPS: math-emu: Correct the emulation of microMIPS ADDIUPC instruction
UPSTREAM: MIPS: math-emu: Make microMIPS branch delay slot emulation work
UPSTREAM: MIPS: math-emu: dsemul: Fix ill formatting of microMIPS part
UPSTREAM: MIPS: math-emu: Correctly handle NOP emulation
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/rt: schedtune: Add boost retention to RT
ANDROID: sched: EAS: check energy_aware() before calling select_energy_cpu_brute() in up-migrate path
UPSTREAM: eventpoll.h: add missing epoll event masks
ANDROID: xattr: Pass EOPNOTSUPP to permission2
ANDROID: sdcardfs: Move default_normal to superblock
blkdev: Refactoring block io latency histogram codes
FROMLIST: arm64: kpti: Fix the interaction between ASID switching and software PAN
FROMLIST: arm64: Move post_ttbr_update_workaround to C code
FROMLIST: arm64: mm: Rename post_ttbr0_update_workaround
sched: EAS: Initialize push_task as NULL to avoid direct reference on out_unlock path
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
BACKPORT: selinux: nlmsgtab: add SOCK_DESTROY to the netlink mapping tables
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: 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
FROMLIST: arm64: kaslr: Put kernel vectors address in separate data page
FROMLIST: arm64: mm: Introduce TTBR_ASID_MASK for getting at the ASID in the TTBR
FROMLIST: arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0
FROMLIST: arm64: entry: Add fake CPU feature for unmapping the kernel at EL0
FROMLIST: arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks
FROMLIST: arm64: erratum: Work around Falkor erratum #E1003 in trampoline code
FROMLIST: arm64: entry: Hook up entry trampoline to exception vectors
FROMLIST: arm64: entry: Explicitly pass exception level to kernel_ventry macro
FROMLIST: arm64: mm: Map entry trampoline into trampoline and kernel page tables
FROMLIST: arm64: entry: Add exception trampoline page for exceptions from EL0
FROMLIST: arm64: mm: Invalidate both kernel and user ASIDs when performing TLBI
FROMLIST: arm64: mm: Add arm64_kernel_unmapped_at_el0 helper
FROMLIST: arm64: mm: Allocate ASIDs in pairs
FROMLIST: arm64: mm: Fix and re-enable ARM64_SW_TTBR0_PAN
FROMLIST: arm64: mm: Move ASID from TTBR0 to TTBR1
FROMLIST: arm64: mm: Temporarily disable ARM64_SW_TTBR0_PAN
FROMLIST: arm64: mm: Use non-global mappings for kernel space
UPSTREAM: arm64: factor out entry stack manipulation
UPSTREAM: arm64: tlbflush.h: add __tlbi() macro
ANDROID: sdcardfs: Add default_normal option
ANDROID: sdcardfs: notify lower file of opens
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
UPSTREAM: kcov: add missing #include <linux/sched.h>
UPSTREAM: kcov: properly check if we are in an interrupt
UPSTREAM: kcov: don't profile branches in kcov
UPSTREAM: kcov: don't trace the code coverage code
BACKPORT: kernel: add kcov code coverage
BACKPORT: irq: Make the irqentry text section unconditional
UPSTREAM: arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections
UPSTREAM: x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text
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()
BACKPORT: kasan, sched/headers: Uninline kasan_enable/disable_current()
BACKPORT: kasan: drain quarantine of memcg slab objects
UPSTREAM: kasan: eliminate long stalls during quarantine reduction
UPSTREAM: kasan: support panic_on_warn
UPSTREAM: x86/suspend: fix false positive KASAN warning on suspend/resume
UPSTREAM: kasan: support use-after-scope detection
UPSTREAM: kasan/tests: add tests for user memory access functions
UPSTREAM: mm, kasan: add a ksize() test
UPSTREAM: kasan: test fix: warn if the UAF could not be detected in kmalloc_uaf2
UPSTREAM: kasan: modify kmalloc_large_oob_right(), add kmalloc_pagealloc_oob_right()
UPSTREAM: lib/stackdepot: export save/fetch stack for drivers
UPSTREAM: lib/stackdepot.c: bump stackdepot capacity from 16MB to 128MB
BACKPORT: kprobes: Unpoison stack in jprobe_return() for KASAN
UPSTREAM: kasan: remove the unnecessary WARN_ONCE from quarantine.c
UPSTREAM: kasan: avoid overflowing quarantine size on low memory systems
UPSTREAM: kasan: improve double-free reports
BACKPORT: mm: coalesce split strings
BACKPORT: mm/kasan: get rid of ->state in struct kasan_alloc_meta
UPSTREAM: mm/kasan: get rid of ->alloc_size in struct kasan_alloc_meta
UPSTREAM: mm: kasan: remove unused 'reserved' field from struct kasan_alloc_meta
UPSTREAM: mm/kasan, slub: don't disable interrupts when object leaves quarantine
UPSTREAM: mm/kasan: don't reduce quarantine in atomic contexts
UPSTREAM: mm/kasan: fix corruptions and false positive reports
UPSTREAM: lib/stackdepot.c: use __GFP_NOWARN for stack allocations
BACKPORT: mm, kasan: switch SLUB to stackdepot, enable memory quarantine for SLUB
UPSTREAM: kasan/quarantine: fix bugs on qlist_move_cache()
UPSTREAM: mm: mempool: kasan: don't poot mempool objects in quarantine
UPSTREAM: kasan: change memory hot-add error messages to info messages
BACKPORT: mm/kasan: add API to check memory regions
UPSTREAM: mm/kasan: print name of mem[set,cpy,move]() caller in report
UPSTREAM: mm: kasan: initial memory quarantine implementation
UPSTREAM: lib/stackdepot: avoid to return 0 handle
UPSTREAM: lib/stackdepot.c: allow the stack trace hash to be zero
UPSTREAM: mm, kasan: fix compilation for CONFIG_SLAB
BACKPORT: mm, kasan: stackdepot implementation. Enable stackdepot for SLAB
BACKPORT: mm, kasan: add GFP flags to KASAN API
UPSTREAM: mm, kasan: SLAB support
UPSTREAM: mm/slab: align cache size first before determination of OFF_SLAB candidate
UPSTREAM: mm/slab: use more appropriate condition check for debug_pagealloc
UPSTREAM: mm/slab: factor out debugging initialization in cache_init_objs()
UPSTREAM: mm/slab: remove object status buffer for DEBUG_SLAB_LEAK
UPSTREAM: mm/slab: alternative implementation for DEBUG_SLAB_LEAK
UPSTREAM: mm/slab: clean up DEBUG_PAGEALLOC processing code
UPSTREAM: mm/slab: activate debug_pagealloc in SLAB when it is actually enabled
sched: EAS/WALT: Don't take into account of running task's util
BACKPORT: schedutil: Reset cached freq if it is not in sync with next_freq
UPSTREAM: kasan: add functions to clear stack poison
ANDROID: initramfs: call free_initrd() when skipping init
Documentation: tee subsystem and op-tee driver
tee: add OP-TEE driver
tee: generic TEE subsystem
dt/bindings: add bindings for optee
kernel.h: add u64_to_user_ptr()
ARM: 8481/2: drivers: psci: replace psci firmware calls
ARM: 8480/2: arm64: add implementation for arm-smccc
ARM: 8479/2: add implementation for arm-smccc
ARM: 8478/2: arm/arm64: add arm-smccc
UPSTREAM: net: xfrm: allow clearing socket xfrm policies.
BACKPORT: time: Clean up CLOCK_MONOTONIC_RAW time handling
BACKPORT: time: Fix CLOCK_MONOTONIC_RAW sub-nanosecond accounting
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
BACKPORT: arm64: Use __pa_symbol for kernel symbols
UPSTREAM: mm: Introduce lm_alias
FROMLIST: binder: fix proc->files use-after-free
ANDROID: binder: clarify deferred thread work.
FROMLIST: arm64: Avoid aligning normal memory pointers in __memcpy_{to,from}io
BACKPORT: xfrm: Clear sk_dst_cache when applying per-socket policy.
Revert "ANDROID: sched/rt: schedtune: Add boost retention to RT"
cpufreq: Drop schedfreq governor
ANDROID: sched/rt: schedtune: Add boost retention to RT
ANDROID: sched/rt: add schedtune accounting
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 calculation of group util in group_idle_state()
sched: EAS: update trg_cpu to backup_cpu if no energy saving for target_cpu
sched: EAS: Fix the condition to distinguish energy before/after
sched: EAS: upmigrate misfit current task
sched: avoid pushing tasks to an offline CPU
sched: Extend active balance to accept 'push_task' argument
Revert "sched/core: Warn if ENERGY_AWARE is enabled but data is missing"
Revert "sched/core: fix have_sched_energy_data build warning"
FROMLIST: kbuild: clang: fix build failures with sparse check
Revert "Revert "UPSTREAM: efi/libstub/arm64: Set -fpie when building the EFI stub""
BACKPORT: efi/libstub: Unify command line param parsing
BACKPORT: arm64: relocatable: suppress R_AARCH64_ABS64 relocations in vmlinux
sched/core: fix have_sched_energy_data build warning
sched/core: Warn if ENERGY_AWARE is enabled but data is missing
sched: walt: Correct WALT window size initialization
FROMLIST: sched/fair: Use wake_q length as a hint for wake_wide
sched: WALT: account cumulative window demand
sched/fair: remove useless variable in find_best_target
sched/tune: access schedtune_initialized under CGROUP_SCHEDTUNE
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/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
BACKPORT: sched/fair: Fix find_idlest_group when local group is not allowed
UPSTREAM: sched/fair: Remove unnecessary comparison with -1
BACKPORT: 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: 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/core: Fix find_idlest_group() for fork
BACKPORT: sched/fair: Fix PELT integrity for new tasks
BACKPORT: sched/cgroup: Fix cpu_cgroup_fork() handling
UPSTREAM: sched/fair: Fix and optimize the fork() path
BACKPORT: sched/fair: Make it possible to account fair load avg consistently
cpufreq/sched: Consider max cpu capacity when choosing frequencies
ANDROID: binder: show high watermark of alloc->pages.
ANDROID: binder: Add thread->process_todo flag.
UPSTREAM: arm64: compat: Remove leftover variable declaration
ANDROID: sched/fair: Select correct capacity state for energy_diff
Revert "UPSTREAM: efi/libstub/arm64: Set -fpie when building the EFI stub"
cpufreq: schedutil: clamp util to CPU maximum capacity
FROMLIST: android: binder: Fix null ptr dereference in debug msg
FROMLIST: android: binder: Change binder_shrinker to static
cpufreq/sched: Use cpu max freq rather than policy max
trace: sched: Fix util_avg_walt in sched_load_avg_cpu trace
sched/fair: remove erroneous RCU_LOCKDEP_WARN from start_cpu()
sched: EAS/WALT: finish accounting prior to task_tick
cpufreq: sched: update capacity request upon tick always
sched/fair: prevent meaningless active migration
sched: walt: Leverage existing helper APIs to apply invariance
ANDROID: HACK: arm64: use -mno-implicit-float instead of -mgeneral-regs-only
sched: Update task->on_rq when tasks are moving between runqueues
FROMLIST: f2fs: expose some sectors to user in inline data or dentry case
crypto: Work around deallocated stack frame reference gcc bug on sparc.
UPSTREAM: f2fs: fix potential panic during fstrim
ANDROID: fscrypt: remove unnecessary fscrypto.h
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.
UPSTREAM: xfrm: Only add l3mdev oif to dst lookups
UPSTREAM: net: l3mdev: Add master device lookup by index
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
UPSTREAM: x86/build: Use cc-option to validate stack alignment parameter
UPSTREAM: x86/build: Fix stack alignment for CLang
UPSTREAM: efi/libstub/arm64: Set -fpie when building the EFI stub
BACKPORT: efi/libstub/arm64: Force 'hidden' visibility for section markers
UPSTREAM: compiler, clang: always inline when CONFIG_OPTIMIZE_INLINING is disabled
UPSTREAM: x86/boot: #undef memcpy() et al in string.c
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
BACKPORT: kbuild: Add __cc-option macro
UPSTREAM: x86/hweight: Don't clobber %rdi
BACKPORT: x86/hweight: Get rid of the special calling convention
BACKPORT: 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: Kbuild: provide a __UNIQUE_ID for clang
UPSTREAM: modules: mark __inittest/__exittest as __maybe_unused
BACKPORT: kbuild: Add support to generate LLVM assembly files
UPSTREAM: kbuild: use -Oz instead of -Os when using clang
BACKPORT: 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: tracing: Add support for preempt and irq enable/disable events
FROMLIST: tracing: Prepare to add preempt and irq trace events
ANDROID: binder: fix transaction leak.
ANDROID: binder: Add tracing for binder priority inheritance.
f2fs: catch up to v4.14-rc1
UPSTREAM: cpufreq: schedutil: use now as reference when aggregating shared policy requests
ANDROID: add script to fetch android kernel config fragments
f2fs: reorganize stat information
f2fs: clean up flush/discard command namings
f2fs: check in-memory sit version bitmap
f2fs: check in-memory nat version bitmap
f2fs: check in-memory block bitmap
f2fs: introduce FI_ATOMIC_COMMIT
f2fs: clean up with list_{first, last}_entry
f2fs: return fs_trim if there is no candidate
f2fs: avoid needless checkpoint in f2fs_trim_fs
f2fs: relax async discard commands more
f2fs: drop exist_data for inline_data when truncated to 0
f2fs: don't allow encrypted operations without keys
f2fs: show the max number of atomic operations
f2fs: get io size bit from mount option
f2fs: support IO alignment for DATA and NODE writes
f2fs: add submit_bio tracepoint
f2fs: reassign new segment for mode=lfs
f2fs: fix a missing discard prefree segments
f2fs: use rb_entry_safe
f2fs: add a case of no need to read a page in write begin
f2fs: fix a problem of using memory after free
f2fs: remove unneeded condition
f2fs: don't cache nat entry if out of memory
f2fs: remove unused values in recover_fsync_data
f2fs: support async discard based on v4.9
f2fs: resolve op and op_flags confilcts
f2fs: remove wrong backported codes
FROMLIST: binder: fix use-after-free in binder_transaction()
UPSTREAM: ipv6: fib: Unlink replaced routes from their nodes
f2fs: fix a missing size change in f2fs_setattr
f2fs: fix to access nullified flush_cmd_control pointer
f2fs: free meta pages if sanity check for ckpt is failed
f2fs: detect wrong layout
f2fs: call sync_fs when f2fs is idle
Revert "f2fs: use percpu_counter for # of dirty pages in inode"
f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage
f2fs: do not activate auto_recovery for fallocated i_size
f2fs: fix 32-bit build
f2fs: fix incorrect free inode count in ->statfs
f2fs: drop duplicate header timer.h
f2fs: fix wrong AUTO_RECOVER condition
f2fs: do not recover i_size if it's valid
f2fs: fix fdatasync
f2fs: fix to account total free nid correctly
f2fs: fix an infinite loop when flush nodes in cp
f2fs: don't wait writeback for datas during checkpoint
f2fs: fix wrong written_valid_blocks counting
f2fs: avoid BG_GC in f2fs_balance_fs
f2fs: fix redundant block allocation
f2fs: use err for f2fs_preallocate_blocks
f2fs: support multiple devices
f2fs: allow dio read for LFS mode
f2fs: revert segment allocation for direct IO
f2fs: return directly if block has been removed from the victim
Revert "f2fs: do not recover from previous remained wrong dnodes"
f2fs: remove checkpoint in f2fs_freeze
f2fs: assign segments correctly for direct_io
f2fs: fix wrong i_atime recovery
f2fs: record inode updating status correctly
f2fs: Trace reset zone events
f2fs: Reset sequential zones on zoned block devices
f2fs: Cache zoned block devices zone type
f2fs: Do not allow adaptive mode for host-managed zoned block devices
f2fs: Always enable discard for zoned blocks devices
f2fs: Suppress discard warning message for zoned block devices
f2fs: Check zoned block feature for host-managed zoned block devices
f2fs: Use generic zoned block device terminology
f2fs: Add missing break in switch-case
f2fs: avoid infinite loop in the EIO case on recover_orphan_inodes
f2fs: report error of f2fs_fill_dentries
fs/crypto: catch up 4.9-rc6
f2fs: hide a maybe-uninitialized warning
f2fs: remove percpu_count due to performance regression
f2fs: make clean inodes when flushing inode page
f2fs: keep dirty inodes selectively for checkpoint
f2fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps
f2fs: use BIO_MAX_PAGES for bio allocation
f2fs: declare static function for __build_free_nids
f2fs: call f2fs_balance_fs for setattr
f2fs: count dirty inodes to flush node pages during checkpoint
f2fs: avoid casted negative value as shrink count
f2fs: don't interrupt free nids building during nid allocation
f2fs: clean up free nid list operations
f2fs: split free nid list
f2fs: clear nlink if fail to add_link
f2fs: fix sparse warnings
f2fs: fix error handling in fsync_node_pages
f2fs: fix to update largest extent under lock
f2fs: be aware of extent beyond EOF in fiemap
f2fs: don't miss any f2fs_balance_fs cases
f2fs: add missing f2fs_balance_fs in f2fs_zero_range
f2fs: give a chance to detach from dirty list
f2fs: fix to release discard entries during checkpoint
f2fs: exclude free nids building and allocation
f2fs: fix to determine start_cp_addr by sbi->cur_cp_pack
f2fs: fix overflow due to condition check order
posix_acl: Clear SGID bit when setting file permissions
f2fs: fix wrong sum_page pointer in f2fs_gc
f2fs: backport from (4c1fad64 - Merge tag 'for-f2fs-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs)
Revert "ANDROID: sched/tune: Initialize raw_spin_lock in boosted_groups"
BACKPORT: partial: mm, oom_reaper: do not mmput synchronously from the oom reaper context
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: configs: remove config fragments
drivers: cpufreq_interactive: handle error for module load fail
UPSTREAM: Fix build break in fork.c when THREAD_SIZE < PAGE_SIZE
ANDROID: sdcardfs: Add missing break
ANDROID: Sdcardfs: Move gid derivation under flag
ANDROID: mnt: Fix freeing of mount data
drivers: cpufreq: checks to avoid kernel crash in cpufreq_interactive
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: fiq_debugger: Fix minor bug in code
ANDROID: cpufreq-dt: Set sane defaults for schedutil rate limits
BACKPORT: cpufreq: schedutil: Use policy-dependent transition delays
FROMLIST: binder: fix an ret value override
FROMLIST: binder: fix memory corruption in binder_transaction binder
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: take into account of waking task's load
cpufreq: sched: WALT: don't apply capacity margin twice
sched: WALT: fix potential overflow
sched: EAS: schedfreq: fix CPU util over estimation
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
FROMLIST: android: binder: Add page usage in binder stats
FROMLIST: android: binder: Add shrinker tracepoints
FROMLIST: android: binder: Add global lru shrinker to binder
FROMLIST: android: binder: Move buffer out of area shared with user space
FROMLIST: android: binder: Add allocator selftest
FROMLIST: android: binder: Refactor prev and next buffer into a helper function
android: android-base.config: enable IP6_NF_MATCH_RPFILTER
UPSTREAM: cpufreq: schedutil: Use unsigned int for iowait boost
UPSTREAM: cpufreq: schedutil: Make iowait boost more energy efficient
ANDROID: NFC: st21nfca: Fix memory OOB and leak issues in connectivity events handler
ANDROID: check dir value of xfrm_userpolicy_id
ANDROID: NFC: Fix possible memory corruption when handling SHDLC I-Frame commands
ANDROID: nfc: fdp: Fix possible buffer overflow in WCS4000 NFC driver
ANDROID: NFC: st21nfca: Fix out of bounds kernel access when handling ATR_REQ
UPSTREAM: usb: dwc3: gadget: don't send extra ZLP
BACKPORT: usb: dwc3: gadget: handle request->zero
ANDROID: usb: gadget: assign no-op request complete callbacks
ANDROID: usb: gadget: configfs: fix null ptr in android_disconnect
ANDROID: uid_sys_stats: Fix implicit declaration of get_cmdline()
uid_sys_stats: log task io with a debug flag
ANDROID: Use sk_uid to replace uid get from socket file
UPSTREAM: arm64: smp: Prevent raw_smp_processor_id() recursion
UPSTREAM: arm64: restore get_current() optimisation
ANDROID: arm64: Fix a copy-paste error in prior init_thread_info build fix
UPSTREAM: locking: avoid passing around 'thread_info' in mutex debugging code
ANDROID: arm64: fix undeclared 'init_thread_info' error
UPSTREAM: kdb: use task_cpu() instead of task_thread_info()->cpu
ANDROID: keychord: Fix for a memory leak in keychord.
ANDROID: keychord: Fix races in keychord_write.
Use %zu to print resid (size_t).
ANDROID: keychord: Fix a slab out-of-bounds read.
ANDROID: binder: don't queue async transactions to thread.
ANDROID: binder: don't enqueue death notifications to thread todo.
ANDROID: binder: call poll_wait() unconditionally.
android: configs: move quota-related configs to recommended
BACKPORT: arm64: split thread_info from task stack
UPSTREAM: arm64: assembler: introduce ldr_this_cpu
UPSTREAM: arm64: make cpu number a percpu variable
UPSTREAM: arm64: smp: prepare for smp_processor_id() rework
BACKPORT: arm64: move sp_el0 and tpidr_el1 into cpu_suspend_ctx
UPSTREAM: arm64: prep stack walkers for THREAD_INFO_IN_TASK
UPSTREAM: arm64: unexport walk_stackframe
UPSTREAM: arm64: traps: simplify die() and __die()
UPSTREAM: arm64: factor out current_stack_pointer
BACKPORT: arm64: asm-offsets: remove unused definitions
UPSTREAM: arm64: thread_info remove stale items
UPSTREAM: thread_info: include <current.h> for THREAD_INFO_IN_TASK
UPSTREAM: thread_info: factor out restart_block
UPSTREAM: kthread: Pin the stack via try_get_task_stack()/put_task_stack() in to_live_kthread() function
UPSTREAM: sched/core: Add try_get_task_stack() and put_task_stack()
UPSTREAM: sched/core: Allow putting thread_info into task_struct
UPSTREAM: printk: when dumping regs, show the stack, not thread_info
UPSTREAM: fix up initial thread stack pointer vs thread_info confusion
UPSTREAM: Clarify naming of thread info/stack allocators
ANDROID: sdcardfs: override credential for ioctl to lower fs
ANDROID: binder: Don't BUG_ON(!spin_is_locked()).
sched/fair: Add a backup_cpu to find_best_target
sched/fair: Try to estimate possible idle states.
sched/fair: Sync task util before EAS wakeup
Revert "sched/fair: ensure utilization signals are synchronized before use"
sched/fair: kick nohz idle balance for misfit task
sched/fair: Update signals of nohz cpus if we are going idle
events: add tracepoint for find_best_target
sched/fair: streamline find_best_target heuristics
UPSTREAM: af_key: Fix sadb_x_ipsecrequest parsing
ANDROID: lowmemorykiller: Add tgid to kill message
Revert "proc: smaps: Allow smaps access for CAP_SYS_RESOURCE"
ANDROID: android-verity: mark dev as rw for linear target
ANDROID: sdcardfs: Remove unnecessary lock
ANDROID: binder: don't check prio permissions on restore.
Add BINDER_GET_NODE_DEBUG_INFO ioctl
UPSTREAM: cpufreq: schedutil: Trace frequency only if it has changed
UPSTREAM: cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely
UPSTREAM: cpufreq: schedutil: Refactor sugov_next_freq_shared()
UPSTREAM: cpufreq: schedutil: Fix per-CPU structure initialization in sugov_start()
UPSTREAM: cpufreq: schedutil: Pass sg_policy to get_next_freq()
UPSTREAM: cpufreq: schedutil: move cached_raw_freq to struct sugov_policy
UPSTREAM: cpufreq: schedutil: Rectify comment in sugov_irq_work() function
UPSTREAM: cpufreq: schedutil: irq-work and mutex are only used in slow path
UPSTREAM: cpufreq: schedutil: enable fast switch earlier
UPSTREAM: cpufreq: schedutil: Avoid indented labels
ANDROID: binder: add RT inheritance flag to node.
ANDROID: binder: improve priority inheritance.
ANDROID: binder: add min sched_policy to node.
ANDROID: binder: add support for RT prio inheritance.
ANDROID: binder: push new transactions to waiting threads.
ANDROID: binder: remove proc waitqueue
FROMLIST: binder: remove global binder lock
FROMLIST: binder: fix death race conditions
FROMLIST: binder: protect against stale pointers in print_binder_transaction
FROMLIST: binder: protect binder_ref with outer lock
FROMLIST: binder: use inner lock to protect thread accounting
FROMLIST: binder: protect transaction_stack with inner lock.
FROMLIST: binder: protect proc->threads with inner_lock
FROMLIST: binder: protect proc->nodes with inner lock
FROMLIST: binder: add spinlock to protect binder_node
FROMLIST: binder: add spinlocks to protect todo lists
FROMLIST: binder: use inner lock to sync work dq and node counts
FROMLIST: binder: introduce locking helper functions
FROMLIST: binder: use node->tmp_refs to ensure node safety
FROMLIST: binder: refactor binder ref inc/dec for thread safety
FROMLIST: binder: make sure accesses to proc/thread are safe
FROMLIST: binder: make sure target_node has strong ref
FROMLIST: binder: guarantee txn complete / errors delivered in-order
FROMLIST: binder: refactor binder_pop_transaction
FROMLIST: binder: use atomic for transaction_log index
FROMLIST: binder: add more debug info when allocation fails.
FROMLIST: binder: protect against two threads freeing buffer
FROMLIST: binder: remove dead code in binder_get_ref_for_node
FROMLIST: binder: don't modify thread->looper from other threads
FROMLIST: binder: avoid race conditions when enqueuing txn
FROMLIST: binder: refactor queue management in binder_thread_read
FROMLIST: binder: add log information for binder transaction failures
FROMLIST: binder: make binder_last_id an atomic
FROMLIST: binder: change binder_stats to atomics
FROMLIST: binder: add protection for non-perf cases
FROMLIST: binder: remove binder_debug_no_lock mechanism
FROMLIST: binder: move binder_alloc to separate file
FROMLIST: binder: separate out binder_alloc functions
FROMLIST: binder: remove unneeded cleanup code
FROMLIST: binder: separate binder allocator structure from binder proc
FROMLIST: binder: Use wake up hint for synchronous transactions.
Revert "android: binder: move global binder state into context struct."
sched: walt: fix window misalignment when HZ=300
ANDROID: android-base.cfg: remove CONFIG_CGROUP_DEBUG
ANDROID: sdcardfs: use mount_nodev and fix a issue in sdcardfs_kill_sb
UPSTREAM: selinux: enable genfscon labeling for tracefs
UPSTREAM: drivers/perf: arm-pmu: fix RCU usage on pmu resume from low-power
UPSTREAM: drivers/perf: arm_pmu: implement CPU_PM notifier
ANDROID: squashfs: Fix endianness issue
ANDROID: squashfs: Fix signed division issue
UPSTREAM: usb: gadget: f_fs: avoid out of bounds access on comp_desc
UPSTREAM: bpf: don't let ldimm64 leak map addresses on unprivileged
BACKPORT: ext4: fix data exposure after a crash
ANDROID: sdcardfs: remove dead function open_flags_to_access_mode()
ANDROID: android-base.cfg: split out arm64-specific configs
usb: gadget: f_fs: Fix possibe deadlock
ANDROID: uid_sys_stats: check previous uid_entry before call find_or_register_uid
ANDROID: sdcardfs: d_splice_alias can return error values
android: base-cfg: disable CONFIG_NFS_FS and CONFIG_NFSD
schedstats/eas: guard properly to avoid breaking non-smp schedstats users
BACKPORT: f2fs: sanity check size of nat and sit cache
FROMLIST: f2fs: sanity check checkpoint segno and blkoff
sched/tune: don't use schedtune before it is ready
sched/fair: use SCHED_CAPACITY_SCALE for energy normalization
sched/{fair,tune}: use reciprocal_value to compute boost margin
sched/tune: Initialize raw_spin_lock in boosted_groups
sched/tune: report when SchedTune has not been initialized
sched/tune: fix sched_energy_diff tracepoint
sched/tune: increase group count to 5
cpufreq/schedutil: use boosted_cpu_util for PELT to match WALT
sched/fair: Fix sched_group_energy() to support per-cpu capacity states
sched/fair: discount task contribution to find CPU with lowest utilization
sched/fair: ensure utilization signals are synchronized before use
sched/fair: remove task util from own cpu when placing waking task
trace:sched: Make util_avg in load_avg trace reflect PELT/WALT as used
sched/fair: Add eas (& cas) specific rq, sd and task stats
sched/core: Fix PELT jump to max OPP upon util increase
sched: EAS & 'single cpu per cluster'/cpu hotplug interoperability
UPSTREAM: sched/core: Fix group_entity's share update
UPSTREAM: sched/fair: Fix calc_cfs_shares() fixed point arithmetics width confusion
UPSTREAM: sched/fair: Fix incorrect task group ->load_avg
UPSTREAM: sched/fair: Fix effective_load() to consistently use smoothed load
UPSTREAM: sched/fair: Propagate asynchrous detach
UPSTREAM: sched/fair: Propagate load during synchronous attach/detach
UPSTREAM: sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list
BACKPORT: sched/fair: Factorize PELT update
UPSTREAM: sched/fair: Factorize attach/detach entity
UPSTREAM: sched/fair: Improve PELT stuff some more
UPSTREAM: sched/fair: Apply more PELT fixes
UPSTREAM: sched/fair: Fix post_init_entity_util_avg() serialization
BACKPORT: sched/fair: Initiate a new task's util avg to a bounded value
sched/fair: Simplify idle_idx handling in select_idle_sibling()
sched/fair: refactor find_best_target() for simplicity
sched/fair: Change cpu iteration order in find_best_target()
sched/core: Add first cpu w/ max/min orig capacity to root domain
sched/core: Remove remnants of commit fd5c98da1a42
sched: Remove sysctl_sched_is_big_little
sched/fair: Code !is_big_little path into select_energy_cpu_brute()
EAS: sched/fair: Re-integrate 'honor sync wakeups' into wakeup path
Fixup!: sched/fair.c: Set SchedTune specific struct energy_env.task
sched/fair: Energy-aware wake-up task placement
sched/fair: Add energy_diff dead-zone margin
sched/fair: Decommission energy_aware_wake_cpu()
sched/fair: Do not force want_affine eq. true if EAS is enabled
arm64: Set SD_ASYM_CPUCAPACITY sched_domain flag on DIE level
UPSTREAM: sched/fair: Fix incorrect comment for capacity_margin
UPSTREAM: sched/fair: Avoid pulling tasks from non-overloaded higher capacity groups
UPSTREAM: sched/fair: Add per-CPU min capacity to sched_group_capacity
UPSTREAM: sched/fair: Consider spare capacity in find_idlest_group()
UPSTREAM: sched/fair: Compute task/cpu utilization at wake-up correctly
UPSTREAM: sched/fair: Let asymmetric CPU configurations balance at wake-up
UPSTREAM: sched/core: Enable SD_BALANCE_WAKE for asymmetric capacity systems
UPSTREAM: sched/core: Pass child domain into sd_init()
UPSTREAM: sched/core: Introduce SD_ASYM_CPUCAPACITY sched_domain topology flag
UPSTREAM: sched/core: Remove unnecessary NULL-pointer check
UPSTREAM: sched/fair: Optimize find_idlest_cpu() when there is no choice
BACKPORT: sched/fair: Make the use of prev_cpu consistent in the wakeup path
UPSTREAM: sched/core: Fix power to capacity renaming in comment
Partial Revert: "WIP: sched: Add cpu capacity awareness to wakeup balancing"
Revert "WIP: sched: Consider spare cpu capacity at task wake-up"
FROM-LIST: cpufreq: schedutil: Redefine the rate_limit_us tunable
cpufreq: schedutil: add up/down frequency transition rate limits
trace/sched: add rq utilization signal for WALT
sched/cpufreq: make schedutil use WALT signal
sched: cpufreq: use rt_avg as estimate of required RT CPU capacity
cpufreq: schedutil: move slow path from workqueue to SCHED_FIFO task
BACKPORT: kthread: allow to cancel kthread work
sched/cpufreq: fix tunables for schedfreq governor
BACKPORT: cpufreq: schedutil: New governor based on scheduler utilization data
sched: backport cpufreq hooks from 4.9-rc4
ANDROID: Kconfig: add depends for UID_SYS_STATS
ANDROID: hid: uhid: implement refcount for open and close
Revert "ext4: require encryption feature for EXT4_IOC_SET_ENCRYPTION_POLICY"
ANDROID: mnt: Fix next_descendent
ANDROID: uid_sys_stats: defer io stats calulation for dead tasks
ANDROID: AVB: Fix linter errors.
ANDROID: AVB: Fix invalidate_vbmeta_submit().
ANDROID: sdcardfs: Check for NULL in revalidate
ANDROID: AVB: Only invalidate vbmeta when told to do so.
ANDROID: sdcardfs: Move top to its own struct
ANDROID: lowmemorykiller: account for unevictable pages
ANDROID: usb: gadget: fix NULL pointer issue in mtp_read()
ANDROID: usb: f_mtp: return error code if transfer error in receive_file_work function
ANDROID: android-base.cfg: remove spurious CONFIG_MODULES line
ANDROID: memory_state_time: fix undefined behavior with missing DT properties
ANDROID: rfkill: fix unused function warning
ANDROID: make PF_KEY SHA256 use RFC-compliant truncation.
ANDROID: sdcardfs: fix sdcardfs_destroy_inode for the inode RCU approach
ANDROID: android-base.cfg: remove NETFILTER_XT_MATCH_QUOTA2_LOG
ANDROID: sdcardfs: Don't iput if we didn't igrab
ANDROID: Add untag hacks to inet_release function
ANDROID: android-base.cfg: remove USB_OTG_WAKELOCK
ANDROID: android-base.cfg: remove defunct options
ANDROID: arm64: suspend: Restore the UAO state
ANDROID: usb: gadget: f_audio_source: disable the CPU C-states upon playback
ANDROID: usb: gadget: f_mtp: Set 0xFFFFFFFF in mtp header ContainerLength field
net: pppolac/pppopns: Add back the msg_flags
ANDROID: uid_sys_stats: fix access of task_uid(task)
BACKPORT: f2fs: sanity check log_blocks_per_seg
ANDROID: sdcardfs: Call lower fs's revalidate
ANDROID: sdcardfs: Avoid setting GIDs outside of valid ranges
ANDROID: sdcardfs: Copy meta-data from lower inode
Revert "Revert "Android: sdcardfs: Don't do d_add for lower fs""
ANDROID: sdcardfs: Use filesystem specific hash
ANDROID: AVB error handler to invalidate vbmeta partition.
ANDROID: Update init/do_mounts_dm.c to the latest ChromiumOS version.
Revert "[RFC]cgroup: Change from CAP_SYS_NICE to CAP_SYS_RESOURCE for cgroup migration permissions"
Revert "USB: gadget: u_ether: Fix data stall issue in RNDIS tethering mode"
ANDROID: uid_sys_stats: reduce update_io_stats overhead
UPSTREAM: char: lack of bool string made CONFIG_DEVPORT always on
UPSTREAM: char: Drop bogus dependency of DEVPORT on !M68K
Revert "Android: sdcardfs: Don't do d_add for lower fs"
ANDROID: usb: gadget: fix MTP enumeration issue under super speed mode
Android: sdcardfs: Don't complain in fixup_lower_ownership
Android: sdcardfs: Don't do d_add for lower fs
ANDROID: sdcardfs: ->iget fixes
Android: sdcardfs: Change cache GID value
BACKPORT: [UPSTREAM] ext2: convert to mbcache2
BACKPORT [UPSTREAM] ext4: convert to mbcache2
BACKPORT: [UPSTREAM] mbcache2: reimplement mbcache
UPSTREAM: net: socket: Make unnecessarily global sockfs_setattr() static
UPSTREAM: net: ipv4: Don't crash if passing a null sk to ip_do_redirect.
UPSTREAM: net/packet: fix overflow in check for priv area size
Revert "Revert "Revert "CHROMIUM: android: binder: Fix potential scheduling-while-atomic"""
ANDROID: sdcardfs: Directly pass lower file for mmap
UPSTREAM: checkpatch: special audit for revert commit line
UPSTREAM: PM / sleep: make PM notifiers called symmetrically
Revert "Revert "CHROMIUM: android: binder: Fix potential scheduling-while-atomic""
BACKPORT: arm64: dts: juno: fix cluster sleep state entry latency on all SoC versions
staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
ANDROID: sdcardfs: update module info
ANDROID: sdcardfs: use d_splice_alias
ANDROID: sdcardfs: add read_iter/write_iter opeations
ANDROID: sdcardfs: fix ->llseek to update upper and lower offset
ANDROID: sdcardfs: copy lower inode attributes in ->ioctl
ANDROID: sdcardfs: remove unnecessary call to do_munmap
Merge 4.4.59 into android-4.4
UPSTREAM: ipv6 addrconf: implement RFC7559 router solicitation backoff
android: base-cfg: enable CONFIG_INET_DIAG_DESTROY
ANDROID: android-base.cfg: add CONFIG_MODULES option
ANDROID: android-base.cfg: add CONFIG_IKCONFIG option
ANDROID: android-base.cfg: properly sort the file
ANDROID: binder: add hwbinder,vndbinder to BINDER_DEVICES.
ANDROID: sort android-recommended.cfg
UPSTREAM: config/android: Remove CONFIG_IPV6_PRIVACY
UPSTREAM: config: android: set SELinux as default security mode
config: android: move device mapper options to recommended
ANDROID: ARM64: Allow to choose appended kernel image
UPSTREAM: arm64: vdso: constify vm_special_mapping used for aarch32 vectors page
UPSTREAM: arm64: vdso: add __init section marker to alloc_vectors_page
UPSTREAM: ARM: 8597/1: VDSO: put RO and RO after init objects into proper sections
UPSTREAM: arm64: Add support for CLOCK_MONOTONIC_RAW in clock_gettime() vDSO
UPSTREAM: arm64: Refactor vDSO time functions
UPSTREAM: arm64: fix vdso-offsets.h dependency
UPSTREAM: kbuild: drop FORCE from PHONY targets
UPSTREAM: mm: add PHYS_PFN, use it in __phys_to_pfn()
UPSTREAM: ARM: 8476/1: VDSO: use PTR_ERR_OR_ZERO for vma check
ANDROID: sdcardfs: Fix style issues in macros
ANDROID: sdcardfs: Use seq_puts over seq_printf
ANDROID: sdcardfs: Use to kstrout
ANDROID: sdcardfs: Use pr_[...] instead of printk
ANDROID: sdcardfs: remove unneeded null check
ANDROID: sdcardfs: Fix style issues with comments
ANDROID: sdcardfs: Fix formatting
ANDROID: sdcardfs: correct order of descriptors
fix the deadlock in xt_qtaguid when enable DDEBUG
net: ipv6: Add sysctl for minimum prefix len acceptable in RIOs.
ANDROID: mmc: core: export emmc revision
BACKPORT: mmc: core: Export device lifetime information through sysfs
ANDROID: android-verity: do not compile as independent module
ANDROID: sched: fix duplicate sched_group_energy const specifiers
config: disable CONFIG_USELIB and CONFIG_FHANDLE
ANDROID: power: align wakeup_sources format
ANDROID: dm: android-verity: allow disable dm-verity for Treble VTS
uid_sys_stats: change to use rt_mutex
ANDROID: vfs: user permission2 in notify_change2
ANDROID: sdcardfs: Fix gid issue
ANDROID: sdcardfs: Use tabs instead of spaces in multiuser.h
ANDROID: sdcardfs: Remove uninformative prints
ANDROID: sdcardfs: move path_put outside of spinlock
ANDROID: sdcardfs: Use case insensitive hash function
ANDROID: sdcardfs: declare MODULE_ALIAS_FS
ANDROID: sdcardfs: Get the blocksize from the lower fs
ANDROID: sdcardfs: Use d_invalidate instead of drop_recurisve
ANDROID: sdcardfs: Switch to internal case insensitive compare
ANDROID: sdcardfs: Use spin_lock_nested
ANDROID: sdcardfs: Replace get/put with d_lock
ANDROID: sdcardfs: rate limit warning print
ANDROID: sdcardfs: Fix case insensitive lookup
ANDROID: uid_sys_stats: account for fsync syscalls
ANDROID: sched: add a counter to track fsync
ANDROID: uid_sys_stats: fix negative write bytes.
ANDROID: uid_sys_stats: allow writing same state
ANDROID: uid_sys_stats: rename uid_cputime.c to uid_sys_stats.c
ANDROID: uid_cputime: add per-uid IO usage accounting
DTB: Add EAS compatible Juno Energy model to 'juno.dts'
arm64: dts: juno: Add idle-states to device tree
ANDROID: Replace spaces by '_' for some android filesystem tracepoints.
usb: gadget: f_accessory: Fix for UsbAccessory clean unbind.
android: binder: move global binder state into context struct.
android: binder: add padding to binder_fd_array_object.
binder: use group leader instead of open thread
nf: IDLETIMER: Use fullsock when querying uid
nf: IDLETIMER: Fix use after free condition during work
ANDROID: dm: android-verity: fix table_make_digest() error handling
ANDROID: usb: gadget: function: Fix commenting style
cpufreq: interactive governor drops bits in time calculation
ANDROID: sdcardfs: support direct-IO (DIO) operations
ANDROID: sdcardfs: implement vm_ops->page_mkwrite
ANDROID: sdcardfs: Don't bother deleting freelist
ANDROID: sdcardfs: Add missing path_put
ANDROID: sdcardfs: Fix incorrect hash
ANDROID: ext4 crypto: Disables zeroing on truncation when there's no key
ANDROID: ext4: add a non-reversible key derivation method
ANDROID: ext4: allow encrypting filenames using HEH algorithm
ANDROID: arm64/crypto: add ARMv8-CE optimized poly_hash algorithm
ANDROID: crypto: heh - factor out poly_hash algorithm
ANDROID: crypto: heh - Add Hash-Encrypt-Hash (HEH) algorithm
ANDROID: crypto: gf128mul - Add ble multiplication functions
ANDROID: crypto: gf128mul - Refactor gf128 overflow macros and tables
UPSTREAM: crypto: gf128mul - Zero memory when freeing multiplication table
ANDROID: crypto: shash - Add crypto_grab_shash() and crypto_spawn_shash_alg()
ANDROID: crypto: allow blkcipher walks over ablkcipher data
UPSTREAM: arm/arm64: crypto: assure that ECB modes don't require an IV
ANDROID: Refactor fs readpage/write tracepoints.
ANDROID: export security_path_chown
Squashfs: optimize reading uncompressed data
Squashfs: implement .readpages()
Squashfs: replace buffer_head with BIO
Squashfs: refactor page_actor
Squashfs: remove the FILE_CACHE option
ANDROID: android-recommended.cfg: CONFIG_CPU_SW_DOMAIN_PAN=y
FROMLIST: 9p: fix a potential acl leak
BACKPORT: posix_acl: Clear SGID bit when setting file permissions
UPSTREAM: udp: properly support MSG_PEEK with truncated buffers
UPSTREAM: arm64: Allow hw watchpoint of length 3,5,6 and 7
BACKPORT: arm64: hw_breakpoint: Handle inexact watchpoint addresses
UPSTREAM: arm64: Allow hw watchpoint at varied offset from base address
BACKPORT: hw_breakpoint: Allow watchpoint of length 3,5,6 and 7
ANDROID: sdcardfs: Switch strcasecmp for internal call
ANDROID: sdcardfs: switch to full_name_hash and qstr
ANDROID: sdcardfs: Add GID Derivation to sdcardfs
ANDROID: sdcardfs: Remove redundant operation
ANDROID: sdcardfs: add support for user permission isolation
ANDROID: sdcardfs: Refactor configfs interface
ANDROID: sdcardfs: Allow non-owners to touch
ANDROID: binder: fix format specifier for type binder_size_t
ANDROID: fs: Export vfs_rmdir2
ANDROID: fs: Export free_fs_struct and set_fs_pwd
BACKPORT: Input: xpad - validate USB endpoint count during probe
BACKPORT: Input: xpad - fix oops when attaching an unknown Xbox One gamepad
ANDROID: mnt: remount should propagate to slaves of slaves
ANDROID: sdcardfs: Switch ->d_inode to d_inode()
ANDROID: sdcardfs: Fix locking issue with permision fix up
ANDROID: sdcardfs: Change magic value
ANDROID: sdcardfs: Use per mount permissions
ANDROID: sdcardfs: Add gid and mask to private mount data
ANDROID: sdcardfs: User new permission2 functions
ANDROID: vfs: Add setattr2 for filesystems with per mount permissions
ANDROID: vfs: Add permission2 for filesystems with per mount permissions
ANDROID: vfs: Allow filesystems to access their private mount data
ANDROID: mnt: Add filesystem private data to mount points
ANDROID: sdcardfs: Move directory unlock before touch
ANDROID: sdcardfs: fix external storage exporting incorrect uid
ANDROID: sdcardfs: Added top to sdcardfs_inode_info
ANDROID: sdcardfs: Switch package list to RCU
ANDROID: sdcardfs: Fix locking for permission fix up
ANDROID: sdcardfs: Check for other cases on path lookup
ANDROID: sdcardfs: override umask on mkdir and create
arm64: kernel: Fix build warning
DEBUG: sched/fair: Fix sched_load_avg_cpu events for task_groups
DEBUG: sched/fair: Fix missing sched_load_avg_cpu events
UPSTREAM: l2tp: fix racy SOCK_ZAPPED flag check in l2tp_ip{,6}_bind()
UPSTREAM: packet: fix race condition in packet_set_ring
UPSTREAM: netlink: Fix dump skb leak/double free
UPSTREAM: net: avoid signed overflows for SO_{SND|RCV}BUFFORCE
MIPS: Prevent "restoration" of MSA context in non-MSA kernels
net: socket: don't set sk_uid to garbage value in ->setattr()
ANDROID: configs: CONFIG_ARM64_SW_TTBR0_PAN=y
UPSTREAM: arm64: Disable PAN on uaccess_enable()
UPSTREAM: arm64: Enable CONFIG_ARM64_SW_TTBR0_PAN
UPSTREAM: arm64: xen: Enable user access before a privcmd hvc call
UPSTREAM: arm64: Handle faults caused by inadvertent user access with PAN enabled
BACKPORT: arm64: Disable TTBR0_EL1 during normal kernel execution
BACKPORT: arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1
BACKPORT: arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro
BACKPORT: arm64: Factor out PAN enabling/disabling into separate uaccess_* macros
UPSTREAM: arm64: alternative: add auto-nop infrastructure
UPSTREAM: arm64: barriers: introduce nops and __nops macros for NOP sequences
Revert "FROMLIST: arm64: Factor out PAN enabling/disabling into separate uaccess_* macros"
Revert "FROMLIST: arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro"
Revert "FROMLIST: arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1"
Revert "FROMLIST: arm64: Disable TTBR0_EL1 during normal kernel execution"
Revert "FROMLIST: arm64: Handle faults caused by inadvertent user access with PAN enabled"
Revert "FROMLIST: arm64: xen: Enable user access before a privcmd hvc call"
Revert "FROMLIST: arm64: Enable CONFIG_ARM64_SW_TTBR0_PAN"
ANDROID: sched/walt: fix build failure if FAIR_GROUP_SCHED=n
ANDROID: trace: net: use %pK for kernel pointers
ANDROID: android-base: Enable QUOTA related configs
net: ipv4: Don't crash if passing a null sk to ip_rt_update_pmtu.
net: inet: Support UID-based routing in IP protocols.
net: core: add UID to flows, rules, and routes
net: core: Add a UID field to struct sock.
Revert "net: core: Support UID-based routing."
UPSTREAM: efi/arm64: Don't apply MEMBLOCK_NOMAP to UEFI memory map mapping
UPSTREAM: arm64: mm: always take dirty state from new pte in ptep_set_access_flags
UPSTREAM: arm64: Implement pmdp_set_access_flags() for hardware AF/DBM
UPSTREAM: arm64: Fix typo in the pmdp_huge_get_and_clear() definition
UPSTREAM: arm64: enable CONFIG_DEBUG_RODATA by default
goldfish: enable CONFIG_INET_DIAG_DESTROY
sched/walt: kill {min,max}_capacity
sched: fix wrong truncation of walt_avg
build: fix build config kernel_dir
ANDROID: dm verity: add minimum prefetch size
build: add build server configs for goldfish
usb: gadget: Fix compilation problem with tx_qlen field
Conflicts:
Documentation/kasan.txt
Makefile
arch/arm64/Makefile
arch/arm64/boot/Makefile
arch/arm64/include/asm/assembler.h
arch/arm64/include/asm/cputype.h
arch/arm64/include/asm/efi.h
arch/arm64/include/asm/mmu_context.h
arch/arm64/include/asm/signal32.h
arch/arm64/include/asm/suspend.h
arch/arm64/include/asm/vdso_datapage.h
arch/arm64/kernel/asm-offsets.c
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/entry.S
arch/arm64/kernel/head.S
arch/arm64/kernel/insn.c
arch/arm64/kernel/io.c
arch/arm64/kernel/psci.c
arch/arm64/kernel/setup.c
arch/arm64/kernel/smp.c
arch/arm64/kernel/suspend.c
arch/arm64/kernel/traps.c
arch/arm64/kernel/vdso.c
arch/arm64/kernel/vdso/gettimeofday.S
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/mm/cache.S
arch/arm64/mm/fault.c
arch/arm64/mm/kasan_init.c
arch/arm64/mm/mmu.c
arch/arm64/mm/proc.S
arch/x86/include/asm/thread_info.h
arch/x86/kernel/Makefile
arch/x86/kernel/kprobes/core.c
block/blk-core.c
build.config.common
drivers/Kconfig
drivers/Makefile
drivers/android/Makefile
drivers/android/binder.c
drivers/base/power/main.c
drivers/block/loop.c
drivers/clocksource/Kconfig
drivers/cpufreq/Kconfig
drivers/cpufreq/cpufreq-dt.c
drivers/gpu/drm/msm/msm_gem_submit.c
drivers/irqchip/Kconfig
drivers/irqchip/Makefile
drivers/md/Kconfig
drivers/md/Makefile
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/uid_sys_stats.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h
drivers/staging/android/Kconfig
drivers/staging/android/Makefile
drivers/staging/android/fiq_debugger/fiq_watchdog.h
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/ion_cma_heap.c
drivers/tee/optee/shm_pool.h
drivers/usb/dwc3/gadget.c
drivers/usb/gadget/configfs.c
drivers/usb/gadget/function/f_accessory.c
fs/exec.c
fs/ext4/crypto.c
fs/ext4/crypto_fname.c
fs/ext4/crypto_key.c
fs/ext4/ext4.h
fs/ext4/ext4_crypto.h
fs/f2fs/crypto_policy.c
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/super.c
fs/proc/task_mmu.c
fs/sdcardfs/derived_perm.c
fs/sdcardfs/inode.c
fs/sdcardfs/main.c
fs/sdcardfs/sdcardfs.h
fs/squashfs/lz4_wrapper.c
include/linux/blkdev.h
include/linux/cpufreq.h
include/linux/dcache.h
include/linux/mmc/card.h
include/linux/mmc/mmc.h
include/linux/msm_mdp.h
include/linux/sched.h
include/linux/slab_def.h
include/linux/slub_def.h
include/linux/thread_info.h
include/trace/events/android_fs.h
include/trace/events/sched.h
include/uapi/linux/android/binder.h
include/uapi/linux/ipv6.h
include/uapi/linux/prctl.h
kernel/configs/android-base.config
kernel/configs/android-recommended.config
kernel/cpu.c
kernel/fork.c
kernel/sched/Makefile
kernel/sched/core.c
kernel/sched/cpufreq_sched.c
kernel/sched/cpufreq_schedutil.c
kernel/sched/fair.c
kernel/sched/rt.c
kernel/sched/sched.h
kernel/sched/stats.c
kernel/sched/walt.c
kernel/sys.c
kernel/sysctl.c
kernel/time/timekeeping.c
lib/Kconfig
lib/test_kasan.c
mm/kasan/Makefile
mm/kasan/kasan.c
mm/kasan/kasan.h
mm/kasan/report.c
mm/slab.c
mm/slab.h
mm/slub.c
net/ipv4/route.c
net/ipv4/tcp_ipv4.c
net/ipv4/xfrm4_policy.c
net/ipv6/route.c
net/netfilter/xt_IDLETIMER.c
net/netfilter/xt_qtaguid.c
net/netfilter/xt_quota2.c
net/socket.c
net/wireless/scan.c
scripts/Makefile.lib
scripts/checkpatch.pl
security/selinux/nlmsgtab.c
Skipped commit:
a08cafa7e0 ANDROID: ARM64: Allow to choose appended kernel image
Change-Id: I306e14a74d75f56cd39b5ad344f0f4440c26b52a
1919 lines
50 KiB
C
1919 lines
50 KiB
C
/*
|
|
* linux/kernel/hrtimer.c
|
|
*
|
|
* Copyright(C) 2005-2006, Thomas Gleixner <tglx@linutronix.de>
|
|
* Copyright(C) 2005-2007, Red Hat, Inc., Ingo Molnar
|
|
* Copyright(C) 2006-2007 Timesys Corp., Thomas Gleixner
|
|
*
|
|
* High-resolution kernel timers
|
|
*
|
|
* In contrast to the low-resolution timeout API implemented in
|
|
* kernel/timer.c, hrtimers provide finer resolution and accuracy
|
|
* depending on system configuration and capabilities.
|
|
*
|
|
* These timers are currently used for:
|
|
* - itimers
|
|
* - POSIX timers
|
|
* - nanosleep
|
|
* - precise in-kernel timing
|
|
*
|
|
* Started by: Thomas Gleixner and Ingo Molnar
|
|
*
|
|
* Credits:
|
|
* based on kernel/timer.c
|
|
*
|
|
* Help, testing, suggestions, bugfixes, improvements were
|
|
* provided by:
|
|
*
|
|
* George Anzinger, Andrew Morton, Steven Rostedt, Roman Zippel
|
|
* et. al.
|
|
*
|
|
* For licencing details see kernel-base/COPYING
|
|
*/
|
|
|
|
#include <linux/cpu.h>
|
|
#include <linux/export.h>
|
|
#include <linux/percpu.h>
|
|
#include <linux/hrtimer.h>
|
|
#include <linux/notifier.h>
|
|
#include <linux/syscalls.h>
|
|
#include <linux/kallsyms.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/tick.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/err.h>
|
|
#include <linux/debugobjects.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/sched/sysctl.h>
|
|
#include <linux/sched/rt.h>
|
|
#include <linux/sched/deadline.h>
|
|
#include <linux/timer.h>
|
|
#include <linux/freezer.h>
|
|
#include <linux/delay.h>
|
|
|
|
#include <asm/uaccess.h>
|
|
|
|
#include <trace/events/timer.h>
|
|
|
|
#include "tick-internal.h"
|
|
|
|
/*
|
|
* The timer bases:
|
|
*
|
|
* There are more clockids than hrtimer bases. Thus, we index
|
|
* into the timer bases by the hrtimer_base_type enum. When trying
|
|
* to reach a base using a clockid, hrtimer_clockid_to_base()
|
|
* is used to convert from clockid to the proper hrtimer_base_type.
|
|
*/
|
|
DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) =
|
|
{
|
|
.lock = __RAW_SPIN_LOCK_UNLOCKED(hrtimer_bases.lock),
|
|
.seq = SEQCNT_ZERO(hrtimer_bases.seq),
|
|
.clock_base =
|
|
{
|
|
{
|
|
.index = HRTIMER_BASE_MONOTONIC,
|
|
.clockid = CLOCK_MONOTONIC,
|
|
.get_time = &ktime_get,
|
|
},
|
|
{
|
|
.index = HRTIMER_BASE_REALTIME,
|
|
.clockid = CLOCK_REALTIME,
|
|
.get_time = &ktime_get_real,
|
|
},
|
|
{
|
|
.index = HRTIMER_BASE_BOOTTIME,
|
|
.clockid = CLOCK_BOOTTIME,
|
|
.get_time = &ktime_get_boottime,
|
|
},
|
|
{
|
|
.index = HRTIMER_BASE_TAI,
|
|
.clockid = CLOCK_TAI,
|
|
.get_time = &ktime_get_clocktai,
|
|
},
|
|
}
|
|
};
|
|
|
|
static const int hrtimer_clock_to_base_table[MAX_CLOCKS] = {
|
|
/* Make sure we catch unsupported clockids */
|
|
[0 ... MAX_CLOCKS - 1] = HRTIMER_MAX_CLOCK_BASES,
|
|
|
|
[CLOCK_REALTIME] = HRTIMER_BASE_REALTIME,
|
|
[CLOCK_MONOTONIC] = HRTIMER_BASE_MONOTONIC,
|
|
[CLOCK_BOOTTIME] = HRTIMER_BASE_BOOTTIME,
|
|
[CLOCK_TAI] = HRTIMER_BASE_TAI,
|
|
};
|
|
|
|
static inline int hrtimer_clockid_to_base(clockid_t clock_id)
|
|
{
|
|
int base = hrtimer_clock_to_base_table[clock_id];
|
|
BUG_ON(base == HRTIMER_MAX_CLOCK_BASES);
|
|
return base;
|
|
}
|
|
|
|
/*
|
|
* Functions and macros which are different for UP/SMP systems are kept in a
|
|
* single place
|
|
*/
|
|
#ifdef CONFIG_SMP
|
|
|
|
/*
|
|
* We require the migration_base for lock_hrtimer_base()/switch_hrtimer_base()
|
|
* such that hrtimer_callback_running() can unconditionally dereference
|
|
* timer->base->cpu_base
|
|
*/
|
|
static struct hrtimer_cpu_base migration_cpu_base = {
|
|
.seq = SEQCNT_ZERO(migration_cpu_base),
|
|
.clock_base = { { .cpu_base = &migration_cpu_base, }, },
|
|
};
|
|
|
|
#define migration_base migration_cpu_base.clock_base[0]
|
|
|
|
/*
|
|
* We are using hashed locking: holding per_cpu(hrtimer_bases)[n].lock
|
|
* means that all timers which are tied to this base via timer->base are
|
|
* locked, and the base itself is locked too.
|
|
*
|
|
* So __run_timers/migrate_timers can safely modify all timers which could
|
|
* be found on the lists/queues.
|
|
*
|
|
* When the timer's base is locked, and the timer removed from list, it is
|
|
* possible to set timer->base = &migration_base and drop the lock: the timer
|
|
* remains locked.
|
|
*/
|
|
static
|
|
struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer,
|
|
unsigned long *flags)
|
|
{
|
|
struct hrtimer_clock_base *base;
|
|
|
|
for (;;) {
|
|
base = timer->base;
|
|
if (likely(base != &migration_base)) {
|
|
raw_spin_lock_irqsave(&base->cpu_base->lock, *flags);
|
|
if (likely(base == timer->base))
|
|
return base;
|
|
/* The timer has migrated to another CPU: */
|
|
raw_spin_unlock_irqrestore(&base->cpu_base->lock, *flags);
|
|
}
|
|
cpu_relax();
|
|
}
|
|
}
|
|
|
|
/*
|
|
* With HIGHRES=y we do not migrate the timer when it is expiring
|
|
* before the next event on the target cpu because we cannot reprogram
|
|
* the target cpu hardware and we would cause it to fire late.
|
|
*
|
|
* Called with cpu_base->lock of target cpu held.
|
|
*/
|
|
static int
|
|
hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base)
|
|
{
|
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
|
ktime_t expires;
|
|
|
|
if (!new_base->cpu_base->hres_active)
|
|
return 0;
|
|
|
|
expires = ktime_sub(hrtimer_get_expires(timer), new_base->offset);
|
|
return expires.tv64 <= new_base->cpu_base->expires_next.tv64;
|
|
#else
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
|
|
static inline
|
|
struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base,
|
|
int pinned)
|
|
{
|
|
if (pinned || !base->migration_enabled)
|
|
return base;
|
|
return &per_cpu(hrtimer_bases, get_nohz_timer_target());
|
|
}
|
|
#else
|
|
static inline
|
|
struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base,
|
|
int pinned)
|
|
{
|
|
return base;
|
|
}
|
|
#endif
|
|
|
|
/*
|
|
* We switch the timer base to a power-optimized selected CPU target,
|
|
* if:
|
|
* - NO_HZ_COMMON is enabled
|
|
* - timer migration is enabled
|
|
* - the timer callback is not running
|
|
* - the timer is not the first expiring timer on the new target
|
|
*
|
|
* If one of the above requirements is not fulfilled we move the timer
|
|
* to the current CPU or leave it on the previously assigned CPU if
|
|
* the timer callback is currently running.
|
|
*/
|
|
static inline struct hrtimer_clock_base *
|
|
switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base,
|
|
int pinned)
|
|
{
|
|
struct hrtimer_cpu_base *new_cpu_base, *this_cpu_base;
|
|
struct hrtimer_clock_base *new_base;
|
|
int basenum = base->index;
|
|
|
|
this_cpu_base = this_cpu_ptr(&hrtimer_bases);
|
|
new_cpu_base = get_target_base(this_cpu_base, pinned);
|
|
again:
|
|
new_base = &new_cpu_base->clock_base[basenum];
|
|
|
|
if (base != new_base) {
|
|
/*
|
|
* We are trying to move timer to new_base.
|
|
* However we can't change timer's base while it is running,
|
|
* so we keep it on the same CPU. No hassle vs. reprogramming
|
|
* the event source in the high resolution case. The softirq
|
|
* code will take care of this when the timer function has
|
|
* completed. There is no conflict as we hold the lock until
|
|
* the timer is enqueued.
|
|
*/
|
|
if (unlikely(hrtimer_callback_running(timer)))
|
|
return base;
|
|
|
|
/* See the comment in lock_hrtimer_base() */
|
|
timer->base = &migration_base;
|
|
raw_spin_unlock(&base->cpu_base->lock);
|
|
raw_spin_lock(&new_base->cpu_base->lock);
|
|
|
|
if (new_cpu_base != this_cpu_base &&
|
|
hrtimer_check_target(timer, new_base)) {
|
|
raw_spin_unlock(&new_base->cpu_base->lock);
|
|
raw_spin_lock(&base->cpu_base->lock);
|
|
new_cpu_base = this_cpu_base;
|
|
timer->base = base;
|
|
goto again;
|
|
}
|
|
timer->base = new_base;
|
|
} else {
|
|
if (new_cpu_base != this_cpu_base &&
|
|
hrtimer_check_target(timer, new_base)) {
|
|
new_cpu_base = this_cpu_base;
|
|
goto again;
|
|
}
|
|
}
|
|
return new_base;
|
|
}
|
|
|
|
#else /* CONFIG_SMP */
|
|
|
|
static inline struct hrtimer_clock_base *
|
|
lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
|
|
{
|
|
struct hrtimer_clock_base *base = timer->base;
|
|
|
|
raw_spin_lock_irqsave(&base->cpu_base->lock, *flags);
|
|
|
|
return base;
|
|
}
|
|
|
|
# define switch_hrtimer_base(t, b, p) (b)
|
|
|
|
#endif /* !CONFIG_SMP */
|
|
|
|
/*
|
|
* Functions for the union type storage format of ktime_t which are
|
|
* too large for inlining:
|
|
*/
|
|
#if BITS_PER_LONG < 64
|
|
/*
|
|
* Divide a ktime value by a nanosecond value
|
|
*/
|
|
s64 __ktime_divns(const ktime_t kt, s64 div)
|
|
{
|
|
int sft = 0;
|
|
s64 dclc;
|
|
u64 tmp;
|
|
|
|
dclc = ktime_to_ns(kt);
|
|
tmp = dclc < 0 ? -dclc : dclc;
|
|
|
|
/* Make sure the divisor is less than 2^32: */
|
|
while (div >> 32) {
|
|
sft++;
|
|
div >>= 1;
|
|
}
|
|
tmp >>= sft;
|
|
do_div(tmp, (unsigned long) div);
|
|
return dclc < 0 ? -tmp : tmp;
|
|
}
|
|
EXPORT_SYMBOL_GPL(__ktime_divns);
|
|
#endif /* BITS_PER_LONG >= 64 */
|
|
|
|
/*
|
|
* Add two ktime values and do a safety check for overflow:
|
|
*/
|
|
ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs)
|
|
{
|
|
ktime_t res = ktime_add_unsafe(lhs, rhs);
|
|
|
|
/*
|
|
* We use KTIME_SEC_MAX here, the maximum timeout which we can
|
|
* return to user space in a timespec:
|
|
*/
|
|
if (res.tv64 < 0 || res.tv64 < lhs.tv64 || res.tv64 < rhs.tv64)
|
|
res = ktime_set(KTIME_SEC_MAX, 0);
|
|
|
|
return res;
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(ktime_add_safe);
|
|
|
|
#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
|
|
|
|
static struct debug_obj_descr hrtimer_debug_descr;
|
|
|
|
static void *hrtimer_debug_hint(void *addr)
|
|
{
|
|
return ((struct hrtimer *) addr)->function;
|
|
}
|
|
|
|
/*
|
|
* fixup_init is called when:
|
|
* - an active object is initialized
|
|
*/
|
|
static int hrtimer_fixup_init(void *addr, enum debug_obj_state state)
|
|
{
|
|
struct hrtimer *timer = addr;
|
|
|
|
switch (state) {
|
|
case ODEBUG_STATE_ACTIVE:
|
|
hrtimer_cancel(timer);
|
|
debug_object_init(timer, &hrtimer_debug_descr);
|
|
return 1;
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* fixup_activate is called when:
|
|
* - an active object is activated
|
|
* - an unknown object is activated (might be a statically initialized object)
|
|
*/
|
|
static int hrtimer_fixup_activate(void *addr, enum debug_obj_state state)
|
|
{
|
|
switch (state) {
|
|
|
|
case ODEBUG_STATE_NOTAVAILABLE:
|
|
WARN_ON_ONCE(1);
|
|
return 0;
|
|
|
|
case ODEBUG_STATE_ACTIVE:
|
|
WARN_ON(1);
|
|
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* fixup_free is called when:
|
|
* - an active object is freed
|
|
*/
|
|
static int hrtimer_fixup_free(void *addr, enum debug_obj_state state)
|
|
{
|
|
struct hrtimer *timer = addr;
|
|
|
|
switch (state) {
|
|
case ODEBUG_STATE_ACTIVE:
|
|
hrtimer_cancel(timer);
|
|
debug_object_free(timer, &hrtimer_debug_descr);
|
|
return 1;
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
static struct debug_obj_descr hrtimer_debug_descr = {
|
|
.name = "hrtimer",
|
|
.debug_hint = hrtimer_debug_hint,
|
|
.fixup_init = hrtimer_fixup_init,
|
|
.fixup_activate = hrtimer_fixup_activate,
|
|
.fixup_free = hrtimer_fixup_free,
|
|
};
|
|
|
|
static inline void debug_hrtimer_init(struct hrtimer *timer)
|
|
{
|
|
debug_object_init(timer, &hrtimer_debug_descr);
|
|
}
|
|
|
|
static inline void debug_hrtimer_activate(struct hrtimer *timer)
|
|
{
|
|
debug_object_activate(timer, &hrtimer_debug_descr);
|
|
}
|
|
|
|
static inline void debug_hrtimer_deactivate(struct hrtimer *timer)
|
|
{
|
|
debug_object_deactivate(timer, &hrtimer_debug_descr);
|
|
}
|
|
|
|
static inline void debug_hrtimer_free(struct hrtimer *timer)
|
|
{
|
|
debug_object_free(timer, &hrtimer_debug_descr);
|
|
}
|
|
|
|
static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
|
|
enum hrtimer_mode mode);
|
|
|
|
void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t clock_id,
|
|
enum hrtimer_mode mode)
|
|
{
|
|
debug_object_init_on_stack(timer, &hrtimer_debug_descr);
|
|
__hrtimer_init(timer, clock_id, mode);
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_init_on_stack);
|
|
|
|
void destroy_hrtimer_on_stack(struct hrtimer *timer)
|
|
{
|
|
debug_object_free(timer, &hrtimer_debug_descr);
|
|
}
|
|
EXPORT_SYMBOL_GPL(destroy_hrtimer_on_stack);
|
|
|
|
#else
|
|
static inline void debug_hrtimer_init(struct hrtimer *timer) { }
|
|
static inline void debug_hrtimer_activate(struct hrtimer *timer) { }
|
|
static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { }
|
|
#endif
|
|
|
|
static inline void
|
|
debug_init(struct hrtimer *timer, clockid_t clockid,
|
|
enum hrtimer_mode mode)
|
|
{
|
|
debug_hrtimer_init(timer);
|
|
trace_hrtimer_init(timer, clockid, mode);
|
|
}
|
|
|
|
static inline void debug_activate(struct hrtimer *timer)
|
|
{
|
|
debug_hrtimer_activate(timer);
|
|
trace_hrtimer_start(timer);
|
|
}
|
|
|
|
static inline void debug_deactivate(struct hrtimer *timer)
|
|
{
|
|
debug_hrtimer_deactivate(timer);
|
|
trace_hrtimer_cancel(timer);
|
|
}
|
|
|
|
#if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS)
|
|
static inline void hrtimer_update_next_timer(struct hrtimer_cpu_base *cpu_base,
|
|
struct hrtimer *timer)
|
|
{
|
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
|
cpu_base->next_timer = timer;
|
|
#endif
|
|
}
|
|
|
|
static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base)
|
|
{
|
|
struct hrtimer_clock_base *base = cpu_base->clock_base;
|
|
ktime_t expires, expires_next = { .tv64 = KTIME_MAX };
|
|
unsigned int active = cpu_base->active_bases;
|
|
|
|
hrtimer_update_next_timer(cpu_base, NULL);
|
|
for (; active; base++, active >>= 1) {
|
|
struct timerqueue_node *next;
|
|
struct hrtimer *timer;
|
|
|
|
if (!(active & 0x01))
|
|
continue;
|
|
|
|
next = timerqueue_getnext(&base->active);
|
|
timer = container_of(next, struct hrtimer, node);
|
|
expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
|
|
if (expires.tv64 < expires_next.tv64) {
|
|
expires_next = expires;
|
|
hrtimer_update_next_timer(cpu_base, timer);
|
|
}
|
|
}
|
|
/*
|
|
* clock_was_set() might have changed base->offset of any of
|
|
* the clock bases so the result might be negative. Fix it up
|
|
* to prevent a false positive in clockevents_program_event().
|
|
*/
|
|
if (expires_next.tv64 < 0)
|
|
expires_next.tv64 = 0;
|
|
return expires_next;
|
|
}
|
|
#endif
|
|
|
|
static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
|
|
{
|
|
ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset;
|
|
ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset;
|
|
ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset;
|
|
|
|
return ktime_get_update_offsets_now(&base->clock_was_set_seq,
|
|
offs_real, offs_boot, offs_tai);
|
|
}
|
|
|
|
/* High resolution timer related functions */
|
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
|
|
|
/*
|
|
* High resolution timer enabled ?
|
|
*/
|
|
static int hrtimer_hres_enabled __read_mostly = 1;
|
|
unsigned int hrtimer_resolution __read_mostly = LOW_RES_NSEC;
|
|
EXPORT_SYMBOL_GPL(hrtimer_resolution);
|
|
|
|
/*
|
|
* Enable / Disable high resolution mode
|
|
*/
|
|
static int __init setup_hrtimer_hres(char *str)
|
|
{
|
|
if (!strcmp(str, "off"))
|
|
hrtimer_hres_enabled = 0;
|
|
else if (!strcmp(str, "on"))
|
|
hrtimer_hres_enabled = 1;
|
|
else
|
|
return 0;
|
|
return 1;
|
|
}
|
|
|
|
__setup("highres=", setup_hrtimer_hres);
|
|
|
|
/*
|
|
* hrtimer_high_res_enabled - query, if the highres mode is enabled
|
|
*/
|
|
static inline int hrtimer_is_hres_enabled(void)
|
|
{
|
|
return hrtimer_hres_enabled;
|
|
}
|
|
|
|
/*
|
|
* Is the high resolution mode active ?
|
|
*/
|
|
static inline int __hrtimer_hres_active(struct hrtimer_cpu_base *cpu_base)
|
|
{
|
|
return cpu_base->hres_active;
|
|
}
|
|
|
|
static inline int hrtimer_hres_active(void)
|
|
{
|
|
return __hrtimer_hres_active(this_cpu_ptr(&hrtimer_bases));
|
|
}
|
|
|
|
/*
|
|
* Reprogram the event source with checking both queues for the
|
|
* next event
|
|
* Called with interrupts disabled and base->lock held
|
|
*/
|
|
static void
|
|
hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal)
|
|
{
|
|
ktime_t expires_next;
|
|
|
|
if (!cpu_base->hres_active)
|
|
return;
|
|
|
|
expires_next = __hrtimer_get_next_event(cpu_base);
|
|
|
|
if (skip_equal && expires_next.tv64 == cpu_base->expires_next.tv64)
|
|
return;
|
|
|
|
cpu_base->expires_next.tv64 = expires_next.tv64;
|
|
|
|
/*
|
|
* If a hang was detected in the last timer interrupt then we
|
|
* leave the hang delay active in the hardware. We want the
|
|
* system to make progress. That also prevents the following
|
|
* scenario:
|
|
* T1 expires 50ms from now
|
|
* T2 expires 5s from now
|
|
*
|
|
* T1 is removed, so this code is called and would reprogram
|
|
* the hardware to 5s from now. Any hrtimer_start after that
|
|
* will not reprogram the hardware due to hang_detected being
|
|
* set. So we'd effectivly block all timers until the T2 event
|
|
* fires.
|
|
*/
|
|
if (cpu_base->hang_detected)
|
|
return;
|
|
|
|
tick_program_event(cpu_base->expires_next, 1);
|
|
}
|
|
|
|
/*
|
|
* When a timer is enqueued and expires earlier than the already enqueued
|
|
* timers, we have to check, whether it expires earlier than the timer for
|
|
* which the clock event device was armed.
|
|
*
|
|
* Called with interrupts disabled and base->cpu_base.lock held
|
|
*/
|
|
static void hrtimer_reprogram(struct hrtimer *timer,
|
|
struct hrtimer_clock_base *base)
|
|
{
|
|
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
|
|
ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
|
|
|
|
WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0);
|
|
|
|
/*
|
|
* If the timer is not on the current cpu, we cannot reprogram
|
|
* the other cpus clock event device.
|
|
*/
|
|
if (base->cpu_base != cpu_base)
|
|
return;
|
|
|
|
/*
|
|
* If the hrtimer interrupt is running, then it will
|
|
* reevaluate the clock bases and reprogram the clock event
|
|
* device. The callbacks are always executed in hard interrupt
|
|
* context so we don't need an extra check for a running
|
|
* callback.
|
|
*/
|
|
if (cpu_base->in_hrtirq)
|
|
return;
|
|
|
|
/*
|
|
* CLOCK_REALTIME timer might be requested with an absolute
|
|
* expiry time which is less than base->offset. Set it to 0.
|
|
*/
|
|
if (expires.tv64 < 0)
|
|
expires.tv64 = 0;
|
|
|
|
if (expires.tv64 >= cpu_base->expires_next.tv64)
|
|
return;
|
|
|
|
/* Update the pointer to the next expiring timer */
|
|
cpu_base->next_timer = timer;
|
|
|
|
/*
|
|
* If a hang was detected in the last timer interrupt then we
|
|
* do not schedule a timer which is earlier than the expiry
|
|
* which we enforced in the hang detection. We want the system
|
|
* to make progress.
|
|
*/
|
|
if (cpu_base->hang_detected)
|
|
return;
|
|
|
|
/*
|
|
* Program the timer hardware. We enforce the expiry for
|
|
* events which are already in the past.
|
|
*/
|
|
cpu_base->expires_next = expires;
|
|
tick_program_event(expires, 1);
|
|
}
|
|
|
|
/*
|
|
* Initialize the high resolution related parts of cpu_base
|
|
*/
|
|
static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base)
|
|
{
|
|
base->expires_next.tv64 = KTIME_MAX;
|
|
base->hang_detected = 0;
|
|
base->hres_active = 0;
|
|
base->next_timer = NULL;
|
|
}
|
|
|
|
/*
|
|
* Retrigger next event is called after clock was set
|
|
*
|
|
* Called with interrupts disabled via on_each_cpu()
|
|
*/
|
|
static void retrigger_next_event(void *arg)
|
|
{
|
|
struct hrtimer_cpu_base *base = this_cpu_ptr(&hrtimer_bases);
|
|
|
|
if (!base->hres_active)
|
|
return;
|
|
|
|
raw_spin_lock(&base->lock);
|
|
hrtimer_update_base(base);
|
|
hrtimer_force_reprogram(base, 0);
|
|
raw_spin_unlock(&base->lock);
|
|
}
|
|
|
|
/*
|
|
* Switch to high resolution mode
|
|
*/
|
|
static void hrtimer_switch_to_hres(void)
|
|
{
|
|
struct hrtimer_cpu_base *base = this_cpu_ptr(&hrtimer_bases);
|
|
|
|
if (tick_init_highres()) {
|
|
printk(KERN_WARNING "Could not switch to high resolution "
|
|
"mode on CPU %d\n", base->cpu);
|
|
return;
|
|
}
|
|
base->hres_active = 1;
|
|
hrtimer_resolution = HIGH_RES_NSEC;
|
|
|
|
tick_setup_sched_timer();
|
|
/* "Retrigger" the interrupt to get things going */
|
|
retrigger_next_event(NULL);
|
|
}
|
|
|
|
static void clock_was_set_work(struct work_struct *work)
|
|
{
|
|
clock_was_set();
|
|
}
|
|
|
|
static DECLARE_WORK(hrtimer_work, clock_was_set_work);
|
|
|
|
/*
|
|
* Called from timekeeping and resume code to reprogramm the hrtimer
|
|
* interrupt device on all cpus.
|
|
*/
|
|
void clock_was_set_delayed(void)
|
|
{
|
|
schedule_work(&hrtimer_work);
|
|
}
|
|
|
|
#else
|
|
|
|
static inline int __hrtimer_hres_active(struct hrtimer_cpu_base *b) { return 0; }
|
|
static inline int hrtimer_hres_active(void) { return 0; }
|
|
static inline int hrtimer_is_hres_enabled(void) { return 0; }
|
|
static inline void hrtimer_switch_to_hres(void) { }
|
|
static inline void
|
|
hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { }
|
|
static inline int hrtimer_reprogram(struct hrtimer *timer,
|
|
struct hrtimer_clock_base *base)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) { }
|
|
static inline void retrigger_next_event(void *arg) { }
|
|
|
|
#endif /* CONFIG_HIGH_RES_TIMERS */
|
|
|
|
/*
|
|
* Clock realtime was set
|
|
*
|
|
* Change the offset of the realtime clock vs. the monotonic
|
|
* clock.
|
|
*
|
|
* We might have to reprogram the high resolution timer interrupt. On
|
|
* SMP we call the architecture specific code to retrigger _all_ high
|
|
* resolution timer interrupts. On UP we just disable interrupts and
|
|
* call the high resolution interrupt code.
|
|
*/
|
|
void clock_was_set(void)
|
|
{
|
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
|
/* Retrigger the CPU local events everywhere */
|
|
on_each_cpu(retrigger_next_event, NULL, 1);
|
|
#endif
|
|
timerfd_clock_was_set();
|
|
}
|
|
|
|
/*
|
|
* During resume we might have to reprogram the high resolution timer
|
|
* interrupt on all online CPUs. However, all other CPUs will be
|
|
* stopped with IRQs interrupts disabled so the clock_was_set() call
|
|
* must be deferred.
|
|
*/
|
|
void hrtimers_resume(void)
|
|
{
|
|
WARN_ONCE(!irqs_disabled(),
|
|
KERN_INFO "hrtimers_resume() called with IRQs enabled!");
|
|
|
|
/* Retrigger on the local CPU */
|
|
retrigger_next_event(NULL);
|
|
/* And schedule a retrigger for all others */
|
|
clock_was_set_delayed();
|
|
}
|
|
|
|
static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
|
|
{
|
|
#ifdef CONFIG_TIMER_STATS
|
|
if (timer->start_site)
|
|
return;
|
|
timer->start_site = __builtin_return_address(0);
|
|
memcpy(timer->start_comm, current->comm, TASK_COMM_LEN);
|
|
timer->start_pid = current->pid;
|
|
#endif
|
|
}
|
|
|
|
static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
|
|
{
|
|
#ifdef CONFIG_TIMER_STATS
|
|
timer->start_site = NULL;
|
|
#endif
|
|
}
|
|
|
|
static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
|
|
{
|
|
#ifdef CONFIG_TIMER_STATS
|
|
if (likely(!timer_stats_active))
|
|
return;
|
|
timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
|
|
timer->function, timer->start_comm, 0);
|
|
#endif
|
|
}
|
|
|
|
/*
|
|
* Counterpart to lock_hrtimer_base above:
|
|
*/
|
|
static inline
|
|
void unlock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
|
|
{
|
|
raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags);
|
|
}
|
|
|
|
/**
|
|
* hrtimer_forward - forward the timer expiry
|
|
* @timer: hrtimer to forward
|
|
* @now: forward past this time
|
|
* @interval: the interval to forward
|
|
*
|
|
* Forward the timer expiry so it will expire in the future.
|
|
* Returns the number of overruns.
|
|
*
|
|
* Can be safely called from the callback function of @timer. If
|
|
* called from other contexts @timer must neither be enqueued nor
|
|
* running the callback and the caller needs to take care of
|
|
* serialization.
|
|
*
|
|
* Note: This only updates the timer expiry value and does not requeue
|
|
* the timer.
|
|
*/
|
|
u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval)
|
|
{
|
|
u64 orun = 1;
|
|
ktime_t delta;
|
|
|
|
delta = ktime_sub(now, hrtimer_get_expires(timer));
|
|
|
|
if (delta.tv64 < 0)
|
|
return 0;
|
|
|
|
if (WARN_ON(timer->state & HRTIMER_STATE_ENQUEUED))
|
|
return 0;
|
|
|
|
if (interval.tv64 < hrtimer_resolution)
|
|
interval.tv64 = hrtimer_resolution;
|
|
|
|
if (unlikely(delta.tv64 >= interval.tv64)) {
|
|
s64 incr = ktime_to_ns(interval);
|
|
|
|
orun = ktime_divns(delta, incr);
|
|
hrtimer_add_expires_ns(timer, incr * orun);
|
|
if (hrtimer_get_expires_tv64(timer) > now.tv64)
|
|
return orun;
|
|
/*
|
|
* This (and the ktime_add() below) is the
|
|
* correction for exact:
|
|
*/
|
|
orun++;
|
|
}
|
|
hrtimer_add_expires(timer, interval);
|
|
|
|
return orun;
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_forward);
|
|
|
|
/*
|
|
* enqueue_hrtimer - internal function to (re)start a timer
|
|
*
|
|
* The timer is inserted in expiry order. Insertion into the
|
|
* red black tree is O(log(n)). Must hold the base lock.
|
|
*
|
|
* Returns 1 when the new timer is the leftmost timer in the tree.
|
|
*/
|
|
static int enqueue_hrtimer(struct hrtimer *timer,
|
|
struct hrtimer_clock_base *base)
|
|
{
|
|
debug_activate(timer);
|
|
|
|
base->cpu_base->active_bases |= 1 << base->index;
|
|
|
|
/* Pairs with the lockless read in hrtimer_is_queued() */
|
|
WRITE_ONCE(timer->state, timer->state | HRTIMER_STATE_ENQUEUED);
|
|
|
|
return timerqueue_add(&base->active, &timer->node);
|
|
}
|
|
|
|
/*
|
|
* __remove_hrtimer - internal function to remove a timer
|
|
*
|
|
* Caller must hold the base lock.
|
|
*
|
|
* High resolution timer mode reprograms the clock event device when the
|
|
* timer is the one which expires next. The caller can disable this by setting
|
|
* reprogram to zero. This is useful, when the context does a reprogramming
|
|
* anyway (e.g. timer interrupt)
|
|
*/
|
|
static void __remove_hrtimer(struct hrtimer *timer,
|
|
struct hrtimer_clock_base *base,
|
|
u8 newstate, int reprogram)
|
|
{
|
|
struct hrtimer_cpu_base *cpu_base = base->cpu_base;
|
|
u8 state = timer->state;
|
|
|
|
/*
|
|
* Pairs with the lockless read in hrtimer_is_queued()
|
|
*
|
|
* We need to preserve PINNED state here, otherwise we may end up
|
|
* migrating pinned hrtimers as well.
|
|
*/
|
|
WRITE_ONCE(timer->state, newstate | (state & HRTIMER_STATE_PINNED));
|
|
if (!(state & HRTIMER_STATE_ENQUEUED))
|
|
return;
|
|
|
|
if (!timerqueue_del(&base->active, &timer->node))
|
|
cpu_base->active_bases &= ~(1 << base->index);
|
|
|
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
|
/*
|
|
* Note: If reprogram is false we do not update
|
|
* cpu_base->next_timer. This happens when we remove the first
|
|
* timer on a remote cpu. No harm as we never dereference
|
|
* cpu_base->next_timer. So the worst thing what can happen is
|
|
* an superflous call to hrtimer_force_reprogram() on the
|
|
* remote cpu later on if the same timer gets enqueued again.
|
|
*/
|
|
if (reprogram && timer == cpu_base->next_timer)
|
|
hrtimer_force_reprogram(cpu_base, 1);
|
|
#endif
|
|
}
|
|
|
|
/*
|
|
* remove hrtimer, called with base lock held
|
|
*/
|
|
static inline int
|
|
remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool restart)
|
|
{
|
|
u8 state = timer->state;
|
|
|
|
if (state & HRTIMER_STATE_ENQUEUED) {
|
|
int reprogram;
|
|
|
|
/*
|
|
* Remove the timer and force reprogramming when high
|
|
* resolution mode is active and the timer is on the current
|
|
* CPU. If we remove a timer on another CPU, reprogramming is
|
|
* skipped. The interrupt event on this CPU is fired and
|
|
* reprogramming happens in the interrupt handler. This is a
|
|
* rare case and less expensive than a smp call.
|
|
*/
|
|
debug_deactivate(timer);
|
|
timer_stats_hrtimer_clear_start_info(timer);
|
|
reprogram = base->cpu_base == this_cpu_ptr(&hrtimer_bases);
|
|
|
|
if (!restart)
|
|
state = HRTIMER_STATE_INACTIVE;
|
|
|
|
__remove_hrtimer(timer, base, state, reprogram);
|
|
timer->state &= ~HRTIMER_STATE_PINNED;
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim,
|
|
const enum hrtimer_mode mode)
|
|
{
|
|
#ifdef CONFIG_TIME_LOW_RES
|
|
/*
|
|
* CONFIG_TIME_LOW_RES indicates that the system has no way to return
|
|
* granular time values. For relative timers we add hrtimer_resolution
|
|
* (i.e. one jiffie) to prevent short timeouts.
|
|
*/
|
|
timer->is_rel = mode & HRTIMER_MODE_REL;
|
|
if (timer->is_rel)
|
|
tim = ktime_add_safe(tim, ktime_set(0, hrtimer_resolution));
|
|
#endif
|
|
return tim;
|
|
}
|
|
|
|
/**
|
|
* hrtimer_start_range_ns - (re)start an hrtimer on the current CPU
|
|
* @timer: the timer to be added
|
|
* @tim: expiry time
|
|
* @delta_ns: "slack" range for the timer
|
|
* @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or
|
|
* relative (HRTIMER_MODE_REL)
|
|
*/
|
|
void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
|
|
u64 delta_ns, const enum hrtimer_mode mode)
|
|
{
|
|
struct hrtimer_clock_base *base, *new_base;
|
|
unsigned long flags;
|
|
int leftmost;
|
|
|
|
base = lock_hrtimer_base(timer, &flags);
|
|
|
|
/* Remove an active timer from the queue: */
|
|
remove_hrtimer(timer, base, true);
|
|
|
|
if (mode & HRTIMER_MODE_REL)
|
|
tim = ktime_add_safe(tim, base->get_time());
|
|
|
|
tim = hrtimer_update_lowres(timer, tim, mode);
|
|
|
|
hrtimer_set_expires_range_ns(timer, tim, delta_ns);
|
|
|
|
/* Switch the timer base, if necessary: */
|
|
new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);
|
|
|
|
timer_stats_hrtimer_set_start_info(timer);
|
|
|
|
/* Update pinned state */
|
|
timer->state &= ~HRTIMER_STATE_PINNED;
|
|
timer->state |= (!!(mode & HRTIMER_MODE_PINNED)) << HRTIMER_PINNED_SHIFT;
|
|
|
|
leftmost = enqueue_hrtimer(timer, new_base);
|
|
if (!leftmost)
|
|
goto unlock;
|
|
|
|
if (!hrtimer_is_hres_active(timer)) {
|
|
/*
|
|
* Kick to reschedule the next tick to handle the new timer
|
|
* on dynticks target.
|
|
*/
|
|
if (new_base->cpu_base->nohz_active)
|
|
wake_up_nohz_cpu(new_base->cpu_base->cpu);
|
|
} else {
|
|
hrtimer_reprogram(timer, new_base);
|
|
}
|
|
unlock:
|
|
unlock_hrtimer_base(timer, &flags);
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_start_range_ns);
|
|
|
|
/**
|
|
* hrtimer_try_to_cancel - try to deactivate a timer
|
|
* @timer: hrtimer to stop
|
|
*
|
|
* Returns:
|
|
* 0 when the timer was not active
|
|
* 1 when the timer was active
|
|
* -1 when the timer is currently excuting the callback function and
|
|
* cannot be stopped
|
|
*/
|
|
int hrtimer_try_to_cancel(struct hrtimer *timer)
|
|
{
|
|
struct hrtimer_clock_base *base;
|
|
unsigned long flags;
|
|
int ret = -1;
|
|
|
|
/*
|
|
* Check lockless first. If the timer is not active (neither
|
|
* enqueued nor running the callback, nothing to do here. The
|
|
* base lock does not serialize against a concurrent enqueue,
|
|
* so we can avoid taking it.
|
|
*/
|
|
if (!hrtimer_active(timer))
|
|
return 0;
|
|
|
|
base = lock_hrtimer_base(timer, &flags);
|
|
|
|
if (!hrtimer_callback_running(timer))
|
|
ret = remove_hrtimer(timer, base, false);
|
|
|
|
unlock_hrtimer_base(timer, &flags);
|
|
|
|
return ret;
|
|
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_try_to_cancel);
|
|
|
|
/**
|
|
* hrtimer_cancel - cancel a timer and wait for the handler to finish.
|
|
* @timer: the timer to be cancelled
|
|
*
|
|
* Returns:
|
|
* 0 when the timer was not active
|
|
* 1 when the timer was active
|
|
*/
|
|
int hrtimer_cancel(struct hrtimer *timer)
|
|
{
|
|
for (;;) {
|
|
int ret = hrtimer_try_to_cancel(timer);
|
|
|
|
if (ret >= 0)
|
|
return ret;
|
|
cpu_relax();
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_cancel);
|
|
|
|
/**
|
|
* hrtimer_get_remaining - get remaining time for the timer
|
|
* @timer: the timer to read
|
|
* @adjust: adjust relative timers when CONFIG_TIME_LOW_RES=y
|
|
*/
|
|
ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust)
|
|
{
|
|
unsigned long flags;
|
|
ktime_t rem;
|
|
|
|
lock_hrtimer_base(timer, &flags);
|
|
if (IS_ENABLED(CONFIG_TIME_LOW_RES) && adjust)
|
|
rem = hrtimer_expires_remaining_adjusted(timer);
|
|
else
|
|
rem = hrtimer_expires_remaining(timer);
|
|
unlock_hrtimer_base(timer, &flags);
|
|
|
|
return rem;
|
|
}
|
|
EXPORT_SYMBOL_GPL(__hrtimer_get_remaining);
|
|
|
|
#ifdef CONFIG_NO_HZ_COMMON
|
|
/**
|
|
* hrtimer_get_next_event - get the time until next expiry event
|
|
*
|
|
* Returns the next expiry time or KTIME_MAX if no timer is pending.
|
|
*/
|
|
u64 hrtimer_get_next_event(void)
|
|
{
|
|
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
|
|
u64 expires = KTIME_MAX;
|
|
unsigned long flags;
|
|
|
|
raw_spin_lock_irqsave(&cpu_base->lock, flags);
|
|
|
|
if (!__hrtimer_hres_active(cpu_base))
|
|
expires = __hrtimer_get_next_event(cpu_base).tv64;
|
|
|
|
raw_spin_unlock_irqrestore(&cpu_base->lock, flags);
|
|
|
|
return expires;
|
|
}
|
|
#endif
|
|
|
|
static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
|
|
enum hrtimer_mode mode)
|
|
{
|
|
struct hrtimer_cpu_base *cpu_base;
|
|
int base;
|
|
|
|
memset(timer, 0, sizeof(struct hrtimer));
|
|
|
|
cpu_base = raw_cpu_ptr(&hrtimer_bases);
|
|
|
|
/*
|
|
* POSIX magic: Relative CLOCK_REALTIME timers are not affected by
|
|
* clock modifications, so they needs to become CLOCK_MONOTONIC to
|
|
* ensure POSIX compliance.
|
|
*/
|
|
if (clock_id == CLOCK_REALTIME && mode & HRTIMER_MODE_REL)
|
|
clock_id = CLOCK_MONOTONIC;
|
|
|
|
base = hrtimer_clockid_to_base(clock_id);
|
|
timer->base = &cpu_base->clock_base[base];
|
|
timerqueue_init(&timer->node);
|
|
|
|
#ifdef CONFIG_TIMER_STATS
|
|
timer->start_site = NULL;
|
|
timer->start_pid = -1;
|
|
memset(timer->start_comm, 0, TASK_COMM_LEN);
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* hrtimer_init - initialize a timer to the given clock
|
|
* @timer: the timer to be initialized
|
|
* @clock_id: the clock to be used
|
|
* @mode: timer mode abs/rel
|
|
*/
|
|
void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
|
|
enum hrtimer_mode mode)
|
|
{
|
|
debug_init(timer, clock_id, mode);
|
|
__hrtimer_init(timer, clock_id, mode);
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_init);
|
|
|
|
/*
|
|
* A timer is active, when it is enqueued into the rbtree or the
|
|
* callback function is running or it's in the state of being migrated
|
|
* to another cpu.
|
|
*
|
|
* It is important for this function to not return a false negative.
|
|
*/
|
|
bool hrtimer_active(const struct hrtimer *timer)
|
|
{
|
|
struct hrtimer_cpu_base *cpu_base;
|
|
unsigned int seq;
|
|
|
|
do {
|
|
cpu_base = READ_ONCE(timer->base->cpu_base);
|
|
seq = raw_read_seqcount_begin(&cpu_base->seq);
|
|
|
|
if (((timer->state & ~HRTIMER_STATE_PINNED) !=
|
|
HRTIMER_STATE_INACTIVE) || cpu_base->running == timer)
|
|
return true;
|
|
|
|
} while (read_seqcount_retry(&cpu_base->seq, seq) ||
|
|
cpu_base != READ_ONCE(timer->base->cpu_base));
|
|
|
|
return false;
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_active);
|
|
|
|
/*
|
|
* The write_seqcount_barrier()s in __run_hrtimer() split the thing into 3
|
|
* distinct sections:
|
|
*
|
|
* - queued: the timer is queued
|
|
* - callback: the timer is being ran
|
|
* - post: the timer is inactive or (re)queued
|
|
*
|
|
* On the read side we ensure we observe timer->state and cpu_base->running
|
|
* from the same section, if anything changed while we looked at it, we retry.
|
|
* This includes timer->base changing because sequence numbers alone are
|
|
* insufficient for that.
|
|
*
|
|
* The sequence numbers are required because otherwise we could still observe
|
|
* a false negative if the read side got smeared over multiple consequtive
|
|
* __run_hrtimer() invocations.
|
|
*/
|
|
|
|
static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
|
|
struct hrtimer_clock_base *base,
|
|
struct hrtimer *timer, ktime_t *now)
|
|
{
|
|
enum hrtimer_restart (*fn)(struct hrtimer *);
|
|
int restart;
|
|
|
|
lockdep_assert_held(&cpu_base->lock);
|
|
|
|
debug_deactivate(timer);
|
|
cpu_base->running = timer;
|
|
|
|
/*
|
|
* Separate the ->running assignment from the ->state assignment.
|
|
*
|
|
* As with a regular write barrier, this ensures the read side in
|
|
* hrtimer_active() cannot observe cpu_base->running == NULL &&
|
|
* timer->state == INACTIVE.
|
|
*/
|
|
raw_write_seqcount_barrier(&cpu_base->seq);
|
|
|
|
__remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0);
|
|
timer_stats_account_hrtimer(timer);
|
|
fn = timer->function;
|
|
|
|
/*
|
|
* Clear the 'is relative' flag for the TIME_LOW_RES case. If the
|
|
* timer is restarted with a period then it becomes an absolute
|
|
* timer. If its not restarted it does not matter.
|
|
*/
|
|
if (IS_ENABLED(CONFIG_TIME_LOW_RES))
|
|
timer->is_rel = false;
|
|
|
|
/*
|
|
* Because we run timers from hardirq context, there is no chance
|
|
* they get migrated to another cpu, therefore its safe to unlock
|
|
* the timer base.
|
|
*/
|
|
raw_spin_unlock(&cpu_base->lock);
|
|
trace_hrtimer_expire_entry(timer, now);
|
|
restart = fn(timer);
|
|
trace_hrtimer_expire_exit(timer);
|
|
raw_spin_lock(&cpu_base->lock);
|
|
|
|
/*
|
|
* Note: We clear the running state after enqueue_hrtimer and
|
|
* we do not reprogramm the event hardware. Happens either in
|
|
* hrtimer_start_range_ns() or in hrtimer_interrupt()
|
|
*
|
|
* Note: Because we dropped the cpu_base->lock above,
|
|
* hrtimer_start_range_ns() can have popped in and enqueued the timer
|
|
* for us already.
|
|
*/
|
|
if (restart != HRTIMER_NORESTART &&
|
|
!(timer->state & HRTIMER_STATE_ENQUEUED))
|
|
enqueue_hrtimer(timer, base);
|
|
|
|
/*
|
|
* Separate the ->running assignment from the ->state assignment.
|
|
*
|
|
* As with a regular write barrier, this ensures the read side in
|
|
* hrtimer_active() cannot observe cpu_base->running == NULL &&
|
|
* timer->state == INACTIVE.
|
|
*/
|
|
raw_write_seqcount_barrier(&cpu_base->seq);
|
|
|
|
WARN_ON_ONCE(cpu_base->running != timer);
|
|
cpu_base->running = NULL;
|
|
}
|
|
|
|
static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
|
|
{
|
|
struct hrtimer_clock_base *base = cpu_base->clock_base;
|
|
unsigned int active = cpu_base->active_bases;
|
|
|
|
for (; active; base++, active >>= 1) {
|
|
struct timerqueue_node *node;
|
|
ktime_t basenow;
|
|
|
|
if (!(active & 0x01))
|
|
continue;
|
|
|
|
basenow = ktime_add(now, base->offset);
|
|
|
|
while ((node = timerqueue_getnext(&base->active))) {
|
|
struct hrtimer *timer;
|
|
|
|
timer = container_of(node, struct hrtimer, node);
|
|
|
|
/*
|
|
* The immediate goal for using the softexpires is
|
|
* minimizing wakeups, not running timers at the
|
|
* earliest interrupt after their soft expiration.
|
|
* This allows us to avoid using a Priority Search
|
|
* Tree, which can answer a stabbing querry for
|
|
* overlapping intervals and instead use the simple
|
|
* BST we already have.
|
|
* We don't add extra wakeups by delaying timers that
|
|
* are right-of a not yet expired timer, because that
|
|
* timer will have to trigger a wakeup anyway.
|
|
*/
|
|
if (basenow.tv64 < hrtimer_get_softexpires_tv64(timer))
|
|
break;
|
|
|
|
__run_hrtimer(cpu_base, base, timer, &basenow);
|
|
}
|
|
}
|
|
}
|
|
|
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
|
|
|
/*
|
|
* High resolution timer interrupt
|
|
* Called with interrupts disabled
|
|
*/
|
|
void hrtimer_interrupt(struct clock_event_device *dev)
|
|
{
|
|
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
|
|
ktime_t expires_next, now, entry_time, delta;
|
|
int retries = 0;
|
|
|
|
BUG_ON(!cpu_base->hres_active);
|
|
cpu_base->nr_events++;
|
|
dev->next_event.tv64 = KTIME_MAX;
|
|
|
|
raw_spin_lock(&cpu_base->lock);
|
|
entry_time = now = hrtimer_update_base(cpu_base);
|
|
retry:
|
|
cpu_base->in_hrtirq = 1;
|
|
/*
|
|
* We set expires_next to KTIME_MAX here with cpu_base->lock
|
|
* held to prevent that a timer is enqueued in our queue via
|
|
* the migration code. This does not affect enqueueing of
|
|
* timers which run their callback and need to be requeued on
|
|
* this CPU.
|
|
*/
|
|
cpu_base->expires_next.tv64 = KTIME_MAX;
|
|
|
|
__hrtimer_run_queues(cpu_base, now);
|
|
|
|
/* Reevaluate the clock bases for the next expiry */
|
|
expires_next = __hrtimer_get_next_event(cpu_base);
|
|
/*
|
|
* Store the new expiry value so the migration code can verify
|
|
* against it.
|
|
*/
|
|
cpu_base->expires_next = expires_next;
|
|
cpu_base->in_hrtirq = 0;
|
|
raw_spin_unlock(&cpu_base->lock);
|
|
|
|
/* Reprogramming necessary ? */
|
|
if (!tick_program_event(expires_next, 0)) {
|
|
cpu_base->hang_detected = 0;
|
|
return;
|
|
}
|
|
|
|
/*
|
|
* The next timer was already expired due to:
|
|
* - tracing
|
|
* - long lasting callbacks
|
|
* - being scheduled away when running in a VM
|
|
*
|
|
* We need to prevent that we loop forever in the hrtimer
|
|
* interrupt routine. We give it 3 attempts to avoid
|
|
* overreacting on some spurious event.
|
|
*
|
|
* Acquire base lock for updating the offsets and retrieving
|
|
* the current time.
|
|
*/
|
|
raw_spin_lock(&cpu_base->lock);
|
|
now = hrtimer_update_base(cpu_base);
|
|
cpu_base->nr_retries++;
|
|
if (++retries < 3)
|
|
goto retry;
|
|
/*
|
|
* Give the system a chance to do something else than looping
|
|
* here. We stored the entry time, so we know exactly how long
|
|
* we spent here. We schedule the next event this amount of
|
|
* time away.
|
|
*/
|
|
cpu_base->nr_hangs++;
|
|
cpu_base->hang_detected = 1;
|
|
raw_spin_unlock(&cpu_base->lock);
|
|
delta = ktime_sub(now, entry_time);
|
|
if ((unsigned int)delta.tv64 > cpu_base->max_hang_time)
|
|
cpu_base->max_hang_time = (unsigned int) delta.tv64;
|
|
/*
|
|
* Limit it to a sensible value as we enforce a longer
|
|
* delay. Give the CPU at least 100ms to catch up.
|
|
*/
|
|
if (delta.tv64 > 100 * NSEC_PER_MSEC)
|
|
expires_next = ktime_add_ns(now, 100 * NSEC_PER_MSEC);
|
|
else
|
|
expires_next = ktime_add(now, delta);
|
|
tick_program_event(expires_next, 1);
|
|
printk_once(KERN_WARNING "hrtimer: interrupt took %llu ns\n",
|
|
ktime_to_ns(delta));
|
|
}
|
|
|
|
/*
|
|
* local version of hrtimer_peek_ahead_timers() called with interrupts
|
|
* disabled.
|
|
*/
|
|
static inline void __hrtimer_peek_ahead_timers(void)
|
|
{
|
|
struct tick_device *td;
|
|
|
|
if (!hrtimer_hres_active())
|
|
return;
|
|
|
|
td = this_cpu_ptr(&tick_cpu_device);
|
|
if (td && td->evtdev)
|
|
hrtimer_interrupt(td->evtdev);
|
|
}
|
|
|
|
#else /* CONFIG_HIGH_RES_TIMERS */
|
|
|
|
static inline void __hrtimer_peek_ahead_timers(void) { }
|
|
|
|
#endif /* !CONFIG_HIGH_RES_TIMERS */
|
|
|
|
/*
|
|
* Called from run_local_timers in hardirq context every jiffy
|
|
*/
|
|
void hrtimer_run_queues(void)
|
|
{
|
|
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
|
|
ktime_t now;
|
|
|
|
if (__hrtimer_hres_active(cpu_base))
|
|
return;
|
|
|
|
/*
|
|
* This _is_ ugly: We have to check periodically, whether we
|
|
* can switch to highres and / or nohz mode. The clocksource
|
|
* switch happens with xtime_lock held. Notification from
|
|
* there only sets the check bit in the tick_oneshot code,
|
|
* otherwise we might deadlock vs. xtime_lock.
|
|
*/
|
|
if (tick_check_oneshot_change(!hrtimer_is_hres_enabled())) {
|
|
hrtimer_switch_to_hres();
|
|
return;
|
|
}
|
|
|
|
raw_spin_lock(&cpu_base->lock);
|
|
now = hrtimer_update_base(cpu_base);
|
|
__hrtimer_run_queues(cpu_base, now);
|
|
raw_spin_unlock(&cpu_base->lock);
|
|
}
|
|
|
|
/*
|
|
* Sleep related functions:
|
|
*/
|
|
static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer)
|
|
{
|
|
struct hrtimer_sleeper *t =
|
|
container_of(timer, struct hrtimer_sleeper, timer);
|
|
struct task_struct *task = t->task;
|
|
|
|
t->task = NULL;
|
|
if (task)
|
|
wake_up_process(task);
|
|
|
|
return HRTIMER_NORESTART;
|
|
}
|
|
|
|
void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, struct task_struct *task)
|
|
{
|
|
sl->timer.function = hrtimer_wakeup;
|
|
sl->task = task;
|
|
}
|
|
EXPORT_SYMBOL_GPL(hrtimer_init_sleeper);
|
|
|
|
static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mode)
|
|
{
|
|
hrtimer_init_sleeper(t, current);
|
|
|
|
do {
|
|
set_current_state(TASK_INTERRUPTIBLE);
|
|
hrtimer_start_expires(&t->timer, mode);
|
|
|
|
if (likely(t->task))
|
|
freezable_schedule();
|
|
|
|
hrtimer_cancel(&t->timer);
|
|
mode = HRTIMER_MODE_ABS;
|
|
|
|
} while (t->task && !signal_pending(current));
|
|
|
|
__set_current_state(TASK_RUNNING);
|
|
|
|
return t->task == NULL;
|
|
}
|
|
|
|
static int update_rmtp(struct hrtimer *timer, struct timespec __user *rmtp)
|
|
{
|
|
struct timespec rmt;
|
|
ktime_t rem;
|
|
|
|
rem = hrtimer_expires_remaining(timer);
|
|
if (rem.tv64 <= 0)
|
|
return 0;
|
|
rmt = ktime_to_timespec(rem);
|
|
|
|
if (copy_to_user(rmtp, &rmt, sizeof(*rmtp)))
|
|
return -EFAULT;
|
|
|
|
return 1;
|
|
}
|
|
|
|
long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
|
|
{
|
|
struct hrtimer_sleeper t;
|
|
struct timespec __user *rmtp;
|
|
int ret = 0;
|
|
|
|
hrtimer_init_on_stack(&t.timer, restart->nanosleep.clockid,
|
|
HRTIMER_MODE_ABS);
|
|
hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires);
|
|
|
|
if (do_nanosleep(&t, HRTIMER_MODE_ABS))
|
|
goto out;
|
|
|
|
rmtp = restart->nanosleep.rmtp;
|
|
if (rmtp) {
|
|
ret = update_rmtp(&t.timer, rmtp);
|
|
if (ret <= 0)
|
|
goto out;
|
|
}
|
|
|
|
/* The other values in restart are already filled in */
|
|
ret = -ERESTART_RESTARTBLOCK;
|
|
out:
|
|
destroy_hrtimer_on_stack(&t.timer);
|
|
return ret;
|
|
}
|
|
|
|
long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
|
|
const enum hrtimer_mode mode, const clockid_t clockid)
|
|
{
|
|
struct restart_block *restart;
|
|
struct hrtimer_sleeper t;
|
|
int ret = 0;
|
|
u64 slack;
|
|
|
|
slack = current->timer_slack_ns;
|
|
if (dl_task(current) || rt_task(current))
|
|
slack = 0;
|
|
|
|
hrtimer_init_on_stack(&t.timer, clockid, mode);
|
|
hrtimer_set_expires_range_ns(&t.timer, timespec_to_ktime(*rqtp), slack);
|
|
if (do_nanosleep(&t, mode))
|
|
goto out;
|
|
|
|
/* Absolute timers do not update the rmtp value and restart: */
|
|
if (mode == HRTIMER_MODE_ABS) {
|
|
ret = -ERESTARTNOHAND;
|
|
goto out;
|
|
}
|
|
|
|
if (rmtp) {
|
|
ret = update_rmtp(&t.timer, rmtp);
|
|
if (ret <= 0)
|
|
goto out;
|
|
}
|
|
|
|
restart = ¤t->restart_block;
|
|
restart->fn = hrtimer_nanosleep_restart;
|
|
restart->nanosleep.clockid = t.timer.base->clockid;
|
|
restart->nanosleep.rmtp = rmtp;
|
|
restart->nanosleep.expires = hrtimer_get_expires_tv64(&t.timer);
|
|
|
|
ret = -ERESTART_RESTARTBLOCK;
|
|
out:
|
|
destroy_hrtimer_on_stack(&t.timer);
|
|
return ret;
|
|
}
|
|
|
|
SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
|
|
struct timespec __user *, rmtp)
|
|
{
|
|
struct timespec tu;
|
|
|
|
if (copy_from_user(&tu, rqtp, sizeof(tu)))
|
|
return -EFAULT;
|
|
|
|
if (!timespec_valid(&tu))
|
|
return -EINVAL;
|
|
|
|
return hrtimer_nanosleep(&tu, rmtp, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
|
|
}
|
|
|
|
/*
|
|
* Functions related to boot-time initialization:
|
|
*/
|
|
static void init_hrtimers_cpu(int cpu)
|
|
{
|
|
struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
|
|
int i;
|
|
|
|
for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
|
|
cpu_base->clock_base[i].cpu_base = cpu_base;
|
|
timerqueue_init_head(&cpu_base->clock_base[i].active);
|
|
}
|
|
|
|
cpu_base->active_bases = 0;
|
|
cpu_base->cpu = cpu;
|
|
hrtimer_init_hres(cpu_base);
|
|
}
|
|
|
|
#if defined(CONFIG_HOTPLUG_CPU)
|
|
static void migrate_hrtimer_list(struct hrtimer_cpu_base *old_base,
|
|
struct hrtimer_cpu_base *new_base,
|
|
unsigned int i,
|
|
bool wait,
|
|
bool remove_pinned)
|
|
{
|
|
struct hrtimer *timer;
|
|
struct timerqueue_node *node;
|
|
struct timerqueue_head pinned;
|
|
int is_pinned;
|
|
struct hrtimer_clock_base *old_c_base = &old_base->clock_base[i];
|
|
struct hrtimer_clock_base *new_c_base = &new_base->clock_base[i];
|
|
|
|
timerqueue_init_head(&pinned);
|
|
|
|
while ((node = timerqueue_getnext(&old_c_base->active))) {
|
|
timer = container_of(node, struct hrtimer, node);
|
|
if (wait) {
|
|
/* Ensure timers are done running before continuing */
|
|
while (hrtimer_callback_running(timer)) {
|
|
raw_spin_unlock(&old_base->lock);
|
|
raw_spin_unlock(&new_base->lock);
|
|
cpu_relax();
|
|
/*
|
|
* cpu_relax may just be a barrier. Grant the
|
|
* run_hrtimer_list code some time to obtain the
|
|
* spinlock.
|
|
*/
|
|
udelay(2);
|
|
raw_spin_lock(&new_base->lock);
|
|
raw_spin_lock_nested(&old_base->lock,
|
|
SINGLE_DEPTH_NESTING);
|
|
}
|
|
} else {
|
|
BUG_ON(hrtimer_callback_running(timer));
|
|
}
|
|
debug_deactivate(timer);
|
|
|
|
/*
|
|
* Mark it as ENQUEUED not INACTIVE otherwise the
|
|
* timer could be seen as !active and just vanish away
|
|
* under us on another CPU
|
|
*/
|
|
__remove_hrtimer(timer, old_c_base, HRTIMER_STATE_ENQUEUED, 0);
|
|
|
|
is_pinned = timer->state & HRTIMER_STATE_PINNED;
|
|
if (!remove_pinned && is_pinned) {
|
|
timerqueue_add(&pinned, &timer->node);
|
|
continue;
|
|
}
|
|
|
|
timer->base = new_c_base;
|
|
/*
|
|
* Enqueue the timers on the new cpu. This does not
|
|
* reprogram the event device in case the timer
|
|
* expires before the earliest on this CPU, but we run
|
|
* hrtimer_interrupt after we migrated everything to
|
|
* sort out already expired timers and reprogram the
|
|
* event device.
|
|
*/
|
|
enqueue_hrtimer(timer, new_c_base);
|
|
}
|
|
|
|
/* Re-queue pinned timers for non-hotplug usecase */
|
|
while ((node = timerqueue_getnext(&pinned))) {
|
|
timer = container_of(node, struct hrtimer, node);
|
|
|
|
timerqueue_del(&pinned, &timer->node);
|
|
enqueue_hrtimer(timer, old_c_base);
|
|
}
|
|
}
|
|
|
|
static void __migrate_hrtimers(int scpu, bool wait, bool remove_pinned)
|
|
{
|
|
struct hrtimer_cpu_base *old_base, *new_base;
|
|
unsigned long flags;
|
|
int i;
|
|
|
|
local_irq_save(flags);
|
|
old_base = &per_cpu(hrtimer_bases, scpu);
|
|
new_base = this_cpu_ptr(&hrtimer_bases);
|
|
/*
|
|
* The caller is globally serialized and nobody else
|
|
* takes two locks at once, deadlock is not possible.
|
|
*/
|
|
raw_spin_lock(&new_base->lock);
|
|
raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
|
|
|
|
for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
|
|
migrate_hrtimer_list(old_base, new_base, i, wait,
|
|
remove_pinned);
|
|
}
|
|
|
|
raw_spin_unlock(&old_base->lock);
|
|
raw_spin_unlock(&new_base->lock);
|
|
|
|
/* Check, if we got expired work to do */
|
|
__hrtimer_peek_ahead_timers();
|
|
local_irq_restore(flags);
|
|
}
|
|
|
|
static void migrate_hrtimers(int scpu)
|
|
{
|
|
BUG_ON(cpu_online(scpu));
|
|
tick_cancel_sched_timer(scpu);
|
|
|
|
__migrate_hrtimers(scpu, false, true);
|
|
}
|
|
|
|
void hrtimer_quiesce_cpu(void *cpup)
|
|
{
|
|
__migrate_hrtimers(*(int *)cpup, true, false);
|
|
}
|
|
|
|
#endif /* CONFIG_HOTPLUG_CPU */
|
|
|
|
static int hrtimer_cpu_notify(struct notifier_block *self,
|
|
unsigned long action, void *hcpu)
|
|
{
|
|
int scpu = (long)hcpu;
|
|
|
|
switch (action) {
|
|
|
|
case CPU_UP_PREPARE:
|
|
case CPU_UP_PREPARE_FROZEN:
|
|
init_hrtimers_cpu(scpu);
|
|
break;
|
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
case CPU_DEAD:
|
|
case CPU_DEAD_FROZEN:
|
|
migrate_hrtimers(scpu);
|
|
break;
|
|
#endif
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
return NOTIFY_OK;
|
|
}
|
|
|
|
static struct notifier_block hrtimers_nb = {
|
|
.notifier_call = hrtimer_cpu_notify,
|
|
};
|
|
|
|
void __init hrtimers_init(void)
|
|
{
|
|
hrtimer_cpu_notify(&hrtimers_nb, (unsigned long)CPU_UP_PREPARE,
|
|
(void *)(long)smp_processor_id());
|
|
register_cpu_notifier(&hrtimers_nb);
|
|
}
|
|
|
|
/**
|
|
* schedule_hrtimeout_range_clock - sleep until timeout
|
|
* @expires: timeout value (ktime_t)
|
|
* @delta: slack in expires timeout (ktime_t)
|
|
* @mode: timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL
|
|
* @clock: timer clock, CLOCK_MONOTONIC or CLOCK_REALTIME
|
|
*/
|
|
int __sched
|
|
schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta,
|
|
const enum hrtimer_mode mode, int clock)
|
|
{
|
|
struct hrtimer_sleeper t;
|
|
|
|
/*
|
|
* Optimize when a zero timeout value is given. It does not
|
|
* matter whether this is an absolute or a relative time.
|
|
*/
|
|
if (expires && !expires->tv64) {
|
|
__set_current_state(TASK_RUNNING);
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* A NULL parameter means "infinite"
|
|
*/
|
|
if (!expires) {
|
|
schedule();
|
|
return -EINTR;
|
|
}
|
|
|
|
hrtimer_init_on_stack(&t.timer, clock, mode);
|
|
hrtimer_set_expires_range_ns(&t.timer, *expires, delta);
|
|
|
|
hrtimer_init_sleeper(&t, current);
|
|
|
|
hrtimer_start_expires(&t.timer, mode);
|
|
|
|
if (likely(t.task))
|
|
schedule();
|
|
|
|
hrtimer_cancel(&t.timer);
|
|
destroy_hrtimer_on_stack(&t.timer);
|
|
|
|
__set_current_state(TASK_RUNNING);
|
|
|
|
return !t.task ? 0 : -EINTR;
|
|
}
|
|
|
|
/**
|
|
* schedule_hrtimeout_range - sleep until timeout
|
|
* @expires: timeout value (ktime_t)
|
|
* @delta: slack in expires timeout (ktime_t)
|
|
* @mode: timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL
|
|
*
|
|
* Make the current task sleep until the given expiry time has
|
|
* elapsed. The routine will return immediately unless
|
|
* the current task state has been set (see set_current_state()).
|
|
*
|
|
* The @delta argument gives the kernel the freedom to schedule the
|
|
* actual wakeup to a time that is both power and performance friendly.
|
|
* The kernel give the normal best effort behavior for "@expires+@delta",
|
|
* but may decide to fire the timer earlier, but no earlier than @expires.
|
|
*
|
|
* You can set the task state as follows -
|
|
*
|
|
* %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to
|
|
* pass before the routine returns unless the current task is explicitly
|
|
* woken up, (e.g. by wake_up_process()).
|
|
*
|
|
* %TASK_INTERRUPTIBLE - the routine may return early if a signal is
|
|
* delivered to the current task or the current task is explicitly woken
|
|
* up.
|
|
*
|
|
* The current task state is guaranteed to be TASK_RUNNING when this
|
|
* routine returns.
|
|
*
|
|
* Returns 0 when the timer has expired. If the task was woken before the
|
|
* timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or
|
|
* by an explicit wakeup, it returns -EINTR.
|
|
*/
|
|
int __sched schedule_hrtimeout_range(ktime_t *expires, u64 delta,
|
|
const enum hrtimer_mode mode)
|
|
{
|
|
return schedule_hrtimeout_range_clock(expires, delta, mode,
|
|
CLOCK_MONOTONIC);
|
|
}
|
|
EXPORT_SYMBOL_GPL(schedule_hrtimeout_range);
|
|
|
|
/**
|
|
* schedule_hrtimeout - sleep until timeout
|
|
* @expires: timeout value (ktime_t)
|
|
* @mode: timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL
|
|
*
|
|
* Make the current task sleep until the given expiry time has
|
|
* elapsed. The routine will return immediately unless
|
|
* the current task state has been set (see set_current_state()).
|
|
*
|
|
* You can set the task state as follows -
|
|
*
|
|
* %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to
|
|
* pass before the routine returns unless the current task is explicitly
|
|
* woken up, (e.g. by wake_up_process()).
|
|
*
|
|
* %TASK_INTERRUPTIBLE - the routine may return early if a signal is
|
|
* delivered to the current task or the current task is explicitly woken
|
|
* up.
|
|
*
|
|
* The current task state is guaranteed to be TASK_RUNNING when this
|
|
* routine returns.
|
|
*
|
|
* Returns 0 when the timer has expired. If the task was woken before the
|
|
* timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or
|
|
* by an explicit wakeup, it returns -EINTR.
|
|
*/
|
|
int __sched schedule_hrtimeout(ktime_t *expires,
|
|
const enum hrtimer_mode mode)
|
|
{
|
|
return schedule_hrtimeout_range(expires, 0, mode);
|
|
}
|
|
EXPORT_SYMBOL_GPL(schedule_hrtimeout);
|