Commit Graph

859995 Commits

Author SHA1 Message Date
Sandy Huang
f64bc11207 phy/rockchip: inno-video-combo-phy: add support rk3568 lvds
Change-Id: I0021eec263aa6436f7e2055a3a361cc2728fd858
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-11-04 16:07:50 +08:00
Sugar Zhang
c4ad3526a2 ASoC: rockchip: i2s_tdm: Fix wrong reset id
Change-Id: I6960a341e05b7e46760964203579e72d078c3101
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-11-04 15:52:50 +08:00
Xing Zheng
6578e192ef ASoC: rockchip: i2s_tdm: add support handle 'io-multiplex' property
Some i2s bus GPIOs maybe designed multiplex, the default
is input, we need to configure IN/OUT dynamically.

Change-Id: I2e0f0f972d6f9fa3fc8e8fc9f5dfd5d4e6deaee1
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2020-11-04 15:52:32 +08:00
Sugar Zhang
fe27c204eb ASoC: rockchip: i2s-tdm: Fix BUG scheduling while atomic
BUG: scheduling while atomic: mediaserver/664/0x00000002
CPU: 0 PID: 664 Comm: mediaserver Tainted: G O 4.19.111 #36
Hardware name: Generic DT based system
[<b010f408>] (unwind_backtrace) from [<b010b96c>] (show_stack+0x10/0x14)
[<b010b96c>] (show_stack) from [<b08157c4>] (dump_stack+0x90/0xa4)
[<b08157c4>] (dump_stack) from [<b0147bb0>] (_schedule_bug+0x64/0x84)
[<b0147bb0>] (_schedule_bug) from [<b082b93c>] (_schedule+0x4a4/0x580)
[<b082b93c>] (_schedule) from [<b082ba68>] (schedule+0x50/0xb4)
[<b082ba68>] (schedule) from [<b082bebc>] (schedule_preempt_disabled+0x28/0x40)
[<b082bebc>] (schedule_preempt_disabled) from [<b082d020>] (_mutex_lock.constprop.7+0x534/0x5c0)
[<b082d020>] (_mutex_lock.constprop.7) from [<b03e5ba4>] (clk_prepare_lock+0x50/0xf8)
[<b03e5ba4>] (clk_prepare_lock) from [<b03e9204>] (clk_set_rate+0x18/0x88)
[<b03e9204>] (clk_set_rate) from [<b068a0dc>] (rockchip_i2s_tdm_hw_params+0x88/0x798)
[<b068a0dc>] (rockchip_i2s_tdm_hw_params) from [<b0680758>] (soc_dai_hw_params+0x58/0xa4)
[<b0680758>] (soc_dai_hw_params) from [<b0680914>] (soc_pcm_hw_params+0x170/0x55c)
[<b0680914>] (soc_pcm_hw_params) from [<b0668540>] (snd_pcm_hw_params+0x124/0x3ac)
[<b0668540>] (snd_pcm_hw_params) from [<b0669ae4>] (snd_pcm_ioctl+0x764/0xcbc)
[<b0669ae4>] (snd_pcm_ioctl) from [<b0220c38>] (do_vfs_ioctl+0xac/0x798)
[<b0220c38>] (do_vfs_ioctl) from [<b0221358>] (ksys_ioctl+0x34/0x58)
[<b0221358>] (ksys_ioctl) from [<b0101000>] (ret_fast_syscall+0x0/0x4c)
Exception stack(0xdbda3fa8 to 0xdbda3ff0)

Fixes: 61559b25ba ("ASoC: rockchip: i2s: Set clk rate when master mode")
Change-Id: I266efee0f9e5d99ff6d358c4f12e7b9dc7eb6bf8
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-11-04 15:16:53 +08:00
William Wu
a7e892c783 phy: rockchip: inno-combphy: remove redundant param_exped
The function param_read() and param_exped() do the same thing,
so this patch uses the more general param_read() instead of
the param_exped(), and delete the param_exped() directly.

Change-Id: Ic097069c28a717ff5f70ceaa36a22ea1bd26b76f
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-11-04 11:52:51 +08:00
Liang Chen
36f9645063 arm64: dts: rockchip: add cpu opp-table for RK3568
Change-Id: I287e4cc6658684e6a878fea399c2025bb3b985df
Signed-off-by: Liang Chen <cl@rock-chips.com>
2020-11-04 10:42:38 +08:00
Jon Lin
6a1a1cf4e7 spi: rockchip: Add compatible string for rk3568
Change-Id: I3ebee7ebd129ccd43c23fade643a9f6f30d4d930
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-11-04 09:00:28 +08:00
Greg Kroah-Hartman
a7baccb95f UPSTREAM: Revert "block: ratelimit handle_bad_sector() message"
This reverts commit f86b9bf622 which is
commit f4ac712e4f upstream.

Jari Ruusu writes:

	Above change "block: ratelimit handle_bad_sector() message"
	upstream commit f4ac712e4f
	in 4.19.154 kernel is not completely OK.

	Removing casts from arguments 4 and 5 produces these compile warnings:

	...

	For 64 bit systems it is only compile time cosmetic warning. For 32 bit
	system + CONFIG_LBDAF=n it introduces bugs: output formats are "%llu" and
	passed parameters are 32 bits. That is not OK.

	Upstream kernels have hardcoded 64 bit sector_t. In older stable trees
	sector_t can be either 64 or 32 bit. In other words, backport of above patch
	needs to keep those original casts.

And Tetsuo Handa writes:
	Indeed, commit f4ac712e4f ("block: ratelimit handle_bad_sector() message")
	depends on commit 72deb455b5 ("block: remove CONFIG_LBDAF") which was merged
	into 5.2 kernel.

So let's revert it.

Change-Id: I5a83d4009db1aaed899b48724d757bb327b14a10
Reported-by: Jari Ruusu <jariruusu@users.sourceforge.net>
Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
 commit fd732693294f8d013ff14d5d1574acadb7fd9fc3)
2020-11-03 19:54:04 +08:00
Tao Huang
439d4e9999 Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common
https://source.android.com/security/bulletin/2020-11-01
CVE-2020-0423

* tag 'ASB-2020-11-05_4.19-stable': (529 commits)
  ANDROID: GKI: Enable DEBUG_INFO_DWARF4
  UPSTREAM: mm/sl[uo]b: export __kmalloc_track(_node)_caller
  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
  UPSTREAM: xfrm/compat: Add 64=>32-bit messages translator
  BACKPORT: xfrm: Provide API to register translator module
  ANDROID: Publish uncompressed Image on aarch64
  FROMLIST: crypto: arm64/poly1305-neon - reorder PAC authentication with SP update
  UPSTREAM: crypto: arm64/chacha - fix chacha_4block_xor_neon() for big endian
  UPSTREAM: crypto: arm64/chacha - fix hchacha_block_neon() for big endian
  Linux 4.19.154
  usb: gadget: f_ncm: allow using NCM in SuperSpeed Plus gadgets.
  eeprom: at25: set minimum read/write access stride to 1
  USB: cdc-wdm: Make wdm_flush() interruptible and add wdm_fsync().
  usb: cdc-acm: add quirk to blacklist ETAS ES58X devices
  tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
  net: korina: cast KSEG0 address to pointer in kfree
  ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n()
  scsi: ufs: ufs-qcom: Fix race conditions caused by ufs_qcom_testbus_config()
  ...

Change-Id: I797efa1149f557c1dfab7856813cc40d1a4d60b2

Conflicts:
	drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
	mm/page_alloc.c
2020-11-03 18:36:42 +08:00
Cai YiWei
274d447789 media: rockchip: isp/ispp to version v1.2.0
Change-Id: Ide1bab9c83d8f2375d17ef3ce9d9f0686adeca01
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-11-03 17:37:18 +08:00
Guochun Huang
78779053e9 phy/rockchip: mipi-dphy: support rk3568
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: Ica831e28362ca89869d951761b8562482d39f7ff
2020-11-03 16:45:43 +08:00
Sandy Huang
2631e39729 drm/rockchip: lvds: add support rk3568
support the following work mode:

1. vop video port  -> lvds0 -> dphy0  -> single channel lvds panel
2. vop video port  -> lvds1 -> dphy1  -> single channel lvds panel
                  |-> lvds0 -> dphy0-|
3. vop video port |                  |-> dual channel lvds panel
	          |-> lvds1 -> dphy1-|

                  |-> lvds0 -> dphy0  -> single chanenl lvds panel0
4. vop video port |
	          |-> lvds1 -> dphy1  -> single chanenl lvds panel1

5. vop video port0 -> lvds0 -> dphy0  -> single chanenl lvds panel0
   vop video port1 -> lvds1 -> dphy1  -> single channel lvds panel1

Change-Id: I4e9a677fc2a3f265cb67ee9fb79f720f5e806924
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-11-03 15:43:35 +08:00
Sugar Zhang
6f16cbd3e6 clk: rockchip: rv1126: Fix MCLK_I2Sx_OUT2TO rate
This patch allows user to set MCLK_I2Sx_OUT2IO freq
by CLK_SET_RATE_PARENT.

Change-Id: Ie8f3163726d34c7cf3ee206bbc1d0866049d6eda
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-11-03 15:40:06 +08:00
Xu Hongfei
cb3d3f5e4c media: rockchip: isp: enable LDCH in 2th frame
LDCH will compete with LSC/3DLUT for the DDR bus,
which may cause LDCH to read the map table exception.
so isp enable LDCH in 2th frame.

Signed-off-by: Xu Hongfei <xuhf@rock-chips.com>
Change-Id: If84139362ee9ca8de43714915f4387923cf21000
2020-11-03 15:27:53 +08:00
Ding Wei
d53bd4a922 video: rockchip: mpp: rkvenc issue for iommu irq repeat
when iommu pagefault, mark_irq to disable iommu interrupt,
then handle the fault, and unmark_irq to enable hardware.

Change-Id: Id40868bfab67ac27e12c181d83a8e70a09a1e498
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-11-03 10:03:44 +08:00
Vicent Chi
7e3569ff9f media: rockchip: cif: fixup crop size calculation
Change-Id: I0bc33acf0a9b096e19b92fc6f010044ae4aac9b5
Signed-off-by: Vicent Chi <vicent.chi@rock-chips.com>
2020-11-03 09:32:10 +08:00
Zhenke Fan
bb0c5d7b4b media: spi: update 1608 driver
1. update safe read, limit max op size.
2. add dsp time init.
3. add dsp frame control msg.
4. support flip.
5. support file export/import, calib data read/write.
6. add align calculate func.

Signed-off-by: Zhenke Fan <fanzy.fan@rock-chips.com>
Change-Id: I714aec690d00c9aa6f7f4ef58c3616bfcbf238bb
2020-11-03 09:17:52 +08:00
Alistair Delva
974709e8bf ANDROID: GKI: Enable DEBUG_INFO_DWARF4
This is useful for debuggers, and is already the default for clang
(incidentally). Make sure it is on for all users/compilers.

Bug: 160841764
Change-Id: Ibb9a0c6900728d4cce3eccb57fb4c38268a89f24
Signed-off-by: Alistair Delva <adelva@google.com>
2020-11-02 18:58:17 +00:00
Daniel Vetter
d624a2b1ab UPSTREAM: mm/sl[uo]b: export __kmalloc_track(_node)_caller
slab does this already, and I want to use this in a memory allocation
tracker in drm for stuff that's tied to the lifetime of a drm_device,
not the underlying struct device. Kinda like devres, but for drm.

Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-2-daniel.vetter@ffwll.ch
(cherry picked from commit fd7cb5753e)
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I10790befc779311a5f2ee441e4d073e51a5a7a62
2020-11-02 16:12:14 +00:00
Cai YiWei
9e8d6dd9f8 media: rockchip: ispp: fec read yuyv format
Change-Id: I026d3c1ba6c114c67d8e589dc11990e004dcd144
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-11-02 20:10:10 +08:00
Cai YiWei
29bb0fb6a2 media: rockchip: ispp: tnr/nr/fec sync to start
Change-Id: I54efdb97cea33b4abd5ed5513f05c5d23af9d0a1
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-11-02 20:09:58 +08:00
Cai YiWei
228a86aac6 media: rockchip: isp: normal read back to enable hdr merge
Change-Id: I65ece8474522ca6c141728e4fcf08dc732f30ad4
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-11-02 20:09:47 +08:00
Shunqing Chen
8b21466cd5 drm: rockchip: dw-hdmi: add RK3568 support
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: I24ec9a60d915b71281362b0b2d67fb8c288cdd14
2020-11-02 16:57:15 +08:00
Cai YiWei
e1549bec10 ARM: dts: rv1126: monitor en to ispp
Change-Id: I1ec65cf63011e1618077c198591920efc00630c2
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-11-02 16:49:06 +08:00
Jon Lin
83d107c070 spi: rockchip: Support cs-gpio
Change-Id: I8f839189038afd77d534d767d938c845aa54fedb
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-11-02 16:48:11 +08:00
Xing Zheng
5aa131bc74 ASoC: es8311: Ensure select Mic1p-Mic1n by default
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Change-Id: I02a0a474d5aa1d7945a0cfa9cd3b4eeeb72f2118
2020-11-02 14:44:46 +08:00
Xing Zheng
5f63961294 ASoC: es8311: fix filling others bits
The width of ADC PGA gain is 4 and we need to mask them.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Change-Id: I8b8f76a7feb4fa9c9e2066385f73035c1797730d
2020-11-02 14:44:46 +08:00
Wu Liangqing
b558f4e090 net: rockchip_wlan: rtl8723cs: work around clang older than 11
/tmp/rtl8703b_phycfg-53954c.s: Assembler messages:
/tmp/rtl8703b_phycfg-53954c.s:3071: Error: selected processor does not support `bfc w0,#4,#4'

Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Change-Id: Ia24c316c385b7b0bea2c1cb2a0d639cf0a0b17d9
2020-11-02 14:43:15 +08:00
Olivier Moysan
29d1702c92 UPSTREAM: drm/bridge: sii902x: add audio graph card support
Implement get_dai_id callback of audio HDMI codec
to support ASoC audio graph card.
HDMI audio output has to be connected to sii902x port 3.
get_dai_id callback maps this port to ASoC DAI index 0.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Philippe Cornu <philippe.cornu@st.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1562141052-26221-1-git-send-email-olivier.moysan@st.com
(cherry picked from commit 17224cf29c)
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ib9cb418eadd29b6652cc27dd567d9f45dd79f7d7
2020-11-02 14:26:17 +08:00
Olivier Moysan
967396b05d UPSTREAM: drm/bridge: sii902x: make audio mclk optional
The master clock on i2s bus is not mandatory,
as sii902X internal PLL can be used instead.
Make use of mclk optional.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1563811560-29589-4-git-send-email-olivier.moysan@st.com
(cherry picked from commit 6b72c7a98b)
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Iff673d88a7105dbe7f5a53cca51c9ec3e530d2f2
2020-11-02 14:26:17 +08:00
Olivier Moysan
c832f80310 UPSTREAM: drm/bridge: sii902x: fix missing reference to mclk clock
Add devm_clk_get call to retrieve reference to master clock.

Fixes: ff5781634c ("drm/bridge: sii902x: Implement HDMI audio support")

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1563811560-29589-2-git-send-email-olivier.moysan@st.com
(cherry picked from commit 365d28c92f)
Saigned-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Icb2b1221efa8444a133c54c469f8ed5d7dba81e6
2020-11-02 14:26:17 +08:00
YueHaibing
e17f43e5e9 UPSTREAM: drm/bridge: sii902x: Make sii902x_audio_digital_mute static
Fix sparse warning:

drivers/gpu/drm/bridge/sii902x.c:665:5: warning:
 symbol 'sii902x_audio_digital_mute' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190614153623.28708-1-yuehaibing@huawei.com
(cherry picked from commit f1513d20b9)
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I0a8ca9cfdcf45ed39f5b6656857c581698277ed8
2020-11-02 14:26:17 +08:00
Colin Ian King
8e24b8a7aa UPSTREAM: drm/bridge: sii902x: fix comparision of u32 with less than zero
The less than check for the variable num_lanes is always going to be
false because the variable is a u32.  Fix this by making num_lanes an
int and also make loop index i an int too.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: ff5781634c ("drm/bridge: sii902x: Implement HDMI audio support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190603142102.27191-1-colin.king@canonical.com
(cherry picked from commit 382d8dfe8b)
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ib9bda96d9add452e026f4ddb49d8998e7226f1d5
2020-11-02 14:26:17 +08:00
Dan Carpenter
b1c277ba1b UPSTREAM: drm/bridge: sii902x: re-order conditions to prevent out of bounds read
This should check that "i" is within bounds before checking reading from
the array.

Fixes: ff5781634c ("drm/bridge: sii902x: Implement HDMI audio support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190607072704.GA25229@mwanda
(cherry picked from commit 955f03a7d0)
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ib129c19feb7a9dc57df4ae5792416a5b81da25d0
2020-11-02 14:26:17 +08:00
Jyri Sarha
e12b5c868d UPSTREAM: drm/bridge: sii902x: Implement HDMI audio support
Implement HDMI audio support by using ASoC HDMI codec. The commit
implements the necessary callbacks and configuration for the HDMI
codec and registers a virtual platform device for the codec to attach.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ef6895d016554b1e0c8b388d4993bcd6a3699341.1558964241.git.jsarha@ti.com
(cherry picked from commit ff5781634c)
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I461b8d48d2dea35876b297512de3b2cb3787c184
2020-11-02 14:26:17 +08:00
Jyri Sarha
9555cc32ff UPSTREAM: drm/bridge: sii902x: Set output mode to HDMI or DVI according to EDID
Set output mode to HDMI or DVI according to EDID HDMI signature.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c42838073b83185a5cf9949caab3c70ee093b791.1558964241.git.jsarha@ti.com
(cherry picked from commit bceee9bb89)
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I2d81387000a5a3785a6b9e91adf251077391a3e1
2020-11-02 14:26:17 +08:00
Fabrizio Castro
39c14ed602 UPSTREAM: drm/bridge/sii902x: Fix EDID readback
While adding SiI9022A support to the iwg23s board, it came
up that when the HDMI transmitter is in pass through mode the
device is not compliant with the I2C specification anymore,
as it requires a far bigger tbuf, due to a delay the HDMI
transmitter is adding when relaying the STOP condition on the
monitor i2c side of things.

When not providing an appropriate delay after the STOP condition
the i2c bus would get stuck. Also, any other traffic on the bus
while talking to the monitor may cause the transaction to fail
or even cause issues with the i2c bus as well.

I2c-gates seemed to reach consent as a possible way to address
these issues, and as such this patch is implementing a solution
based on that. Since others are clearly relying on the current
implementation of the driver, this patch won't require any DT
changes.

Since we don't want any interference during the DDC Bus
Request/Grant procedure and while talking to the monitor, we
have to use the adapter locking primitives rather than the
i2c-mux locking primitives.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Peter Rosin <peda@axentia.se>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Yannick Fertré <yannick.fertre@st.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1541505156-8097-1-git-send-email-fabrizio.castro@bp.renesas.com
(cherry picked from commit 21d808405f)
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Idb1a4b5d3c12b47d89693790fb03486ba0021ab5
2020-11-02 14:26:17 +08:00
Dmitry Safonov
0f1aab4b37 BACKPORT: xfrm/compat: Translate 32-bit user_policy from sockptr
Provide compat_xfrm_userpolicy_info translation for xfrm setsocketopt().
Reallocate buffer and put the missing padding for 64-bit message.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 96392ee5a1)
[adelva: Edited around removed compat check in Android kernels]
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I32a6495cd92fa13c956fca88aa5d80716155b8ae
2020-11-01 20:38:04 -08:00
Lin Jianhua
37bcf2634e ARM: dts: rockchip: Add rv1109-evb-ddr3-v13-facial-gate
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
Change-Id: I2fb322cc88950b0b538fbd97d13e1cf42267f57a
2020-11-02 10:20:01 +08:00
Tao Huang
f95633e02b arm64: dts: rockchip: Fix usb2phy clk for rk3568
Fixes: 3fefaf4ac8 ("arm64: dts: rockchip: Add usb2 phy nodes for RK3568 Soc")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ib5603aa1c610e3aa9225c2733c48da8941baaf63
2020-11-02 10:10:30 +08:00
Tao Huang
041cc34247 Revert "ARM: configs: rv1126_defconfig: enable ROCKCHIP_BUS_DEVFREQ"
This reverts commit 60005ae6b0.
Which make cpu unstable now.

Change-Id: Ib22d3ca75709f810a22d8754aac40cfab120022b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-11-02 09:53:03 +08:00
Dmitry Safonov
77d2c7b99a BACKPORT: xfrm/compat: Add 32=>64-bit messages translator
Provide the user-to-kernel translator under XFRM_USER_COMPAT, that
creates for 32-bit xfrm-user message a 64-bit translation.
The translation is afterwards reused by xfrm_user code just as if
userspace had sent 64-bit message.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 5106f4a8ac)
[adelva: nlmsg_parse_deprecated -> nlmsg_parse]
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: If15999b86e4704b75307fbcc3d7f0c8d8bc89e7a
2020-11-01 17:06:09 +00:00
Dmitry Safonov
0a601af04b UPSTREAM: xfrm/compat: Attach xfrm dumps to 64=>32 bit translator
Currently nlmsg_unicast() is used by functions that dump structures that
can be different in size for compat tasks, see dump_one_state() and
dump_one_policy().

The following nlmsg_unicast() users exist today in xfrm:

         Function                          |    Message can be different
                                           |       in size on compat
-------------------------------------------|------------------------------
    xfrm_get_spdinfo()                     |               N
    xfrm_get_sadinfo()                     |               N
    xfrm_get_sa()                          |               Y
    xfrm_alloc_userspi()                   |               Y
    xfrm_get_policy()                      |               Y
    xfrm_get_ae()                          |               N

Besides, dump_one_state() and dump_one_policy() can be used by filtered
netlink dump for XFRM_MSG_GETSA, XFRM_MSG_GETPOLICY.

Just as for xfrm multicast, allocate frag_list for compat skb journey
down to recvmsg() which will give user the desired skb according to
syscall bitness.

Signed-off-by: Dmitry Safonov <dima@arista.com>

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 5f3eea6b7e)
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Id1a606ddd9d7dfe73a448eeb252b1bfd8dbd2fcb
2020-11-01 17:05:59 +00:00
Dmitry Safonov
00260df47d UPSTREAM: xfrm/compat: Add 64=>32-bit messages translator
Provide the kernel-to-user translator under XFRM_USER_COMPAT, that
creates for 64-bit xfrm-user message a 32-bit translation and puts it
in skb's frag_list. net/compat.c layer provides MSG_CMSG_COMPAT to
decide if the message should be taken from skb or frag_list.
(used by wext-core which has also an ABI difference)

Kernel sends 64-bit xfrm messages to the userspace for:
- multicast (monitor events)
- netlink dumps

Wire up the translator to xfrm_nlmsg_multicast().

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 5461fc0c8d)
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Id8b59587d60feb9b9f0ce96be9d140d694573fe3
2020-11-01 17:05:51 +00:00
Dmitry Safonov
9ae4da45c5 BACKPORT: xfrm: Provide API to register translator module
Add a skeleton for xfrm_compat module and provide API to register it in
xfrm_state.ko. struct xfrm_translator will have function pointers to
translate messages received from 32-bit userspace or to be sent to it
from 64-bit kernel.
module_get()/module_put() are used instead of rcu_read_lock() as the
module will vmalloc() memory for translation.
The new API is registered with xfrm_state module, not with xfrm_user as
the former needs translator for user_policy set by setsockopt() and
xfrm_user already uses functions from xfrm_state.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit c9e7c76d70)
[adelva: Edited around some context changes]
Bug: 163141236
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ic825c6a0367fa192cc3f7af6b7d2682ef8f9d58b
2020-11-01 17:05:43 +00:00
Will McVicker
8506fc4729 ANDROID: Publish uncompressed Image on aarch64
So we can use the new download_from_ci script.

Bug: 172085130
Change-Id: I679ba3fc334b29ae82806f09e2acfc4dad486bd1
Signed-off-by: Will McVicker <willmcvicker@google.com>
2020-11-01 15:13:43 +00:00
Ard Biesheuvel
6dfab366a9 FROMLIST: crypto: arm64/poly1305-neon - reorder PAC authentication with SP update
PAC pointer authentication signs the return address against the value
of the stack pointer, to prevent stack overrun exploits from corrupting
the control flow. However, this requires that the AUTIASP is issued with
SP holding the same value as it held when the PAC value was generated.
The Poly1305 NEON code got this wrong, resulting in crashes on PAC
capable hardware.

Fixes: f569ca1647 ("crypto: arm64/poly1305 - incorporate OpenSSL/CRYPTOGAMS ...")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Bug: 152722841
Link: https://lore.kernel.org/linux-crypto/20201026230027.25813-1-ardb@kernel.org/
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Change-Id: Ib5282ac56ba5158c7d97195c2460701006bf82f6
2020-10-31 15:56:35 +01:00
Eric Biggers
2c4c3ab8ca UPSTREAM: crypto: arm64/chacha - fix chacha_4block_xor_neon() for big endian
The change to encrypt a fifth ChaCha block using scalar instructions
caused the chacha20-neon, xchacha20-neon, and xchacha12-neon self-tests
to start failing on big endian arm64 kernels.  The bug is that the
keystream block produced in 32-bit scalar registers is directly XOR'd
with the data words, which are loaded and stored in native endianness.
Thus in big endian mode the data bytes end up XOR'd with the wrong
bytes.  Fix it by byte-swapping the keystream words in big endian mode.

Fixes: 2fe55987b2 ("crypto: arm64/chacha - use combined SIMD/ALU routine for more speed")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 4b6d196c9c)
Bug: 152722841
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Change-Id: I007e5b4aa9f6dfdaea839f3fa74740321a82c682
2020-10-31 15:40:57 +01:00
Eric Biggers
666bcfcc60 UPSTREAM: crypto: arm64/chacha - fix hchacha_block_neon() for big endian
On big endian arm64 kernels, the xchacha20-neon and xchacha12-neon
self-tests fail because hchacha_block_neon() outputs little endian words
but the C code expects native endianness.  Fix it to output the words in
native endianness (which also makes it match the arm32 version).

Fixes: cc7cf991e9 ("crypto: arm64/chacha20 - add XChaCha20 support")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit f86d17e9ef)
Bug: 152722841
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Change-Id: I5a74cfd06508ed4ab6202282ce28a481fdb07641
2020-10-31 15:40:55 +01:00
Zefa Chen
97365bb2d2 media: i2c: sensor driver support quick stream on/off
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ic22acdf7617458d3a27eeb040e14ed60e05e1c90
2020-10-30 19:16:53 +08:00