Commit Graph

84259 Commits

Author SHA1 Message Date
Wyon Bi
363e47c6aa phy/rockchip: typec: improved handling of typec_dp_phy_config()
Change-Id: I61ca43ffe7fe85e041fb3ed66ba1d59f515770d9
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-16 18:13:54 +08:00
Sandy Huang
b0ae63a095 drm/rockchip: csi: Add support RK1808
Change-Id: Ia908f1a8c0a4f72b61bacf98ab6e4ed9a3e3ebed
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-08-15 18:47:25 +08:00
Sandy Huang
5babaa7e5f drm/rockchip: vop: add support rk1808 vop
rk1808 have vop lite and vop raw:
1. vop lite: support win1 for display, vop->dsi tx->dphy->lcd.
2. vop raw: transfer data from ddr to csi tx.

Change-Id: I11229b5e61e66e72e4228e7e0ac966f1f85cb49f
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-08-15 17:38:03 +08:00
huang lin
eedd1893c9 BACKPORT: FROMLIST: phy: rockchip-typec: support variable phy config value
the phy config values used to fix in dp firmware, but some boards
need change these values to do training and get the better eye diagram
result. So support that in phy driver.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Lin Huang <hl@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10420473/)

Conflicts:
	drivers/phy/phy-rockchip-typec.c
[phy-rockchip-typec.c is different path in upstream code]

BUG=b:72006974
TEST=DP can display on Dru

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1032713

Change-Id: I8a63307ad5cb690d819779662d70ae1c232842a5
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Lin Huang
707ec089ca BACKPORT: FROMLIST: soc: rockchip: split rockchip_typec_phy struct to separate header
we may use rockchip_phy_typec struct in other driver, so split
it to separate header.

Signed-off-by: Lin Huang <hl@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10420467/)

Conflicts:
	drivers/phy/phy-rockchip-typec.c
[phy-rockchip-typec.c is different path in upstream code]

BUG=b:72006974
TEST=DP display on Dru

Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1069958

Change-Id: I709331d1577923be662660eb606f92b743903ba7
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Sean Paul
a2e187394d BACKPORT: drm: Add some HDCP related #defines
In preparation for implementing HDCP in i915, add some HDCP related
register offsets and defines. The dpcd register offsets will go in
drm_dp_helper.h whereas the ddc offsets along with generic HDCP stuff
will get stuffed in drm_hdcp.h, which is new.

Changes in v2:
- drm_hdcp.h gets MIT license (Daniel)
Changes in v3:
- None
Changes in v4:
- None
Changes in v5:
- None
Changes in v6:
- SPDX license

Cc: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Ramalingam C <ramalingm.c@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180108195545.218615-5-seanpaul@chromium.org

(cherry picked from commit 495eb7f877)
Signed-off-by: Sean Paul <seanpaul@chromium.org>
[downstream changes]
- Resolved some CEC define conflicts in dp_helper.h

Reviewed-on: https://chromium-review.googlesource.com/849080
Commit-Ready: Sean Paul <seanpaul@google.com>
Tested-by: Sean Paul <seanpaul@google.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>

Change-Id: I7e9dfb6f2c20c15bdc5f6ee6c89fdaf0a85ed1ea
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Sean Paul
29eec2954c BACKPORT: drm: Add Content Protection property
This patch adds a new optional connector property to allow userspace to enable
protection over the content it is displaying. This will typically be implemented
by the driver using HDCP.

The property is a tri-state with the following values:
- OFF: Self explanatory, no content protection
- DESIRED: Userspace requests that the driver enable protection
- ENABLED: Once the driver has authenticated the link, it sets this value

The driver is responsible for downgrading ENABLED to DESIRED if the link becomes
unprotected. The driver should also maintain the desiredness of protection
across hotplug/dpms/suspend.

If this looks familiar, I posted [1] this 3 years ago. We have been using this
in ChromeOS across exynos, mediatek, and rockchip over that time.

Changes in v2:
 - Pimp kerneldoc for content_protection_property (Daniel)
 - Drop sysfs attribute
Changes in v3:
 - None
Changes in v4:
- Changed kerneldoc to recommend userspace polling (Daniel)
- Changed kerneldoc to briefly describe how to attach the property (Daniel)
Changes in v5:
- checkpatch whitespace noise
- Change DRM_MODE_CONTENT_PROTECTION_OFF to DRM_MODE_CONTENT_PROTECTION_UNDESIRED
Changes in v6:
- None

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>

[1] https://lists.freedesktop.org/archives/dri-devel/2014-December/073336.html
Link: https://patchwork.freedesktop.org/patch/msgid/20180108195545.218615-4-seanpaul@chromium.org

(cherry picked from commit 24557865c8)
Signed-off-by: Sean Paul <seanpaul@chromium.org>

[downstream changes]
 - Fixed some conflicts in comments
- Remove duplicate definition for drm_get_content_protection_name

Change-Id: I825b4863bea715434cb8f76f99fdf6e3fca74a60
Reviewed-on: https://chromium-review.googlesource.com/849079
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Sean Paul <seanpaul@google.com>
Reviewed-by: Sean Paul <seanpaul@google.com>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Sean Paul
e00541fcb2 CHROMIUM: drm: Update Content Protection ABI
The Content Protection properties in 4.4 used v2 of the upstream
patches, but chrome (and upstream) prefer v1. This patch removes the ksv
property and reinstates the ENABLED enum value to the content protection
property.

BUG=b:63816472
TEST=Watch protected content on external display, ensure CP is
	enabled/disabled properly by chrome

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/687800
Commit-Ready: Sean Paul <seanpaul@google.com>
Tested-by: Sean Paul <seanpaul@google.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>

Change-Id: I38cecce2d15b4d4b1ce95ef0e572a08f1bc97131
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Yakir Yang
f302e1e4fd CHROMIUM: drm: Add "Enabled" value back to "Content Protection" property
Although this property value have been deleted from the latest
FROMLIST version (CL:266854), but the chromeos would want driver
to report the property to "Enabled" when hardware HDCP have been
enabled successfully, so let's add this back.

BUG=chrome-os-partner:56883
TEST=None

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/403974
Reviewed-by: Sean Paul <seanpaul@google.com>

Change-Id: Icc52d4a83ac434e898be1190cf934ed8333e78bf
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Sean Paul
244b82e20e FROMLIST: drm: Add Content Protection properties to drm
Add new standard connector properties to track whether content protection
(ex: hdcp) is desired by userspace. There are two properties involved,
"Content Protection" and "Content Protection KSV".

The "Content Protection" property allows userspace to request protection
on a connector. Set "Desired" to enable, "Undesired" to disable.

The "Content Protection KSV" property reflects the current state of
protection. If the KSV is 0, the connection is not protected. Once the
driver has enabled protection, it will update the the value with the KSV
(or similarly unique identifier, if not using HDCP) of the first-hop
device (sink or repeater).

(am from https://patchwork.kernel.org/patch/5439871/)

BUG=chrome-os-partner:56883
TEST=Tested on kevin, ensured the sysfs file showed up, and
     reflected the correct

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/403973
Reviewed-by: Sean Paul <seanpaul@google.com>

Change-Id: I6bef13729f77de6e37d2da5e12fc69f810a2e286
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Elaine Zhang
eb3075d48d clk: rockchip: rk3399: fix up some regs description error
Change-Id: Ia992b20f13ba7037b93fcd2fbd67a4d6b3fd1266
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-10 11:35:18 +08:00
Elaine Zhang
29c4d612eb clk: rockchip: add clock controller for rk1808
Add the clock tree definition for the new rk1808 SoC.

Change-Id: I86e502b27e0695c77e9937dfd7cffa14b5711954
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-09 09:55:57 +08:00
Elaine Zhang
5112405119 regulator: rk816: support rk816 ES2 chip
Change-Id: Ib9a17be35c5b21b0a8f4b4704b07ca316f02c69c
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-08 18:21:46 +08:00
Elaine Zhang
ce94c78340 clk: rockchip: add dt-binding header for rk1808
Add the dt-bindings header for the rk1808, that gets shared between
the clock controller and the clock references in the dts.
Add softreset ID for rk1808.

Change-Id: I0eef08655037daeab92560f36e06fde4032ddd0c
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-03 11:08:06 +08:00
Tao Huang
40aa66fc68 Merge tag 'lsk-v4.4-18.07-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
LSK 18.07 v4.4-android

* tag 'lsk-v4.4-18.07-android': (254 commits)
  Linux 4.4.143
  net/nfc: Avoid stalls when nfc_alloc_send_skb() returned NULL.
  rds: avoid unenecessary cong_update in loop transport
  KEYS: DNS: fix parsing multiple options
  netfilter: ebtables: reject non-bridge targets
  MIPS: Use async IPIs for arch_trigger_cpumask_backtrace()
  MIPS: Call dump_stack() from show_regs()
  rtlwifi: rtl8821ae: fix firmware is not ready to run
  net: cxgb3_main: fix potential Spectre v1
  net/mlx5: Fix command interface race in polling mode
  net_sched: blackhole: tell upper qdisc about dropped packets
  vhost_net: validate sock before trying to put its fd
  tcp: prevent bogus FRTO undos with non-SACK flows
  tcp: fix Fast Open key endianness
  r8152: napi hangup fix after disconnect
  qed: Limit msix vectors in kdump kernel to the minimum required count.
  net: sungem: fix rx checksum support
  net/mlx5: Fix incorrect raw command length parsing
  net: dccp: switch rx_tstamp_last_feedback to monotonic clock
  net: dccp: avoid crash in ccid3_hc_rx_send_feedback()
  ...

Fix wrong merge of include/linux/compiler-gcc.h

Change-Id: I1daae1251069d2791d2e29b65942d086fb8ad0ac
2018-08-03 10:09:13 +08:00
Finley Xiao
83c3c4ffee clk: rockchip: px30: Add div50 clocks for sdmmc, emmc, sdio and nandc
Change-Id: I45d06b01b05afbe14a4a8b86e7abec7a6f25e267
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-07-31 15:48:45 +08:00
Yao Xiao
b4f51792fa mmc: core: export retune_enable/disable api for wifi drivers
Change-Id: I084e155ed71057fa7f39e160a4f3fde964557185
Signed-off-by: Yao Xiao <xiaoyao@rock-chips.com>
2018-07-31 15:45:25 +08:00
xiaoyao
b906edb495 net: wifi: clk: rk3308: Add external clock instead of crystal vibration
Change-Id: Iadc3c1976fe09060308cca9bde11f4fab5fd47e2
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
2018-07-27 17:20:38 +08:00
huweiguo
22099e51c7 net: wireless: rockchip_wlan: support ssv6051 wifi
Change-Id: I936a05f2c2b6b29298f1a1eb945ec3a2fedc5262
Signed-off-by: huweiguo <hwg@rock-chips.com>
2018-07-25 18:17:45 +08:00
Hu Kejun
9e93e6ba45 camera: rockchip: merge modification of rv1108 isp11
camera: rockchip: add sensor ioctl and max gain.
1. add RK_VIDIOC_SENSOR_CONFIGINFO;
2. add RK_VIDIOC_SENSOR_REG_ACCESS;
3. add max_exp_gain_h/max_exp_gain_l;

camera: rockchip: merge isp11: rockchip: v0.1.7
isp11: rockchip: v0.1.7
1. Direct config isp lsc table size in cifisp_lsc_config.
   Because active_lsc_width is not same with isp register
   after isp reset.
2. Support separate config sensor gain and shutter time
   for some sensor which gain and shutter isn't valid at
   the same time. for example ov2710.
   ov4689:v0.1.0;
   ov2710:v0.1.1;
   imx323:v0.1.0;

camera: rockchip: Support v4l2 subdev api
ov2710: v0.1.2
ov4689: v0.1.1
imx323: v0.1.2

camera: rockchip: add lock for stream/aec
hold reg in AEC will affect stream reg, if asynchronous.

camera: rockchip: fix sensor timing
if fps changed, vts changed, update to timing.

camera: rockchip: support set flip api

camera: rockchip: support get flip api

camera: rockchip: fix release bug
should be free pdata at the end

camera: rockchip: imx323
fix s_fmt failed for imx323 v0.1.2;

camera: rockchip: fix s_frame_interval failed

fix s_frame_interval failed when frame interval is match
active config frame interval.

camera: rockchip: imx,aptina,ov
Check xxx_camera_module_init return value in PLTFRM_CIFCAM_ATTACH

camera: rockchip: release sensor if init fail

camera: rockchip: imx,aptina,ov
support mirror/flip conifg in dts for imx323/ov4689

camera: rockchip: add s_frame_interval/g_frame_interval
camera: rockchip: ov, aptina, imx
add s_frame_interval/g_frame_interval

camera: rockchip: imx,ov,aptina
1.imx,ov: fix g_timing error if s_frame_interval before stream_on,
  because vts_cur is update in stream_on;
2.aptina: fix compile error;

camera: rockchip: imx,ov,aptina
1. fix calc vts wrong in xxx_camera_module_s_stream

Change-Id: I5a6e75f2ce3c50d69c51af9792232c60b6982128
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-25 14:52:52 +08:00
Hu Kejun
6ffc8e398a media: rk-isp10: update to v0.1.f
fix MI_CTRL and MI_XTD_FORMAT_CTRL register is not correct
merge isp11: rockchip: v0.2.4 and isp11: rockchip: v0.2.5
merge isp11: Support Y8 for AEC
merge isp11: rockchip: v0.2.7
merge isp11: rockchip: v0.2.9 & v0.2.8
merge isp11: print version
merge isp11: rockchip: v0.2.b
merge isp11: rockchip: v0.2.c
merge isp11: rockchip: v0.3.2
merge isp11: rockchip: v0.3.4
merge isp11: rockchip: modify for debugfs
merge isp11: rockchip: v0.1.7
merge isp11: rockchip: v0.1.8
merge isp11: rockchip: v0.1.9
merge isp11: rockchip: v0.1.d
merge isp11: send afm meas data alone

Change-Id: I00c9181849addf5dd44c0deea2bb39ac02ff999d
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-25 14:52:52 +08:00
Eddie Cai
109d953e7c UPSTREAM: clk: rockchip: add ids for camera on rk3399
we use SCLK_TESTCLKOUT1 and SCLK_TESTCLKOUT2 for camera, so add those ids.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit f22e4359cd)

Change-Id: Ibbdb8e9dabd8c955ef3745c0f49c20f4c763e870
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:46:35 +08:00
Yakir Yang
c39ba9451b UPSTREAM: clk: rockchip: add dclk_vop_frac ids for rk3399 vop
Export the dclk_vop_frac out, so we can set the dclk_vop as the
child of dclk_vop_frac, and then we can start to take use of
the fractional dividers.

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit e33075db73)

Change-Id: I3d47c6aecc338de45b48414f0d0327c17e6d2b15
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:43:59 +08:00
Hu Kejun
51bbf5c3aa camera: rockchip: Add VTS when setting exposure
Change-Id: Ia06631238bd99d8736ccfed9cb98e3f8fcb319d8
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-24 15:24:18 +08:00
Mark Brown
a9c613d774 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-07-23 16:49:59 +01:00
Mark Brown
1c6a1d5ae6 Merge tag 'v4.4.143' into linux-linaro-lsk-v4.4
This is the 4.4.143 stable release
2018-07-23 12:34:46 +01:00
Nick Desaulniers
bdb0a55ef6 compiler-gcc.h: Add __attribute__((gnu_inline)) to all inline declarations
commit d03db2bc26 upstream.

Functions marked extern inline do not emit an externally visible
function when the gnu89 C standard is used. Some KBUILD Makefiles
overwrite KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without
an explicit C standard specified, the default is gnu11. Since c99, the
semantics of extern inline have changed such that an externally visible
function is always emitted. This can lead to multiple definition errors
of extern inline functions at link time of compilation units whose build
files have removed an explicit C standard compiler flag for users of GCC
5.1+ or Clang.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: H. Peter Anvin <hpa@zytor.com>
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: acme@redhat.com
Cc: akataria@vmware.com
Cc: akpm@linux-foundation.org
Cc: andrea.parri@amarulasolutions.com
Cc: ard.biesheuvel@linaro.org
Cc: aryabinin@virtuozzo.com
Cc: astrachan@google.com
Cc: boris.ostrovsky@oracle.com
Cc: brijesh.singh@amd.com
Cc: caoj.fnst@cn.fujitsu.com
Cc: geert@linux-m68k.org
Cc: ghackmann@google.com
Cc: gregkh@linuxfoundation.org
Cc: jan.kiszka@siemens.com
Cc: jarkko.sakkinen@linux.intel.com
Cc: jpoimboe@redhat.com
Cc: keescook@google.com
Cc: kirill.shutemov@linux.intel.com
Cc: kstewart@linuxfoundation.org
Cc: linux-efi@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org
Cc: manojgupta@google.com
Cc: mawilcox@microsoft.com
Cc: michal.lkml@markovi.net
Cc: mjg59@google.com
Cc: mka@chromium.org
Cc: pombredanne@nexb.com
Cc: rientjes@google.com
Cc: rostedt@goodmis.org
Cc: sedat.dilek@gmail.com
Cc: thomas.lendacky@amd.com
Cc: tstellar@redhat.com
Cc: tweek@google.com
Cc: virtualization@lists.linux-foundation.org
Cc: will.deacon@arm.com
Cc: yamada.masahiro@socionext.com
Link: http://lkml.kernel.org/r/20180621162324.36656-2-ndesaulniers@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-22 14:25:51 +02:00
David Rientjes
a2da6af8b5 compiler, clang: always inline when CONFIG_OPTIMIZE_INLINING is disabled
commit 9a04dbcfb3 upstream.

The motivation for commit abb2ea7dfd ("compiler, clang: suppress
warning for unused static inline functions") was to suppress clang's
warnings about unused static inline functions.

For configs without CONFIG_OPTIMIZE_INLINING enabled, such as any non-x86
architecture, `inline' in the kernel implies that
__attribute__((always_inline)) is used.

Some code depends on that behavior, see
  https://lkml.org/lkml/2017/6/13/918:

  net/built-in.o: In function `__xchg_mb':
  arch/arm64/include/asm/cmpxchg.h:99: undefined reference to `__compiletime_assert_99'
  arch/arm64/include/asm/cmpxchg.h:99: undefined reference to `__compiletime_assert_99

The full fix would be to identify these breakages and annotate the
functions with __always_inline instead of `inline'.  But since we are
late in the 4.12-rc cycle, simply carry forward the forced inlining
behavior and work toward moving arm64, and other architectures, toward
CONFIG_OPTIMIZE_INLINING behavior.

Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1706261552200.1075@chino.kir.corp.google.com
Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Sodagudi Prasad <psodagud@codeaurora.org>
Tested-by: Sodagudi Prasad <psodagud@codeaurora.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
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>
2018-07-22 14:25:51 +02:00
Linus Torvalds
9acb660005 compiler, clang: properly override 'inline' for clang
commit 6d53cefb18 upstream.

Commit abb2ea7dfd ("compiler, clang: suppress warning for unused
static inline functions") just caused more warnings due to re-defining
the 'inline' macro.

So undef it before re-defining it, and also add the 'notrace' attribute
like the gcc version that this is overriding does.

Maybe this makes clang happier.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-22 14:25:51 +02:00
David Rientjes
f3af03e9c7 compiler, clang: suppress warning for unused static inline functions
commit abb2ea7dfd upstream.

GCC explicitly does not warn for unused static inline functions for
-Wunused-function.  The manual states:

	Warn whenever a static function is declared but not defined or
	a non-inline static function is unused.

Clang does warn for static inline functions that are unused.

It turns out that suppressing the warnings avoids potentially complex
#ifdef directives, which also reduces LOC.

Suppress the warning for clang.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-22 14:25:51 +02:00
Sultan Alsawaf
5b49d48e61 ANDROID: Fix massive cpufreq_times memory leaks
Every time _cpu_up() is called for a CPU, idle_thread_get() is called
which then re-initializes a CPU's idle thread that was already
previously created and cached in a global variable in
smpboot.c. idle_thread_get() calls init_idle() which then calls
__sched_fork(). __sched_fork() is where cpufreq_task_times_init() is,
and cpufreq_task_times_init() allocates memory for the task struct's
time_in_state array.

Since idle_thread_get() reuses a task struct instance that was already
previously created, this means that every time it calls init_idle(),
cpufreq_task_times_init() allocates this array again and overwrites
the existing allocation that the idle thread already had.

This causes memory to be leaked every time a CPU is onlined. In order
to fix this, move allocation of time_in_state into _do_fork to avoid
allocating it at all for idle threads. The cpufreq times interface is
intended to be used for tracking userspace tasks, so we can safely
remove it from the kernel's idle threads without killing any
functionality.

But that's not all!

Task structs can be freed outside of release_task(), which creates
another memory leak because a task struct can be freed without having
its cpufreq times allocation freed. To fix this, free the cpufreq
times allocation at the same time that task struct allocations are
freed, in free_task().

Since free_task() can also be called in error paths of copy_process()
after dup_task_struct(), set time_in_state to NULL immediately after
calling dup_task_struct() to avoid possible double free.

Bug description and fix adapted from patch submitted by
Sultan Alsawaf <sultanxda@gmail.com> at
https://android-review.googlesource.com/c/kernel/msm/+/700134

Bug: 110044919
Test: Hikey960 builds, boots & reports /proc/<pid>/time_in_state
correctly
Change-Id: I12fe7611fc88eb7f6c39f8f7629ad27b6ec4722c
Signed-off-by: Connor O'Brien <connoro@google.com>
2018-07-19 22:03:01 +05:30
Connor O'Brien
767090a2c8 ANDROID: Reduce use of #ifdef CONFIG_CPU_FREQ_TIMES
Add empty versions of functions to cpufreq_times.h to cut down on use
of #ifdef in .c files.

Test: kernel builds with and without CONFIG_CPU_FREQ_TIMES=y
Change-Id: I49ac364fac3d42bba0ca1801e23b15081094fb12
Signed-off-by: Connor O'Brien <connoro@google.com>
2018-07-19 22:02:51 +05:30
Hu Kejun
bb7bcb0a02 media: rk-isp10: modify for af function
add af funtion first time

Change-Id: I91fc8c532e47987cc63694b242f5bac7ef1bc59c
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-19 14:44:39 +08:00
Mark Brown
408ef7d17b Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-07-18 13:38:21 +01:00
Mark Brown
1d7b931a1b Merge tag 'v4.4.141' into linux-linaro-lsk-v4.4
This is the 4.4.141 stable release
2018-07-18 13:38:10 +01:00
Tao Huang
d20c557078 Input: rmi4 - remove unused synaptics s3202 driver
Change-Id: If377d7af56ad443a905947a585ff826b6c1625b2
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-07-18 19:23:06 +08:00
Hans de Goede
54b594369a ahci: Disable LPM on Lenovo 50 series laptops with a too old BIOS
commit 240630e618 upstream.

There have been several reports of LPM related hard freezes about once
a day on multiple Lenovo 50 series models. Strange enough these reports
where not disk model specific as LPM issues usually are and some users
with the exact same disk + laptop where seeing them while other users
where not seeing these issues.

It turns out that enabling LPM triggers a firmware bug somewhere, which
has been fixed in later BIOS versions.

This commit adds a new ahci_broken_lpm() function and a new ATA_FLAG_NO_LPM
for dealing with this.

The ahci_broken_lpm() function contains DMI match info for the 4 models
which are known to be affected by this and the DMI BIOS date field for
known good BIOS versions. If the BIOS date is older then the one in the
table LPM will be disabled and a warning will be printed.

Note the BIOS dates are for known good versions, some older versions may
work too, but we don't know for sure, the table is using dates from BIOS
versions for which users have confirmed that upgrading to that version
makes the problem go away.

Unfortunately I've been unable to get hold of the reporter who reported
that BIOS version 2.35 fixed the problems on the W541 for him. I've been
able to verify the DMI_SYS_VENDOR and DMI_PRODUCT_VERSION from an older
dmidecode, but I don't know the exact BIOS date as reported in the DMI.
Lenovo keeps a changelog with dates in their release notes, but the
dates there are the release dates not the build dates which are in DMI.
So I've chosen to set the date to which we compare to one day past the
release date of the 2.34 BIOS. I plan to fix this with a follow up
commit once I've the necessary info.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-17 11:31:43 +02:00
Finley Xiao
0c406a7db0 soc: rockchip: opp_select: Limit minimum voltage when low temperature
Change-Id: I4d4dd9d8a1130a11b6364479c24c1bb452045c23
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-07-13 16:25:59 +08:00
Dingqiang Lin
df522a9f3d soc: rockchip: fix flash vendor structure error
Change-Id: Id589fb607b233929d07d7ccc3f5b3d11dc92eb0c
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-07-10 16:38:48 +08:00
Gaurav Kohli
020a3b1024 UPSTREAM: tty: fix data race between tty_init_dev and flush of buf
There can be a race, if receive_buf call comes before
tty initialization completes in n_tty_open and tty->disc_data
may be NULL.

CPU0					CPU1
----					----
 000|n_tty_receive_buf_common()   	n_tty_open()
-001|n_tty_receive_buf2()		tty_ldisc_open.isra.3()
-002|tty_ldisc_receive_buf(inline)	tty_ldisc_setup()

Using ldisc semaphore lock in tty_init_dev till disc_data
initializes completely.

Reviewed-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@vger.kernel.org>

Change-Id: I3ba3cbd7dcb867a110878c8d0c47e6b920edd0b9
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gaurav Kohli <gkohli@codeaurora.org>
(cherry-picked from commit b027e2298b)
2018-07-10 14:46:01 +08:00
Tao Huang
0d946db93a Merge tag 'lsk-v4.4-18.06-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
LSK 18.06 v4.4-android

* tag 'lsk-v4.4-18.06-android': (464 commits)
  Linux 4.4.138
  crypto: vmx - Remove overly verbose printk from AES init routines
  Input: elan_i2c - add ELAN0612 (Lenovo v330 14IKB) ACPI ID
  Input: goodix - add new ACPI id for GPD Win 2 touch screen
  kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access
  vmw_balloon: fixing double free when batching mode is off
  serial: samsung: fix maxburst parameter for DMA transactions
  KVM: x86: pass kvm_vcpu to kvm_read_guest_virt and kvm_write_guest_virt_system
  KVM: x86: introduce linear_{read,write}_system
  Clarify (and fix) MAX_LFS_FILESIZE macros
  gpio: No NULL owner
  x86/crypto, x86/fpu: Remove X86_FEATURE_EAGER_FPU #ifdef from the crc32c code
  af_key: Always verify length of provided sadb_key
  x86/fpu: Fix math emulation in eager fpu mode
  x86/fpu: Fix FNSAVE usage in eagerfpu mode
  x86/fpu: Hard-disable lazy FPU mode
  x86/fpu: Fix eager-FPU handling on legacy FPU machines
  x86/fpu: Revert ("x86/fpu: Disable AVX when eagerfpu is off")
  x86/fpu: Fix 'no387' regression
  x86/fpu: Default eagerfpu=on on all CPUs
  ...

Conflicts:
	drivers/clk/clk.c
	drivers/clk/rockchip/clk-mmc-phase.c
	sound/core/timer.c

Change-Id: I52af7906676f3e4426292481ec36a9a63ee7ecc9
2018-07-06 20:12:54 +08:00
Finley Xiao
bf4d561a65 soc: rockchip: opp_select: Implement APIs for wide-temperature control
Add a basic wide-temperature control model for device to adjust opp
table and max frequency.

Change-Id: I23f29ac1892093c527e730164eba086f02667de3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-07-06 19:38:51 +08:00
Finley Xiao
60b250f9b6 thermal: Add thermal_notifier_list for thermal zone
Change-Id: I92c3308a4582ec3dbc03d2d6f2bbda60efe7245a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-07-06 19:36:38 +08:00
Sandy Huang
8304527e67 drm/rockchip: add support mcu init screen
the mcu init cmd should be sent from crtc mcu interface,
so we add the rockchip_drm_crtc_send_mcu_cmd to do this.

Change-Id: I7fedfb90c6074e8837a825d10e0dcd9c16bfc1d0
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-07-06 15:56:04 +08:00
Finley Xiao
e7040c8dd6 cpufreq: rockchip: implement rockchip_cpufreq_check_rate_volt()
Change-Id: I707c88d217725e66119aa28e8823ce68ac3abfba
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-07-06 10:22:04 +08:00
Finley Xiao
87c0821959 PM / OPP: Rename dev_pm_opp_check_initial_rate to dev_pm_opp_check_rate_volt
Make the function more general.

Change-Id: Ic10b84ddb6b7eff33e1a1fe491f05f10a9c6015a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-07-06 10:21:14 +08:00
Guennadi Liakhovetski
87f4981ad5 UPSTREAM: media: uvcvideo: Add a metadata device node
Some UVC video cameras contain metadata in their payload headers. This
patch extracts that data, adding more clock synchronisation information,
on both bulk and isochronous endpoints and makes it available to the user
space on a separate video node, using the V4L2_CAP_META_CAPTURE capability
and the V4L2_BUF_TYPE_META_CAPTURE buffer queue type. By default, only the
V4L2_META_FMT_UVC pixel format is available from those nodes. However,
cameras can be added to the device ID table to additionally specify their
own metadata format, in which case that format will also become available
from the metadata node.

[Use put_unaligned instead of __put_unaligned_cpu64]
[Use put_unaligned for the sof field as well]

Conflicts:
	drivers/media/usb/uvc/uvc_queue.c
	drivers/media/usb/uvc/uvc_video.c

Change-Id: I2696d2c781376e363e0a77d8d895f416aaff09cb
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 088ead2552)
2018-07-05 18:27:41 +08:00
Guennadi Liakhovetski
8df73b298c UPSTREAM: media: v4l: Add a UVC Metadata format
Add a pixel format, used by the UVC driver to stream metadata.

Conflicts:
        Documentation/media/uapi/v4l/meta-formats.rst
        drivers/media/v4l2-core/v4l2-ioctl.c
        include/uapi/linux/videodev2.h

Change-Id: I979fd6b4d5d24510e47a1cfe525e8ae0a1a573ee
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 563a01e101)
2018-07-05 18:27:39 +08:00
Mark Brown
7a3f6e8d20 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2018-07-05 11:05:40 +01:00
Mark Brown
e96c555007 Merge tag 'v4.4.139' into linux-linaro-lsk-v4.4
This is the 4.4.139 stable release
2018-07-05 11:04:44 +01:00