Commit Graph

607012 Commits

Author SHA1 Message Date
Binyuan Lan
d86b2eeb56 arm64: rockchip_defconfig: add CONFIG_SND_SOC_RK817
Change-Id: I3771ee617de44d9cfd8d142fc66ca5ea8df64899
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2018-02-08 21:15:51 +08:00
William Wu
51246818af arm64: dts: rockchip: remove HCLK_HOST_ARB from usb host for px30
The HCLK_HOST_ARB is enabled with CLK_IGNORE_UNUSED flag,
so we don't need to control this clk in usb host EHCI and
OHCI controller driver.

Change-Id: I25201170977b30f904611bbcfdcb1eb6230195fe
Signed-off-by: William Wu <william.wu@rock-chips.com>
2018-02-08 21:13:52 +08:00
Feng Mingli
cdfac2ac67 usb: dwc_otg_310: hcd: Giveback URB in tasklet context
In commit 94dfd7edfd ("USB: HCD: support giveback of URB in tasklet
context") support was added to give back the URB in tasklet context.
Let's take advantage of this in dwc_otg_310.

This speeds up the dwc_otg_310 interrupt handler considerably, it means
we've got a better chance of not missing SOF interrupts.

TEST=Unable to preview yuyv format usb camera on rk3288 board when use
dwc usb controller because of missing SOF interrupts.

Change-Id: I52194d7fbddaf684c601d328e2a3c0f28fcb83b8
Signed-off-by: Feng Mingli <fml@rock-chips.com>
2018-02-08 21:12:13 +08:00
William Wu
109121e68d FROMLIST: usb: gadget: f_fs: Use config_ep_by_speed()
In commit 2bfa0719ac ("usb: gadget: function: f_fs: pass
companion descriptor along") there is a pointer arithmetic
bug where the comp_desc is obtained as follows:

 comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds +
	       USB_DT_ENDPOINT_SIZE);

Since ds is a pointer to usb_endpoint_descriptor, adding
7 to it ends up going out of bounds (7 * sizeof(struct
usb_endpoint_descriptor), which is actually 7*9 bytes) past
the SS descriptor. As a result the maxburst value will be
read incorrectly, and the UDC driver will also get a garbage
comp_desc (assuming it uses it).

Since Felipe wrote, "Eventually, f_fs.c should be converted
to use config_ep_by_speed() like all other functions, though",
let's finally do it. This allows the other usb_ep fields to
be properly populated, such as maxpacket and mult. It also
eliminates the awkward speed-based descriptor lookup since
config_ep_by_speed() does that already using the ones found
in struct usb_function.

Fixes: 2bfa0719ac ("usb: gadget: function: f_fs: pass
companion descriptor along")

Change-Id: Ic3f6297781571268a0b6b1b3f0a04b70d7fa7a68
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(am from https://www.spinics.net/lists/linux-usb/msg165149.html)
2018-02-08 21:12:13 +08:00
John Keeping
984ae2a17b UPSTREAM: usb: f_fs: Force Reserved1=1 in OS_DESC_EXT_COMPAT
The specification says that the Reserved1 field in OS_DESC_EXT_COMPAT
must have the value "1", but when this feature was first implemented we
rejected any non-zero values.

This was adjusted to accept all non-zero values (while now rejecting
zero) in commit 53642399aa ("usb: gadget: f_fs: Fix wrong check on
reserved1 of OS_DESC_EXT_COMPAT"), but that breaks any userspace
programs that worked previously by returning EINVAL when Reserved1 == 0
which was previously the only value that succeeded!

If we just set the field to "1" ourselves, both old and new userspace
programs continue to work correctly and, as a bonus, old programs are
now compliant with the specification without having to fix anything
themselves.

Change-Id: I7fe3d54ce649049ad0a1db4564319af03488ad48
Fixes: 53642399aa ("usb: gadget: f_fs: Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT")
Cc: <stable@vger.kernel.org>
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit a3acc69608)
2018-02-08 21:12:13 +08:00
Andrew Gabbasov
bb16981daa UPSTREAM: usb: gadget: f_fs: Fix use-after-free in ffs_free_inst
KASAN enabled configuration reports an error

BUG: KASAN: use-after-free in ffs_free_inst+... [usb_f_fs] at addr ...
Write of size 8 by task ...

This is observed after "ffs-test" is run and interrupted. If after that
functionfs is unmounted and g_ffs module is unloaded, that use-after-free
occurs during g_ffs module removal.

Although the report indicates ffs_free_inst() function, the actual
use-after-free condition occurs in _ffs_free_dev() function, which
is probably inlined into ffs_free_inst().

This happens due to keeping the ffs_data reference in device structure
during functionfs unmounting, while ffs_data itself is freed as no longer
needed. The fix is to clear that reference in ffs_closed() function,
which is a counterpart of ffs_ready(), where the reference is stored.

Change-Id: Ia7d30dfe643ef5de184620b483ef3ad16a76d309
Fixes: 3262ad8243 ("usb: gadget: f_fs: Stop ffs_closed NULL pointer dereference")
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit cdafb6d8b8)
2018-02-08 21:12:13 +08:00
Jim Baxter
67bb2799fb UPSTREAM: usb: gadget: f_fs: Stop ffs_closed NULL pointer dereference
The struct ffs_data::private_data has a pointer to
ffs_dev stored in it during the ffs_fs_mount() function
however it is not cleared when the ffs_dev is freed
later which causes the ffs_closed function to crash
with "Unable to handle kernel NULL pointer dereference"
error when using the data in ffs_data::private_data.

This clears this pointer during the ffs_free_dev clean
up function.

Change-Id: I1fde26421cb44084d73e8c2a1786ea3f09f952fc
Signed-off-by: Jim Baxter <jim_baxter@mentor.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 3262ad8243)
2018-02-08 21:12:13 +08:00
Vincent Pelletier
411314c56d UPSTREAM: usb: gadget: f_fs: Fix iterations on endpoints.
When zero endpoints are declared for a function, there is no endpoint
to disable, enable or free, so replace do...while loops with while loops.
Change pre-decrement to post-decrement to iterate the same number of times
when there are endpoints to process.

Change-Id: Ia6cb1324ce5acdab00677181475b34ab5731f578
Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 08f37148b6)
2018-02-08 21:12:13 +08:00
Jim Lin
9fac9f59aa UPSTREAM: usb: gadget: f_fs: Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT
Current __ffs_data_do_os_desc() of f_fs.c will check reserved1 field
of OS_DESC_EXT_COMPAT and return -EINVAL if it's 1.
But MS OS 1.0 Descriptors
http://msdn.microsoft.com/en-us/library/windows/hardware/gg463179.aspx
defines that field to be 1.

Change-Id: I9a3c7cf148c161ff1f0f8e798208a196c4aca3d2
Signed-off-by: Jim Lin <jilin@nvidia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 53642399aa)
2018-02-08 21:12:13 +08:00
William Wu
2f0ec89e19 Revert "usb: gadget: f_fs: Update driver to handle compat id descriptors"
This reverts commit 548b453dcc which
is replaced with the upstream commit 53642399aa ("usb: gadget: f_fs:
Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT").

Change-Id: I34e0f68d1e54a1852d021ee3ef78e3944fea675f
Signed-off-by: William Wu <william.wu@rock-chips.com>
2018-02-08 21:12:13 +08:00
Binyuan Lan
63c07f8a39 arm64: dts: rockchip: add rk817 codec for rk3326
Change-Id: I8d86246b8e75ae028ba0f1d9b58c8facd2816556
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2018-02-08 21:01:14 +08:00
Binyuan Lan
8c4db84a0a ASoC: rockchip: add support for rk817 codec
Change-Id: I4fd64900d3ac0e573371af5ba47a3cb7b83a7c93
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2018-02-08 21:00:48 +08:00
Sugar Zhang
7a53209b74 ARM: configs: rockchip_defconfig: add rk3228 internal codec
Change-Id: I7f6cf60a7881a3452a92ce08f9637e52f93627f8
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-02-08 18:16:11 +08:00
Sugar Zhang
245adad7ad ARM: dts: rockchip: rk3229-evb: add internal sound card
Change-Id: I60fe52867a60548dbe2d476b2fc161fc13ec8fc1
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-02-08 18:16:11 +08:00
Sugar Zhang
4d4dfc7e3c ARM: dts: rockchip: rk322x: add internal codec
Change-Id: I3d376232d02770c72be396487a7481fe8fcbede5
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-02-08 18:16:11 +08:00
Sugar Zhang
02213b12e1 ASoC: codec: add rk3228 internal codec
Change-Id: Icf83257726f12558cbdde4d4b2876dc8a3123626
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-02-08 18:16:11 +08:00
Zhou weixin
92b2aac00e arm64: dts: rockchip: Disabeld cif for rk3326 evb board
Change-Id: Iebd5858561720521a863bacf5331ace3b89d1150
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-02-08 18:13:36 +08:00
David Wu
ff72078491 arm64: dts: rockchip: Fix some adc key issues for rk3326/px30 board
1. add vref voltage 1.8v;
2. Alphabetical order;
3. Fix the press-threshold-microvolt;
4. Add poll interval 100ms

Change-Id: If5e29f5073155be3022053cc3516dda88c5db223
Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-02-08 18:12:35 +08:00
David Wu
bbdfca3f4f arm64: configs: Enable CONFIG_KEYBOARD_ADC config for rockchip_defconfig
Change-Id: Ibb1deaeadc13186f12251a8596c8dd214bd0c12b
Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-02-08 18:11:56 +08:00
Sandy Huang
bc11949511 drm/rockchip: vop: fix iommu pagefault
This version vop will read buffer when win2 master0-3 disable but
win2 enable, this is different from old vop version. so we add to
disable win2 en to make sure it's save.

Change-Id: Ib239a8901095a6eff980747f219c3aa585437dae
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-02-08 18:11:33 +08:00
Putin Lee
230ab0bd6c arm64: dts: rockchip: px30: add SCLK_RGA_CORE for rk_rga.
Change-Id: Ib183606bbd1a4ac2c9669100a6634aca45bcfb5e
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2018-02-08 15:31:57 +08:00
Zhang Yunlong
6b1070e646 camera: rockchip: cif: support multi camera config
fix gpio_desc request fail when multi cameras defined in dts.

Change-Id: I058ea1284ef86fcea621197367e426f018853936
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>
2018-02-08 14:57:10 +08:00
YouMin Chen
56dfe1fdbe arm64: dts: rockchip: add px30 ddr relate node
Change-Id: I33119ba0250c6c9fe78d124bf92a94a52f9442bf
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-02-08 14:56:22 +08:00
YouMin Chen
3f9d4749de PM / devfreq: event: add support for px30 dfi
Change-Id: Ib6808d961b65d993fea05ab15d648d814d14a4a2
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-02-08 14:53:27 +08:00
YouMin Chen
8865f61ad2 PM / devfreq: rockchip_dmc: add support for px30
Change-Id: I225088ce179f9b9cd62fce256b87bccb591fd2b2
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-02-08 14:52:32 +08:00
YouMin Chen
326d6f59d1 clk: rockchip: px30: Add SCLK_DDRCLK for dmc
Change-Id: I03d6c18829f8895c28bbaef883e187304c48f9aa
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-02-08 14:52:26 +08:00
Huibin Hong
53d9e933bc fiq_debugger: rockchip: deal with this_cpu and current_cpu are different
If this cpu is not the same as current cpu, it means we don't use
current cpu any more, and this cpu handles uart interrupt. So it
is unnecessary to set uart interrupt to this cpu again.

Change-Id: Ia454af96ee766dcbc8b22339652a4aa7eb229568
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2018-02-08 14:29:02 +08:00
Zorro Liu
92d992f480 arm64: dts: rockchip: modified sensor layout of rk3326-evb-lp3-v10 board
Change-Id: Ib8fbddaf02f0e3d77f230e6ff44f0613ff12d822
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2018-02-08 14:22:43 +08:00
Zhou weixin
70d0347a0b arm64: dts: rockchip: enable vip for rk3326 863 board
Change-Id: Ied60270696bc0dfd0dc41937c1e24b289e6063f5
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-02-08 14:22:20 +08:00
Zhong Yichong
2c20095fea arm64: dts: rockchip: px30: add vip iommu node reference to vip node
Change-Id: Ic2772881a47aeb25ff68e2a39f3895e40db70a42
Signed-off-by: Zhong Yichong <zyc@rock-chips.com>
2018-02-08 14:21:28 +08:00
Sugar Zhang
65c32d2028 arm64: dts: rockchip: px30: add default pinctrl for i2s, pdm
Change-Id: I5cf7436e65c04a30cc3ef4c89ee49e1e76ef0527
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-02-08 14:20:41 +08:00
Finley Xiao
8ee4287ff7 clk: rockchip: px30: Make pclk_top_pre critical
Change-Id: I86081f6dbd85ab36e0e83b5b22fdd7b686a2cf9d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-08 14:10:58 +08:00
Caesar Wang
e2e86394f6 arm64: rockchip_linux_config: enable the cdn DP
Change-Id: I2b9812be9a33b31e7b9e9531f5c1acd2c8dc53a2
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2018-02-08 13:42:26 +08:00
Caesar Wang
628c1aeb34 arm64: dts: rockchip: enable cdn DP for rk3399 sapphire
As we had posted the DP firmeware to /lib/firmware/rockchip,
so you need check this path in your rootfs first, if enable the DP.

Change-Id: Id24a42edc9d6cd0b0de0a2dfefe2727df3965b67
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2018-02-08 13:42:20 +08:00
Rocky Hao
f417571488 PM / devfreq: rockchip_dmc: record opp rate instead of real clock rate
opp rate is used to calc power in thermal framework, so we record this rate
instead of real clock rate.

Change-Id: Ic51a8c36be8d63fcf765e6d49930d1d437a2e502
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2018-02-08 09:47:01 +08:00
Rocky Hao
ae5b1c4df1 arm: dts: rockchip: add dmc thermal control for rk322x
add power model for dmc and add dmc as a cooling device in thermal
control

Change-Id: Ibc5f8ec97b43d4fcf9ff817582711b924d2a7ef0
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2018-02-08 09:46:38 +08:00
Finley Xiao
3aa3d78ce1 PM / devfreq: rockchip_dmc: Disable auto-freq if events is disabled
Change-Id: Ia39dfc884feea8cb6c29a7ed293bb567aca15b83
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-08 09:46:14 +08:00
Liang Chen
069bbc18e7 arm: dts: enable dmc for board rk3229-evb-android
Change-Id: I9abf24d165e236d1895efc04336982c2ce81c013
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-08 09:45:27 +08:00
Liang Chen
d826c69c4d arm: dts: add dmc support for rk322x
Change-Id: Ibf72cb8d2e26490386212d564309f5b85692105a
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-08 09:45:10 +08:00
Liang Chen
f06ee6308f PM / devfreq: rockchip_dmc: add support for rk3228
Change-Id: I3943716a66b3c0849d815b7f69cc0bbd843d7e4e
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-08 09:37:30 +08:00
Liang Chen
adbf52abda clk: rockchip: rk3228: add clk_ddrc for devfreq of ddr
Change-Id: I3771e2ef68ab3fa8ad1b7d61a84c7181c693c60f
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-08 09:35:17 +08:00
Zhou weixin
b48da90f72 arm64: dts: rockchip: add wifi power control for rk3326-863-lp3-v10
Change-Id: Ic5dd468ade0c165c14d80530f3bba43979c785a0
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-02-08 09:33:19 +08:00
Zhou weixin
deacb7ed8d arm64: dts: rockchip: px30: Correct sdio irq number and add iomux
Change-Id: Id61aece26f7c9e612a332ed8d0342693a4cc3b6a
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-02-08 09:30:20 +08:00
Liang Chen
491f6e8e93 arm64: dts: rockchip: add pstore for px30-android
Change-Id: I2e12f234244eb45e24d1f38841eef7017ae8cfd4
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-08 09:26:06 +08:00
Sandy Huang
a442d86da8 drm/rockchip: px30 vop: not support ymirror and add channel config
Change-Id: Ia89b6d5fde3b191b82e81c1399f82689267a629a
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-02-08 09:25:43 +08:00
Tao Huang
8590206686 mfd/fusb302: fix compile warning
drivers/mfd/fusb302.c:1164:3: warning: memset used with length
equal to number of elements without multiplication by element
size [-Wmemset-elt-size]

Change-Id: I33ac6408bc4cee656c7f18948d418527619b3d6b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-02-08 09:24:58 +08:00
Tao Huang
8d2d0b6a51 Merge tag 'lsk-v4.4-18.02-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
LSK 18.02 v4.4-android

* tag 'lsk-v4.4-18.02-android': (131 commits)
  Linux 4.4.114
  nfsd: auth: Fix gid sorting when rootsquash enabled
  net: tcp: close sock if net namespace is exiting
  flow_dissector: properly cap thoff field
  ipv4: Make neigh lookup keys for loopback/point-to-point devices be INADDR_ANY
  net: Allow neigh contructor functions ability to modify the primary_key
  vmxnet3: repair memory leak
  sctp: return error if the asoc has been peeled off in sctp_wait_for_sndbuf
  sctp: do not allow the v4 socket to bind a v4mapped v6 address
  r8169: fix memory corruption on retrieval of hardware statistics.
  pppoe: take ->needed_headroom of lower device into account on xmit
  net: qdisc_pkt_len_init() should be more robust
  tcp: __tcp_hdrlen() helper
  net: igmp: fix source address check for IGMPv3 reports
  lan78xx: Fix failure in USB Full Speed
  ipv6: ip6_make_skb() needs to clear cork.base.dst
  ipv6: fix udpv6 sendmsg crash caused by too small MTU
  ipv6: Fix getsockopt() for sockets with default IPV6_AUTOFLOWLABEL
  dccp: don't restart ccid2_hc_tx_rto_expire() if sk in closed state
  hrtimer: Reset hrtimer cpu base proper on CPU hotplug
  ...
2018-02-07 20:59:20 +08:00
Finley Xiao
f6128506aa clk: rockchip: px30: Fix i2s out mclk
Change-Id: I1f90747c780c867e172168e8c877915477a66e59
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-07 19:47:28 +08:00
Tao Huang
dcc52ea50d video/rockchip/rk_fb: fix compile warning
drivers/video/rockchip/rk_fb.c:4002:4: warning: this else
clause does not guard... [-Wmisleading-indentation]

Change-Id: I4c75dea72a2ebde8f1271334f91d5fd890274017
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-02-07 19:25:00 +08:00
Tao Huang
6e1a9a5ca4 video/rockchip/lcdc/rk3368_lcdc: fix compile warning
drivers/video/rockchip/lcdc/rk3368_lcdc.c:2198:2: warning: this if
clause does not guard... [-Wmisleading-indentation]

Change-Id: I0cbd3ba10b891b67782b1a105eaac3d473e52527
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-02-07 19:24:35 +08:00