The current driver only enables Pdelay_Req and Pdelay_Resp when
HWTSTAMP_FILTER_PTP_V2_EVENT, HWTSTAMP_FILTER_PTP_V1_L4_EVENT or
HWTSTAMP_FILTER_PTP_V2_L4_EVENT is requested. This results in ptp sync on
slave mode to report 'received SYNC without timestamp' when using ptp4l.
Although the hardware can support Sync, Pdelay_Req and Pdelay_resp by
setting bit14 annd bits 17/16 to 01 this leaves Delay_Req timestamps out.
Fix this by enabling all event and general messages timestamps.
This includes SYNC, Follow_Up, Delay_Req, Delay_Resp, Pdelay_Req,
Pdelay_Resp and Pdelay_Resp_Follow_Up messages.
Change-Id: Id5e4c22bff9742d21a1ef8011e3bde77e689b830
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Jose Abreu <joabreu@synopsys.com>
Tested-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry picked from commit 7d8e249f39)
This patch adds support for the SIOCGHWTSTAMP ioctl which enables user
processes to read the current hwtstamp_config settings
non-destructively.
Change-Id: I26dec7bdd16332f6427ac6ec3096e3283d9ed8d1
Signed-off-by: Artem Panfilov <panfilov.artyom@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry picked from commit d6228b7cdd)
When the property "rockchip,grf" of i2c DTS node exists and
the GRF offset is also valid, special bit needs to be configured.
Change-Id: If7ea4185b940ad026ed822b44cfb0c8acda83500
Signed-off-by: David Wu <david.wu@rock-chips.com>
If fscrypt_setup_filename() successful, fscrypt_free_filename()
must be called later to clean up.
Change-Id: I761472d605a1a3c64307fc997210ca2007bd8932
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
If user process killed:
1. kernel should not to alloc task, and wait all task done in session,
then release session.
2. fd in user space is closed, then kernel space can not use dma_buf_get
to get dma handle, so kernel will crash.
crash:
[ 35.677648 ] [<b022b098>] (__fget) from [<b0467134>]
(dma_buf_get+0x8/0x40)
[ 35.678261 ] [<b0467134>] (dma_buf_get) from [<b0397848>]
(mpp_dma_find_buffer_fd+0x14/0x94)
[ 35.679004 ] [<b0397848>] (mpp_dma_find_buffer_fd) from [<b03978fc>]
(mpp_dma_release_fd+0x34/0xa0)
[ 35.679799 ] [<b03978fc>] (mpp_dma_release_fd) from [<b0395b2c>]
(mpp_task_finalize+0x68/0xbc)
[ 35.680561 ] [<b0395b2c>] (mpp_task_finalize) from [<b0398614>]
(rkvdec_free_task+0xc/0x1c)
[ 35.681290 ] [<b0398614>] (rkvdec_free_task) from [<b03963e4>]
(mpp_wait_result+0xd4/0x400)
[ 35.682020 ] [<b03963e4>] (mpp_wait_result) from [<b0396940>]
(mpp_dev_release+0x230/0x244)
[ 35.682750 ] [<b0396940>] (mpp_dev_release) from [<b020f30c>]
(__fput+0x88/0x1c4)
[ 35.683415 ] [<b020f30c>] (__fput) from [<b0140cac>]
(task_work_run+0x90/0xb0)
[ 35.684059 ] [<b0140cac>] (task_work_run) from [<b0128b38>]
(do_exit+0x3c4/0xac4)
[ 35.684722 ] [<b0128b38>] (do_exit) from [<b0129f54>]
(do_group_exit+0x3c/0xbc)
[ 35.685366 ] [<b0129f54>] (do_group_exit) from [<b0133b50>]
(get_signal+0xe4/0x6ac)
[ 35.686040 ] [<b0133b50>] (get_signal) from [<b010b09c>]
(do_signal+0x2a0/0x494)
[ 35.686690 ] [<b010b09c>] (do_signal) from [<b010b454>]
(do_work_pending+0xb4/0xd0)
[ 35.687364 ] [<b010b454>] (do_work_pending) from [<b0101064>]
(slow_work_pending+0xc/0x20)
Change-Id: I8decec8ff4c356b315fe511128c5b67c5b349932
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
claim_swapfile() currently keeps the inode locked when it is successful,
or the file is already swapfile (with -EBUSY). And, on the other error
cases, it does not lock the inode.
This inconsistency of the lock state and return value is quite confusing
and actually causing a bad unlock balance as below in the "bad_swap"
section of __do_sys_swapon().
This commit fixes this issue by moving the inode_lock() and IS_SWAPFILE
check out of claim_swapfile(). The inode is unlocked in
"bad_swap_unlock_inode" section, so that the inode is ensured to be
unlocked at "bad_swap". Thus, error handling codes after the locking now
jumps to "bad_swap_unlock_inode" instead of "bad_swap".
=====================================
WARNING: bad unlock balance detected!
5.5.0-rc7+ #176 Not tainted
-------------------------------------
swapon/4294 is trying to release lock (&sb->s_type->i_mutex_key) at: __do_sys_swapon+0x94b/0x3550
but there are no more locks to release!
other info that might help us debug this:
no locks held by swapon/4294.
stack backtrace:
CPU: 5 PID: 4294 Comm: swapon Not tainted 5.5.0-rc7-BTRFS-ZNS+ #176
Hardware name: ASUS All Series/H87-PRO, BIOS 2102 07/29/2014
Call Trace:
dump_stack+0xa1/0xea
print_unlock_imbalance_bug.cold+0x114/0x123
lock_release+0x562/0xed0
up_write+0x2d/0x490
__do_sys_swapon+0x94b/0x3550
__x64_sys_swapon+0x54/0x80
do_syscall_64+0xa4/0x4b0
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f15da0a0dc7
Change-Id: I02a0fcfc63c3dcc4c4cdaf8b2500f5253e648649
Fixes: 1638045c36 ("mm: set S_SWAPFILE on blockdev swap devices")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Qais Youef <qais.yousef@arm.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/20200206090132.154869-1-naohiro.aota@wdc.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit d795a90e2b)
This is the only dts tested with android 10.
Change-Id: I444f7832beec8ec6ed599acdd745abc9d5b430f2
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Create a new flag to indicate mux route is from topgrf or pmugrf.
* INVALID: means do not need to set mux route
* DEFAULT: means same regmap as pin iomux
* TOPGRF: means mux route setting in topgrf
* PMUGRF: means mux route setting in pmugrf
Change-Id: Iff57f3649d09751ff846560bd8a1599f6ef7ef04
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
rkvenc: osd plt clock should reset, othterwise, osd setting will not work
Change-Id: I47752b735b6f63303e9b12f4616510f2701970bd
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Use the phy_clk to prepare_enable and unprepare_disable related phy clock.
Change-Id: Idcf3ee00c03b4a5009a6a9385077b0a421dbc601
Signed-off-by: David Wu <david.wu@rock-chips.com>
This patch adds a new uvc attribute "streaming_intf" to
show the number of streaming interface. The uvc application
program may needs to query the information.
Change-Id: I4554e204ab4457f67f35d2e7bfec2902196f79d3
Signed-off-by: William Wu <william.wu@rock-chips.com>
1. add video_hevc_cabac to clock list
2. set default hevc cabac clock
3. set clock for each task
Change-Id: Ic09dcc2267d8ca7c745fdbc70f079de06fde90e9
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Currently on an rk3288 SoC when trying to use the watchdog the SoC will
instantly reset. This is due to the watchdog countdown counter being set
to its initial value of 0x0. Reset the watchdog counter before start in
order to correctly start the countdown timer from the right position.
Change-Id: I127b1b83ff6d459a45139847092ddbfa56c60bcd
Signed-off-by: Jack Mitchell <ml@embed.me.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200107155155.278521-1-ml@embed.me.uk
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit e7046df873)
1.more undefined references to `__memzero' follow
2.fix to MTD return value
Change-Id: I1adf89873db1e85568deaf2941867b8d45252eff
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Allow rfkill-bt.c and rfkill-wlan.c build as module.
Add CONFIG_RFKILL_RK which default y.
Change-Id: I1d399641587124d2291b5b49e5538e7e490a843a
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
net/rfkill/rfkill-wlan.c use mmc_pwrseq_power_off()
Change-Id: I761788f58418604c43f367b48dfe4bb2ff971d48
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
FMWAIT configured with a wrong value to cause timing error.
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: Ib09b79b5702bdff3010a578a50fc0d97854c03f1
Although stereo transmission, actually only 1ch data,
just to adapt the controller of only support stereo and above.
Change-Id: I0f2d6d1b43954080a980d4e4b8ea8f3ca8207d7b
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
f2fs_inode_info.flags is unsigned long variable, it has 32 bits
in 32bit architecture, since we introduced FI_MMAP_FILE flag
when we support data compression, we may access memory cross
the border of .flags field, corrupting .i_sem field, result in
below deadlock.
To fix this issue, let's expand .flags as an array to grab enough
space to store new flags.
Call Trace:
__schedule+0x8d0/0x13fc
? mark_held_locks+0xac/0x100
schedule+0xcc/0x260
rwsem_down_write_slowpath+0x3ab/0x65d
down_write+0xc7/0xe0
f2fs_drop_nlink+0x3d/0x600 [f2fs]
f2fs_delete_inline_entry+0x300/0x440 [f2fs]
f2fs_delete_entry+0x3a1/0x7f0 [f2fs]
f2fs_unlink+0x500/0x790 [f2fs]
vfs_unlink+0x211/0x490
do_unlinkat+0x483/0x520
sys_unlink+0x4a/0x70
do_fast_syscall_32+0x12b/0x683
entry_SYSENTER_32+0xaa/0x102
Change-Id: I2777d32fd64e55514549fe82be397fdd671beaf6
Fixes: 4c8ff7095b ("f2fs: support data compression")
Tested-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 7de5ad45b809b5043fb12c3e280ceffe9a6a13d4
git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs dev)
latest commit in master:
d64c7a0803 ("r8152: check disconnect status after long sleep")
Change-Id: Id67ff7cd238342b8b8bef7c39c63cd397d81ee30
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
new version rkvdec has extra clock and reset for cabac module.
Change-Id: I24c82ad57e382d3f2b8fcde11c149f9cf50ffb15
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Delivery message to upper only when mailbox client is existed.
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I2fbfc3ecd110fe26d0ffed5ee90d1e4877450ef9
px30 grf switch method:
a) ensure clk on
b) ensure power on
c) disable all iommu
d) switch grf
e) enable current iommu
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I1015ea9df6d8745f0a4922a1f684082660fac314
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
This patch fix the bug that if the property maximum-speed of dwc3 is
configured to high-speed in DTS, gadget connection will be slow.
Before gadget connection, it is necessary to write register DCFG to set
maximum speed, if you don't, dwc3 will generate Erratic Error Event many
times and results to slow connection. Actually, maximum speed will be
set when Android layer call udc_bind_to_driver but it will fail when
dwc3 runtime-suspended. For Rockchip SoCs, dwc3 will be suspended as long
as USB cable is unplugged, so we add udc_set_speed before dwc3 runtime
resume.
Change-Id: I261c2cf9a36179a8d600f223fc8fd4757c7f622d
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
When I test the uvc gadget function, I find that the uvc
gadget can only transfer the first frame image and then
stop unexpectedly.
Without this patch, the isochronous endpoints doesn't wait
for a XferNotReady event to start the next frame image, and
fail to transfer data. In this case, we will get an endpoint
event DWC3_DEPEVT_XFERINPROGRESS and the event status is
DEPEVT_STATUS_MISSED_ISOC, and the original code try to
issue an EndTransfer command if the started_list is empty.
However, the started_list is never empty, so it doesn't issue
an EndTransfer command and not XferNotReady event happens.
To fix this problem, this patch firstly checks if the event
status is DEPEVT_STATUS_MISSED_ISOC and then unmap the isoc
request and move the request to the pending list. Then it
issue an EndTransfer command if the started_list is empty.
After the EndTransfer is completed, we will get a XferNotReady
event and it can start the isoc requests again.
Change-Id: Ieac3ca9a177bc7599b29ae30bee243e47b3ba7c9
Signed-off-by: William Wu <william.wu@rock-chips.com>
use fast standby mode && mipi clk non-continue mode
to fix take photo stresstest issue
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: Idf9ff7e509d77cb78764ba5f97f14ff402172363