PD#159028: char_dev: extend dynamic allocation of majors into a higher range
We've run into problems with running out of dynamicly assign char
device majors particullarly on automated test systems with
all-yes-configs. Roughly 40 dynamic assignments can be made with such
kernels at this time while space is reserved for only 20.
Currently, the kernel only prints a warning when dynamic allocation
overflows the reserved region. And when this happens drivers that have
fixed assignments can randomly fail depending on the order of
initialization of other drivers. Thus, adding a new char device can cause
unexpected failures in completely unrelated parts of the kernel.
This patch solves the problem by extending dynamic major number
allocations down from 511 once the 234-254 region fills up. Fixed
majors already exist above 255 so the infrastructure to support
high number majors is already in place. The patch reserves an
additional 128 major numbers which should hopefully last us a while.
Kernels that don't require more than 20 dynamic majors assigned (which
is pretty typical) should not be affected by this change.
Change-Id: Ibf1ddaf0b7ce623c9f1a18c42a1ad39a89bb3f41
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://lkml.org/lkml/2017/6/4/107
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
PD#156898: add the polling method of sd card_detect,
because gpio irq remove raising & falling trigger method.
Change-Id: If270d27619d2686e74fe5e6d02748242faec4ce8
Signed-off-by: Nan Li <nan.li@amlogic.com>
PD#157965: pinctrl: define the pinmux with the same format.
there are two different pin controllers in Meson Soc Series, one of
them uses continuous 4-bit register to select function for each pin
(Eg: AXG and next), the other use indefinite bits that maybe from
different registers (Eg: Before AXG and GXLX)
previously, the driver use two different format to define the pinmux,
as follows:
[1] Before AXG and GXLX:
mux {
groups = "uart_ao_tx_a", "uart_ao_rx_a";
function = "uart_ao_a";
}
[2] AXG and next
mux {
pins = "GPIOAO_0", "GPIOAO_1";
function = "uart_ao_a";
}
which is a little confusing,and in this patch define the pinmux with
one format[1].
Change-Id: I04fb256294e1b664224c50a1baa622eb3a50b1c1
Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
PD#154260: lcd: add txlx support
Add panel dtsi for txlx r311.
Also add backlight local dimming driver.
Change-Id: I8d6cbc0a2099c17de1adc4087a3f58e1c34264ae
Signed-off-by: Weiming Liu <weiming.liu@amlogic.com>
PD#154260: hdmitx: update hdmitx driver
1. using pr_info or pr_debug instead of printk.
2. remove unuse code.
3. change modulepara to sysfs.
4. use iomap api for read and write reg
Change-Id: I523329d7b26cd7c6675bdae55cda76a6a11c533e
Signed-off-by: Kaifu Hu <kaifu.hu@amlogic.com>
PD#154260: refine unifykey codes
1. delete calling of cpu version related apis
2. replace self-implemented list with kernel-implemented one
3. delete unused MACRO defination
4. replace global variables with private data structure
5. define pr_fmt in each module
6. fix code defects:
e438
e527
e550
e570
e650
7. add safe guard
Change-Id: I3dc93e3fef8ccfe3593d3275a69e0e21786e3ef1
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
PD#154260: vpu: add vpu support for txlx
Update dts for all platforms.
1. add support for txlx
2. add clktree support for clk change
3. remove unused vpu module for mem_pd
4. remove vpu_parent "vid_pll","mpll1","mpll2"
Change-Id: I43aa2435305fd02664ae825bc2f62664ffb526be
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
PD#154260: emmc: use device data matching for different platform
Use device data matching for different platforms.
Optimize suspend & resume clksrc switch.
Optimize clksrc on HS400.
Change-Id: I6b927edf85062e1ddffe75e08331feff0b3de805
Signed-off-by: Nan Li <nan.li@amlogic.com>
PD#154260: clk: meson-txlx: add clock tree driver
Change clkc driver init order
The loading order of vpu driver is postcore_initcall,
but clock order is device_initcall.clock order should
be higher,change macro CLK_OF_DECLARE instead
Optimizing mux/div/gate descriptions.
Change-Id: I20cd8111ac6bd60f350cdddc224bad48c13fcfb1
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
PD#157069: skip SUBLEVEL and crc when ver check durning insmod
When CONFIG_MODVERSIONS enabled, vermagic and crc are checked
durning insmod.
Change-Id: I6eb7bdda5b771afa754f7b783a7bbfe1be7cedd1
Signed-off-by: jianxin.pan <jianxin.pan@amlogic.com>
PD#152261: clk: update clk total number
add bt656 clk, but total number not update
Change-Id: I24f2f17e4e773a883bab3f564144a49768fc16d5
Signed-off-by: wenbiao zhang <wenbiao.zhang@amlogic.com>
PD#156236: mm: fix deadlock due to too_many_isolated
When CMA allocating, allocation task may be dead lock
in following backtrace. So add a count for CMA isolated
to avoid this case.
[<0000000000000000>] __switch_to+0x98/0xac
[<0000000000000000>] congestion_wait+0xa0/0x188
[<0000000000000000>] shrink_inactive_list+0x4a0/0x528
[<0000000000000000>] shrink_node_memcg.isra.71+0x684/0x714
[<0000000000000000>] shrink_node+0x74/0x1e0
[<0000000000000000>] try_to_free_pages+0x1bc/0x4c0
[<0000000000000000>] __alloc_pages_nodemask+0x57c/0xcf4
[<0000000000000000>] alloc_migrate_target+0x2c/0x34
[<0000000000000000>] migrate_pages+0xe0/0x890
[<0000000000000000>] __alloc_contig_migrate_range+0x94/0x1a4
[<0000000000000000>] cma_boost_work_func+0xd0/0x168
[<0000000000000000>] process_one_work+0x140/0x418
[<0000000000000000>] worker_thread+0x154/0x480
[<0000000000000000>] kthread+0x10c/0x120
[<0000000000000000>] ret_from_fork+0x10/0x50
Change-Id: Ib1c5d8f25ac966170292ed6b6f078e8b447e99a8
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
Changes in 4.9.68
bcache: only permit to recovery read error when cache device is clean
bcache: recover data from backing when data is clean
drm/fsl-dcu: avoid disabling pixel clock twice on suspend
drm/fsl-dcu: enable IRQ before drm_atomic_helper_resume()
Revert "crypto: caam - get rid of tasklet"
mm, oom_reaper: gather each vma to prevent leaking TLB entry
uas: Always apply US_FL_NO_ATA_1X quirk to Seagate devices
usb: quirks: Add no-lpm quirk for KY-688 USB 3.1 Type-C Hub
serial: 8250_pci: Add Amazon PCI serial device ID
s390/runtime instrumentation: simplify task exit handling
USB: serial: option: add Quectel BG96 id
ima: fix hash algorithm initialization
s390/pci: do not require AIS facility
selftests/x86/ldt_get: Add a few additional tests for limits
staging: greybus: loopback: Fix iteration count on async path
m68k: fix ColdFire node shift size calculation
serial: 8250_fintek: Fix rs485 disablement on invalid ioctl()
staging: rtl8188eu: avoid a null dereference on pmlmepriv
spi: sh-msiof: Fix DMA transfer size check
spi: spi-axi: fix potential use-after-free after deregistration
mmc: sdhci-msm: fix issue with power irq
usb: phy: tahvo: fix error handling in tahvo_usb_probe()
serial: 8250: Preserve DLD[7:4] for PORT_XR17V35X
x86/entry: Use SYSCALL_DEFINE() macros for sys_modify_ldt()
EDAC, sb_edac: Fix missing break in switch
sysrq : fix Show Regs call trace on ARM
usbip: tools: Install all headers needed for libusbip development
perf test attr: Fix ignored test case result
kprobes/x86: Disable preemption in ftrace-based jprobes
tools include: Do not use poison with C++
iio: adc: ti-ads1015: add 10% to conversion wait time
dax: Avoid page invalidation races and unnecessary radix tree traversals
net/mlx4_en: Fix type mismatch for 32-bit systems
l2tp: take remote address into account in l2tp_ip and l2tp_ip6 socket lookups
dmaengine: stm32-dma: Set correct args number for DMA request from DT
dmaengine: stm32-dma: Fix null pointer dereference in stm32_dma_tx_status
usb: gadget: f_fs: Fix ExtCompat descriptor validation
libcxgb: fix error check for ip6_route_output()
net: systemport: Utilize skb_put_padto()
net: systemport: Pad packet before inserting TSB
ARM: OMAP2+: Fix WL1283 Bluetooth Baud Rate
ARM: OMAP1: DMA: Correct the number of logical channels
vti6: fix device register to report IFLA_INFO_KIND
be2net: fix accesses to unicast list
be2net: fix unicast list filling
net/appletalk: Fix kernel memory disclosure
libfs: Modify mount_pseudo_xattr to be clear it is not a userspace mount
net: qrtr: Mark 'buf' as little endian
mm: fix remote numa hits statistics
mac80211: calculate min channel width correctly
ravb: Remove Rx overflow log messages
nfs: Don't take a reference on fl->fl_file for LOCK operation
drm/exynos/decon5433: update shadow registers iff there are active windows
drm/exynos/decon5433: set STANDALONE_UPDATE_F also if planes are disabled
KVM: arm/arm64: Fix occasional warning from the timer work function
mac80211: prevent skb/txq mismatch
NFSv4: Fix client recovery when server reboots multiple times
perf/x86/intel: Account interrupts for PEBS errors
powerpc/mm: Fix memory hotplug BUG() on radix
qla2xxx: Fix wrong IOCB type assumption
drm/amdgpu: fix bug set incorrect value to vce register
drm/exynos/decon5433: set STANDALONE_UPDATE_F on output enablement
net: sctp: fix array overrun read on sctp_timer_tbl
x86/fpu: Set the xcomp_bv when we fake up a XSAVES area
drm/amdgpu: fix unload driver issue for virtual display
mac80211: don't try to sleep in rate_control_rate_init()
RDMA/qedr: Return success when not changing QP state
RDMA/qedr: Fix RDMA CM loopback
tipc: fix nametbl_lock soft lockup at module exit
tipc: fix cleanup at module unload
dmaengine: pl330: fix double lock
tcp: correct memory barrier usage in tcp_check_space()
i2c: i2c-cadence: Initialize configuration before probing devices
nvmet: cancel fatal error and flush async work before free controller
gtp: clear DF bit on GTP packet tx
gtp: fix cross netns recv on gtp socket
net: phy: micrel: KSZ8795 do not set SUPPORTED_[Asym_]Pause
net: thunderx: avoid dereferencing xcv when NULL
be2net: fix initial MAC setting
vfio/spapr: Fix missing mutex unlock when creating a window
mm: avoid returning VM_FAULT_RETRY from ->page_mkwrite handlers
xen-netfront: Improve error handling during initialization
cec: initiator should be the same as the destination for, poll
xen-netback: vif counters from int/long to u64
net: fec: fix multicast filtering hardware setup
dma-buf/dma-fence: Extract __dma_fence_is_later()
dma-buf/sw-sync: Fix the is-signaled test to handle u32 wraparound
dma-buf/sw-sync: Prevent user overflow on timeline advance
dma-buf/sw-sync: Reduce irqsave/irqrestore from known context
dma-buf/sw-sync: sync_pt is private and of fixed size
dma-buf/sw-sync: Fix locking around sync_timeline lists
dma-buf/sw-sync: Use an rbtree to sort fences in the timeline
dma-buf/sw_sync: move timeline_fence_ops around
dma-buf/sw_sync: clean up list before signaling the fence
dma-fence: Clear fence->status during dma_fence_init()
dma-fence: Wrap querying the fence->status
dma-fence: Introduce drm_fence_set_error() helper
dma-buf/sw_sync: force signal all unsignaled fences on dying timeline
dma-buf/sync_file: hold reference to fence when creating sync_file
dma-buf: Update kerneldoc for sync_file_create
usb: hub: Cycle HUB power when initialization fails
usb: xhci: fix panic in xhci_free_virt_devices_depth_first
USB: core: Add type-specific length check of BOS descriptors
USB: Increase usbfs transfer limit
USB: devio: Prevent integer overflow in proc_do_submiturb()
USB: usbfs: Filter flags passed in from user space
usb: host: fix incorrect updating of offset
xen-netfront: avoid crashing on resume after a failure in talk_to_netback()
Linux 4.9.68
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
commit 81cf4a4536 upstream.
As most of BOS descriptors are longer in length than their header
'struct usb_dev_cap_header', comparing solely with it is not sufficient
to avoid out-of-bounds access to BOS descriptors.
This patch adds descriptor type specific length check in
usb_get_bos_descriptor() to fix the issue.
Signed-off-by: Masakazu Mokuno <masakazu.mokuno@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit a009e975da upstream.
The dma_fence.error field (formerly known as dma_fence.status) is an
optional field that may be set by drivers before calling
dma_fence_signal(). The field can be used to indicate that the fence was
completed in err rather than with success, and is visible to other
consumers of the fence and to userspace via sync_file.
This patch renames the field from status to error so that its meaning is
hopefully more clear (and distinct from dma_fence_get_status() which is
a composite between the error state and signal state) and adds a helper
that validates the preconditions of when it is suitable to adjust the
error field.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170104141222.6992-3-chris@chris-wilson.co.uk
[s/dma_fence/fence/g - gregkh]
Cc: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 0911d0041c ]
Some ->page_mkwrite handlers may return VM_FAULT_RETRY as its return
code (GFS2 or Lustre can definitely do this). However VM_FAULT_RETRY
from ->page_mkwrite is completely unhandled by the mm code and results
in locking and writeably mapping the page which definitely is not what
the caller wanted.
Fix Lustre and block_page_mkwrite_ret() used by other filesystems
(notably GFS2) to return VM_FAULT_NOPAGE instead which results in
bailing out from the fault code, the CPU then retries the access, and we
fault again effectively doing what the handler wanted.
Link: http://lkml.kernel.org/r/20170203150729.15863-1-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 475113d937 ]
It's possible to set up PEBS events to get only errors and not
any data, like on SNB-X (model 45) and IVB-EP (model 62)
via 2 perf commands running simultaneously:
taskset -c 1 ./perf record -c 4 -e branches:pp -j any -C 10
This leads to a soft lock up, because the error path of the
intel_pmu_drain_pebs_nhm() does not account event->hw.interrupt
for error PEBS interrupts, so in case you're getting ONLY
errors you don't have a way to stop the event when it's over
the max_samples_per_tick limit:
NMI watchdog: BUG: soft lockup - CPU#22 stuck for 22s! [perf_fuzzer:5816]
...
RIP: 0010:[<ffffffff81159232>] [<ffffffff81159232>] smp_call_function_single+0xe2/0x140
...
Call Trace:
? trace_hardirqs_on_caller+0xf5/0x1b0
? perf_cgroup_attach+0x70/0x70
perf_install_in_context+0x199/0x1b0
? ctx_resched+0x90/0x90
SYSC_perf_event_open+0x641/0xf90
SyS_perf_event_open+0x9/0x10
do_syscall_64+0x6c/0x1f0
entry_SYSCALL64_slow_path+0x25/0x25
Add perf_event_account_interrupt() which does the interrupt
and frequency checks and call it from intel_pmu_drain_pebs_nhm()'s
error path.
We keep the pending_kill and pending_wakeup logic only in the
__perf_event_overflow() path, because they make sense only if
there's any data to deliver.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vince@deater.net>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1482931866-6018-2-git-send-email-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Initial patch for generic TEE subsystem.
This subsystem provides:
* Registration/un-registration of TEE drivers.
* Shared memory between normal world and secure world.
* Ioctl interface for interaction with user space.
* Sysfs implementation_id of TEE driver
A TEE (Trusted Execution Environment) driver is a driver that interfaces
with a trusted OS running in some secure environment, for example,
TrustZone on ARM cpus, or a separate secure co-processor etc.
The TEE subsystem can serve a TEE driver for a Global Platform compliant
TEE, but it's not limited to only Global Platform TEEs.
This patch builds on other similar implementations trying to solve
the same problem:
* "optee_linuxdriver" by among others
Jean-michel DELORME<jean-michel.delorme@st.com> and
Emmanuel MICHEL <emmanuel.michel@st.com>
* "Generic TrustZone Driver" by Javier González <javier@javigon.com>
Change-Id: I2336be6189bafb63ca0f49e0a1b16ec75b4514ac
Acked-by: Andreas Dannenberg <dannenberg@ti.com>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
Tested-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> (RCAR H3)
Tested-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit 967c9cca2c)
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Changes in 4.9.67
ARM: dts: LogicPD Torpedo: Fix camera pin mux
ARM: dts: omap3: logicpd-torpedo-37xx-devkit: Fix MMC1 cd-gpio
mm, thp: Do not make page table dirty unconditionally in touch_p[mu]d()
mm/cma: fix alloc_contig_range ret code/potential leak
mm, hugetlbfs: introduce ->split() to vm_operations_struct
mm/madvise.c: fix madvise() infinite loop under special circumstances
btrfs: clear space cache inode generation always
nfsd: Fix stateid races between OPEN and CLOSE
nfsd: Fix another OPEN stateid race
nfsd: fix panic in posix_unblock_lock called from nfs4_laundromat
mfd: twl4030-power: Fix pmic for boards that need vmmc1 on reboot
ARM: OMAP2+: Fix WL1283 Bluetooth Baud Rate
KVM: x86: pvclock: Handle first-time write to pvclock-page contains random junk
KVM: x86: Exit to user-mode on #UD intercept when emulator requires
KVM: x86: inject exceptions produced by x86_decode_insn
KVM: lapic: Split out x2apic ldr calculation
KVM: lapic: Fixup LDR on load in x2apic
mmc: core: Do not leave the block driver in a suspended state
mmc: core: prepend 0x to OCR entry in sysfs
eeprom: at24: fix reading from 24MAC402/24MAC602
eeprom: at24: correctly set the size for at24mac402
eeprom: at24: check at24_read/write arguments
i2c: i801: Fix Failed to allocate irq -2147483648 error
bcache: Fix building error on MIPS
hwmon: (jc42) optionally try to disable the SMBUS timeout
nvme-pci: add quirk for delay before CHK RDY for WDC SN200
Revert "drm/radeon: dont switch vt on suspend"
drm/amdgpu: potential uninitialized variable in amdgpu_vce_ring_parse_cs()
drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_directories()
drm/radeon: fix atombios on big endian
drm/panel: simple: Add missing panel_simple_unprepare() calls
drm/hisilicon: Ensure LDI regs are properly configured.
drm/ttm: once more fix ttm_buffer_object_transfer
drm/amd/pp: fix typecast error in powerplay.
Revert "x86/entry/64: Add missing irqflags tracing to native_load_gs_index()"
NFS: revalidate "." etc correctly on "open".
drm/i915: Don't try indexed reads to alternate slave addresses
drm/i915: Prevent zero length "index" write
Linux 4.9.67
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
commit cf33c1ee52 upstream.
This patch try to fix the building error on MIPS. The reason is MIPS
has already defined the PTR macro, which conflicts with the PTR macro
in include/uapi/linux/bcache.h.
[fixed by mlyle: corrected a line-length issue]
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 31383c6865 upstream.
Patch series "device-dax: fix unaligned munmap handling"
When device-dax is operating in huge-page mode we want it to behave like
hugetlbfs and fail attempts to split vmas into unaligned ranges. It
would be messy to teach the munmap path about device-dax alignment
constraints in the same (hstate) way that hugetlbfs communicates this
constraint. Instead, these patches introduce a new ->split() vm
operation.
This patch (of 2):
The device-dax interface has similar constraints as hugetlbfs in that it
requires the munmap path to unmap in huge page aligned units. Rather
than add more custom vma handling code in __split_vma() introduce a new
vm operation to perform this vma specific check.
Link: http://lkml.kernel.org/r/151130418135.4029.6783191281930729710.stgit@dwillia2-desk3.amr.corp.intel.com
Fixes: dee4107924 ("/dev/dax, core: file operations and dax-mmap")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
It is preferable that WALT window rollover occurs just
before a tick, since the tick is an opportune moment
to record a complete window's statistics, as well as report
those stats to the cpu frequency governor. When CONFIG_HZ
results in a TICK_NSEC that isn't a integral number, this
requirement may be violated. Account for this by reducing
the WALT window size to the nearest multiple of TICK_NSEC.
Commit d368c6faa1 ("sched: walt: fix window misalignment
when HZ=300") attempted to do this but WALT isn't using
MIN_SCHED_RAVG_WINDOW as the window size and the patch was
doing nothing.
Also, change the type of 'walt_disabled' to bool and warn
if an invalid window size causes WALT to be disabled.
Change-Id: Ie3dcfc21a3df4408254ca1165a355bbe391ed5c7
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
(cherry picked from commit e79f447a97)
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
Energy cost estimation has been a long lasting challenge for WALT
because WALT guides CPU frequency based on the CPU utilization of
previous window. Consequently it's not possible to know newly
waking-up task's energy cost until WALT's end of the current window.
The WALT already tracks 'Previous Runnable Sum' (prev_runnable_sum)
and 'Cumulative Runnable Average' (cr_avg). They are designed for
CPU frequency guidance and task placement but unfortunately both
are not suitable for the energy cost estimation.
It's because using prev_runnable_sum for energy cost calculation would
make us to account CPU and task's energy solely based on activity in the
previous window so for example, any task didn't have an activity in the
previous window will be accounted as a 'zero energy cost' task.
Energy estimation with cr_avg is what energy_diff() relies on at present.
However cr_avg can only represent instantaneous picture of energy cost
thus for example, if a CPU was fully occupied for an entire WALT window
and became idle just before window boundary, and if there is a wake-up,
energy_diff() accounts that CPU is a 'zero energy cost' CPU.
As a result, introduce a new accounting unit 'Cumulative Window Demand'.
The cumulative window demand tracks all the tasks' demands have seen in
current window which is neither instantaneous nor actual execution time.
Because task demand represents estimated scaled execution time when the
task runs a full window, accumulation of all the demands represents
predicted CPU load at the end of window.
Thus we can estimate CPU's frequency at the end of current WALT window
with the cumulative window demand.
The use of prev_runnable_sum for the CPU frequency guidance and cr_avg
for the task placement have not changed and these are going to be used
for both purpose while this patch aims to add an additional statistics.
Change-Id: I9908c77ead9973a26dea2b36c001c2baf944d4f5
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
(cherry picked from commit 43bd960dfe)
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
There's no need for a separate hierarchy of notifiers, APIs
and variables in walt.c for the purpose of applying frequency
and IPC invariance. Let's just use capacity_curr_of and get
rid of a lot of the infrastructure relating to capacity,
load_scale_factor etc.
Change-Id: Ia220e2c896373fa535db05bff60f9aa33aefc978
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
(cherry picked from commit be832f69a9)
[Trivial cherry pick issues]
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
Changes in 4.9.66
s390: fix transactional execution control register handling
s390/runtime instrumention: fix possible memory corruption
s390/disassembler: add missing end marker for e7 table
s390/disassembler: increase show_code buffer size
ACPI / EC: Fix regression related to triggering source of EC event handling
x86/mm: fix use-after-free of vma during userfaultfd fault
ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER
vsock: use new wait API for vsock_stream_sendmsg()
sched: Make resched_cpu() unconditional
lib/mpi: call cond_resched() from mpi_powm() loop
x86/decoder: Add new TEST instruction pattern
x86/entry/64: Add missing irqflags tracing to native_load_gs_index()
arm64: Implement arch-specific pte_access_permitted()
ARM: 8722/1: mm: make STRICT_KERNEL_RWX effective for LPAE
ARM: 8721/1: mm: dump: check hardware RO bit for LPAE
MIPS: ralink: Fix MT7628 pinmux
MIPS: ralink: Fix typo in mt7628 pinmux function
PCI: Set Cavium ACS capability quirk flags to assert RR/CR/SV/UF
ALSA: hda: Add Raven PCI ID
dm bufio: fix integer overflow when limiting maximum cache size
dm: allocate struct mapped_device with kvzalloc
MIPS: pci: Remove KERN_WARN instance inside the mt7620 driver
dm: fix race between dm_get_from_kobject() and __dm_destroy()
MIPS: Fix odd fp register warnings with MIPS64r2
MIPS: dts: remove bogus bcm96358nb4ser.dtb from dtb-y entry
MIPS: Fix an n32 core file generation regset support regression
MIPS: BCM47XX: Fix LED inversion for WRT54GSv1
rt2x00usb: mark device removed when get ENOENT usb error
autofs: don't fail mount for transient error
nilfs2: fix race condition that causes file system corruption
eCryptfs: use after free in ecryptfs_release_messaging()
libceph: don't WARN() if user tries to add invalid key
bcache: check ca->alloc_thread initialized before wake up it
isofs: fix timestamps beyond 2027
NFS: Fix typo in nomigration mount option
nfs: Fix ugly referral attributes
NFS: Avoid RCU usage in tracepoints
nfsd: deal with revoked delegations appropriately
rtlwifi: rtl8192ee: Fix memory leak when loading firmware
rtlwifi: fix uninitialized rtlhal->last_suspend_sec time
ata: fixes kernel crash while tracing ata_eh_link_autopsy event
ext4: fix interaction between i_size, fallocate, and delalloc after a crash
ALSA: pcm: update tstamp only if audio_tstamp changed
ALSA: usb-audio: Add sanity checks to FE parser
ALSA: usb-audio: Fix potential out-of-bound access at parsing SU
ALSA: usb-audio: Add sanity checks in v2 clock parsers
ALSA: timer: Remove kernel warning at compat ioctl error paths
ALSA: hda: Fix too short HDMI/DP chmap reporting
ALSA: hda/realtek - Fix ALC700 family no sound issue
fix a page leak in vhost_scsi_iov_to_sgl() error recovery
fs/9p: Compare qid.path in v9fs_test_inode
iscsi-target: Fix non-immediate TMR reference leak
target: Fix QUEUE_FULL + SCSI task attribute handling
mtd: nand: omap2: Fix subpage write
mtd: nand: Fix writing mtdoops to nand flash.
mtd: nand: mtk: fix infinite ECC decode IRQ issue
p54: don't unregister leds when they are not initialized
block: Fix a race between blk_cleanup_queue() and timeout handling
irqchip/gic-v3: Fix ppi-partitions lookup
lockd: double unregister of inetaddr notifiers
KVM: nVMX: set IDTR and GDTR limits when loading L1 host state
KVM: SVM: obey guest PAT
SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status
clk: ti: dra7-atl-clock: fix child-node lookups
libnvdimm, pfn: make 'resource' attribute only readable by root
libnvdimm, namespace: fix label initialization to use valid seq numbers
libnvdimm, namespace: make 'resource' attribute only readable by root
IB/srpt: Do not accept invalid initiator port names
IB/srp: Avoid that a cable pull can trigger a kernel crash
NFC: fix device-allocation error return
i40e: Use smp_rmb rather than read_barrier_depends
igb: Use smp_rmb rather than read_barrier_depends
igbvf: Use smp_rmb rather than read_barrier_depends
ixgbevf: Use smp_rmb rather than read_barrier_depends
i40evf: Use smp_rmb rather than read_barrier_depends
fm10k: Use smp_rmb rather than read_barrier_depends
ixgbe: Fix skb list corruption on Power systems
parisc: Fix validity check of pointer size argument in new CAS implementation
powerpc/signal: Properly handle return value from uprobe_deny_signal()
media: Don't do DMA on stack for firmware upload in the AS102 driver
media: rc: check for integer overflow
cx231xx-cards: fix NULL-deref on missing association descriptor
media: v4l2-ctrl: Fix flags field on Control events
sched/rt: Simplify the IPI based RT balancing logic
fscrypt: lock mutex before checking for bounce page pool
net/9p: Switch to wait_event_killable()
PM / OPP: Add missing of_node_put(np)
Revert "drm/i915: Do not rely on wm preservation for ILK watermarks"
e1000e: Fix error path in link detection
e1000e: Fix return value test
e1000e: Separate signaling for link check/link up
e1000e: Avoid receiver overrun interrupt bursts
RDS: make message size limit compliant with spec
RDS: RDMA: return appropriate error on rdma map failures
RDS: RDMA: fix the ib_map_mr_sg_zbva() argument
PCI: Apply _HPX settings only to relevant devices
drm/sun4i: Fix a return value in case of error
clk: sunxi-ng: A31: Fix spdif clock register
clk: sunxi-ng: fix PLL_CPUX adjusting on A33
dmaengine: zx: set DMA_CYCLIC cap_mask bit
fscrypt: use ENOKEY when file cannot be created w/o key
fscrypt: use ENOTDIR when setting encryption policy on nondirectory
net: Allow IP_MULTICAST_IF to set index to L3 slave
net: 3com: typhoon: typhoon_init_one: make return values more specific
net: 3com: typhoon: typhoon_init_one: fix incorrect return values
drm/armada: Fix compile fail
rt2800: set minimum MPDU and PSDU lengths to sane values
adm80211: return an error if adm8211_alloc_rings() fails
mwifiex: sdio: fix use after free issue for save_adapter
ath10k: fix incorrect txpower set by P2P_DEVICE interface
ath10k: ignore configuring the incorrect board_id
ath10k: fix potential memory leak in ath10k_wmi_tlv_op_pull_fw_stats()
pinctrl: sirf: atlas7: Add missing 'of_node_put()'
bnxt_en: Set default completion ring for async events.
ath10k: set CTS protection VDEV param only if VDEV is up
ALSA: hda - Apply ALC269_FIXUP_NO_SHUTUP on HDA_FIXUP_ACT_PROBE
gpio: mockup: dynamically allocate memory for chip name
drm: Apply range restriction after color adjustment when allocation
clk: qcom: ipq4019: Add all the frequencies for apss cpu
drm/mediatek: don't use drm_put_dev
mac80211: Remove invalid flag operations in mesh TSF synchronization
mac80211: Suppress NEW_PEER_CANDIDATE event if no room
adm80211: add checks for dma mapping errors
iio: light: fix improper return value
staging: iio: cdc: fix improper return value
spi: SPI_FSL_DSPI should depend on HAS_DMA
netfilter: nft_queue: use raw_smp_processor_id()
netfilter: nf_tables: fix oob access
ASoC: rsnd: don't double free kctrl
crypto: marvell - Copy IVDIG before launching partial DMA ahash requests
btrfs: return the actual error value from from btrfs_uuid_tree_iterate
ASoC: wm_adsp: Don't overrun firmware file buffer when reading region data
s390/kbuild: enable modversions for symbols exported from asm
cec: when canceling a message, don't overwrite old status info
cec: CEC_MSG_GIVE_FEATURES should abort for CEC version < 2
cec: update log_addr[] before finishing configuration
nvmet: fix KATO offset in Set Features
xen: xenbus driver must not accept invalid transaction ids
Linux 4.9.66
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
PD#155588: hdmitx: fix a series of ddc issues
1. 149535 issue sw i2c transaction to take advantage of SDA recovery logic
2. 150784/152582 add I2C HW REACTIVE when RX serves as master
3. 151088 using only scdc.tmds.configuration
4. 152584 reduce ddc activities and add mutex to sequence ddc
Change-Id: I3f69a0fbd04ce54c4f794271fce38753f63f3b5f
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
PD#152306: dont display frames which are dropped by apk
PD#152104: video layer keep last frame
Change-Id: I271ee268b8d768fe42cd60b57d1f10b12fac7fa6
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
Pull f2fs updates from Jaegeuk Kim:
"In this round, we introduce sysfile-based quota support which is
required for Android by default. In addition, we allow that users are
able to reserve some blocks in runtime to mitigate performance drops
in low free space.
Enhancements:
- assign proper data segments according to write_hints given by user
- issue cache_flush on dirty devices only among multiple devices
- exploit cp_error flag and add more faults to enhance fault
injection test
- conduct more readaheads during f2fs_readdir
- add a range for discard commands
Bug fixes:
- fix zero stat->st_blocks when inline_data is set
- drop crypto key and free stale memory pointer while evict_inode is
failing
- fix some corner cases in free space and segment management
- fix wrong last_disk_size
This series includes lots of clean-ups and code enhancement in terms
of xattr operations, discard/flush command control. In addition, it
adds versatile debugfs entries to monitor f2fs status"
Cherry-picked from origin/upstream-f2fs-stable-linux-4.9.y:
5b2b7f7dd87f f2fs: deny accessing encryption policy if encryption is off
05dac2e89867 f2fs: inject fault in inc_valid_node_count
2e08de4fda00 f2fs: fix to clear FI_NO_PREALLOC
931ecc22b402 f2fs: expose quota information in debugfs
45d6e702d3a9 f2fs: separate nat entry mem alloc from nat_tree_lock
8e2f721703b4 f2fs: validate before set/clear free nat bitmap
27d50282d073 f2fs: avoid opened loop codes in __add_ino_entry
b1823df0e68f f2fs: apply write hints to select the type of segments for buffered write
b561061c067b f2fs: introduce scan_curseg_cache for cleanup
5772e0c102b0 f2fs: optimize the way of traversing free_nid_bitmap
a51e85eae2c3 f2fs: keep scanning until enough free nids are acquired
d75eb8d7345e f2fs: trace checkpoint reason in fsync()
bed6cffdf7e4 f2fs: keep isize once block is reserved cross EOF
5f3fdd2afc9b f2fs: avoid race in between GC and block exchange
51cb399e7ead f2fs: save a multiplication for last_nid calculation
7f41aab3d61d f2fs: fix summary info corruption
148c518517fc f2fs: remove dead code in update_meta_page
c3bc6e5183f0 f2fs: remove unneeded semicolon
9e71a0321f32 f2fs: don't bother with inode->i_version
49f72728e708 f2fs: check curseg space before foreground GC
25d0becffa0a f2fs: use rw_semaphore to protect SIT cache
0108c481d7af f2fs: support quota sys files
d4c292db7b81 f2fs: add quota_ino feature infra
1033eee92c41 f2fs: optimize __update_nat_bits
247e8951164a f2fs: modify for accurate fggc node io stat
c7272f8aebe7 Revert "f2fs: handle dirty segments inside refresh_sit_entry"
068868fc7e26 f2fs: add a function to move nid
b9f73875af11 f2fs: export SSR allocation threshold
ab30204bb9d8 f2fs: give correct trimmed blocks in fstrim
b5db2de4623f f2fs: support bio allocation error injection
58ddec85e417 f2fs: support get_page error injection
ef216e610a14 f2fs: add missing sysfs description
68ab6f8dd541 f2fs: support soft block reservation
d7947e2a3118 f2fs: handle error case when adding xattr entry
50ffaa980f98 f2fs: support flexible inline xattr size
5a8ed073c7fa f2fs: show current cp state
d888fcd74c18 f2fs: add missing quota_initialize
af1cc1ea2309 f2fs: show # of dirty segments via sysfs
6663422a3642 f2fs: stop all the operations by cp_error flag
872d8e3af080 f2fs: remove several redundant assignments
bf823c82e3fe f2fs: avoid using timespec
c70ab1b99321 f2fs: fix to correct no_fggc_candidate
0e6275dc317b Revert "f2fs: return wrong error number on f2fs_quota_write"
41d59230e302 f2fs: remove obsolete pointer for truncate_xattr_node
8c12a10f2ee4 f2fs: retry ENOMEM for quota_read|write
35e13ca2e9d9 f2fs: limit # of inmemory pages
9ca57a7e96e0 f2fs: update ctx->pos correctly when hitting hole in directory
a04208e54b9c f2fs: relocate readahead codes in readdir()
905d0370e6ab f2fs: allow readdir() to be interrupted
2dfbda03f941 f2fs: trace f2fs_readdir
d67586ddf3e9 f2fs: trace f2fs_lookup
4c94f14b3c8b f2fs: skip searching non-exist range in truncate_hole
ac5d4b425739 f2fs: expose some sectors to user in inline data or dentry case
5ded3b82dc2b f2fs: avoid stale fi->gdirty_list pointer
f6b708e25fb5 f2fs/crypto: drop crypto key at evict_inode only
33fdebbb0e7e f2fs: fix to avoid race when accessing last_disk_size
595046758d8e f2fs: Fix bool initialization/comparison
1e5305afa81e f2fs: give up CP_TRIMMED_FLAG if it drops discards
8258fd3054c1 f2fs: trace f2fs_remove_discard
6c46b37d9b43 f2fs: reduce cmd_lock coverage in __issue_discard_cmd
daf437d37cff f2fs: split discard policy
69a596797adf f2fs: wrap discard policy
28e1023e8e8a f2fs: support issuing/waiting discard in range
fd6422ea9264 f2fs: fix to flush multiple device in checkpoint
f014be822ce7 f2fs: enhance multiple device flush
0597a6e4bdcd f2fs: fix to show ino management cache size correctly
cacc1ed0c46a f2fs: drop FI_UPDATE_WRITE tag after f2fs_issue_flush
84af6aeceb49 f2fs: obsolete ALLOC_NID_LIST list
8456d343780d f2fs: convert inline data for direct I/O & FI_NO_PREALLOC
3f01af786c84 f2fs: allow readpages with NULL file pointer
2f0df25e6529 f2fs: show flush list status in sysfs
20ef20fbf78e f2fs: introduce read_xattr_block
126221de375b f2fs: introduce read_inline_xattr
127faa71f6a6 Revert "f2fs: reuse nids more aggressively"
c19928e660fb Revert "f2fs: node segment is prior to data segment selected victim"
Change-Id: I2f892e6ee75c41e84241f37b1903e0c32387d95b
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Changes in 4.9.65
tcp_nv: fix division by zero in tcpnv_acked()
net: vrf: correct FRA_L3MDEV encode type
tcp: do not mangle skb->cb[] in tcp_make_synack()
netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed
bonding: discard lowest hash bit for 802.3ad layer3+4
net: cdc_ether: fix divide by 0 on bad descriptors
net: qmi_wwan: fix divide by 0 on bad descriptors
qmi_wwan: Add missing skb_reset_mac_header-call
net: usb: asix: fill null-ptr-deref in asix_suspend
vlan: fix a use-after-free in vlan_device_event()
af_netlink: ensure that NLMSG_DONE never fails in dumps
sctp: do not peel off an assoc from one netns to another one
fealnx: Fix building error on MIPS
net/sctp: Always set scope_id in sctp_inet6_skb_msgname
crypto: dh - fix memleak in setkey
crypto: dh - Fix double free of ctx->p
ima: do not update security.ima if appraisal status is not INTEGRITY_PASS
serial: omap: Fix EFR write on RTS deassertion
serial: 8250_fintek: Fix finding base_port with activated SuperIO
dmaengine: dmatest: warn user when dma test times out
ocfs2: fix cluster hang after a node dies
ocfs2: should wait dio before inode lock in ocfs2_setattr()
ipmi: fix unsigned long underflow
mm/page_alloc.c: broken deferred calculation
coda: fix 'kernel memory exposure attempt' in fsync
mm/pagewalk.c: report holes in hugetlb ranges
Linux 4.9.65
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>