firefly-linux-kernel-4.4.55.git
8 years agoInput: gslx680 - enable macro define RK_GEAR_TOUCH
jerry.zhang [Tue, 2 Aug 2016 05:58:06 +0000 (13:58 +0800)]
Input: gslx680 - enable macro define RK_GEAR_TOUCH

Change-Id: Ie0cb0ccd645cbecf74b3d0d85d80d4537bae75cd
Signed-off-by: jerry.zhang <jerry.zhang@rock-chips.com>
8 years agoarm64: dts: rockchip: modify sd minimum frequency for rk3399-box
xiaoyao [Tue, 2 Aug 2016 10:13:02 +0000 (18:13 +0800)]
arm64: dts: rockchip: modify sd minimum frequency for rk3399-box

The host can issue continuous clock in the frequency range
of 100KHz-400KHz for card identification mode.

Change-Id: I4e6a96a5ec49ee102a3b24c3f7f9b74d6bc8fd5f
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
8 years agoARM64: dts: rk3399-vr: fix eas parameters for vr board with ES2
Jianqun Xu [Wed, 3 Aug 2016 04:11:07 +0000 (12:11 +0800)]
ARM64: dts: rk3399-vr: fix eas parameters for vr board with ES2

Change-Id: I8c1834e8515cc6387c68f1b3f8e370a5a1073aab
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agousb: dwc3: core: support DRD mode switch with extcon notifier
Wu Liang feng [Thu, 14 Jul 2016 02:32:19 +0000 (10:32 +0800)]
usb: dwc3: core: support DRD mode switch with extcon notifier

This patch register extcon notification for DRD mode.
If extcon cable state is EXTCON_USB, means that an USB
peripheral cable connected, and we need to set DWC3 work
in device mode. If extcon cable state is EXTCON_USB_HOST,
means that an USB host cable connected, and we need to
set DWC3 work in host mode.

And we need to register different notifier block for
EXTCON_USB notifier and EXTCON_USB_HOST notifier,because
if multiple notifiers registered with the same notifier
block, it will cause kernel crash on notification events.

Change-Id: Ia09e5088f738496b87d06b0f4062c144fa781e4e
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agodrm/rockchip: dsi: fix mipi display can't found at init time
Mark Yao [Mon, 1 Aug 2016 09:54:53 +0000 (17:54 +0800)]
drm/rockchip: dsi: fix mipi display can't found at init time

The problem is that:
  mipi panel probe request mipi_dsi_host_register.
  mipi host attach is call from panel device, so the defer function
always can't works.

So at the first bind time, always can't found mipi panel.

Change-Id: Ic95eeb4876896ea93860d8baaae074f50f078c62
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: support add fb from dev resource
Mark Yao [Mon, 1 Aug 2016 09:34:23 +0000 (17:34 +0800)]
drm/rockchip: support add fb from dev resource

Change-Id: I980af965d83de25c433ba5424bab2ad063534bcb
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: vop: enable iommu when we actually need it
Mark Yao [Tue, 2 Aug 2016 09:25:42 +0000 (17:25 +0800)]
drm/rockchip: vop: enable iommu when we actually need it

Change-Id: If22525a251b17a64c9e549b1aff93e4851de4080
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: find connector by device node
Mark Yao [Mon, 1 Aug 2016 09:03:17 +0000 (17:03 +0800)]
drm/rockchip: find connector by device node

Change-Id: I3851e296669c5c67ada47b472a3f7294ca25c796
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoarm64: dts: rk3399: use timing from dts
Mark Yao [Thu, 7 Jul 2016 08:28:42 +0000 (16:28 +0800)]
arm64: dts: rk3399: use timing from dts

Change-Id: I336af668ebc917388af47146400e6d5e3d94c2e0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoARM64: dts: rk3399-box: adjust gpu opp table
Hans Yang [Tue, 2 Aug 2016 06:48:51 +0000 (14:48 +0800)]
ARM64: dts: rk3399-box: adjust gpu opp table

Adjust voltage of 500M to 0.9v

Change-Id: I21ac14f27cc7aaddfea6280e76decc28c8b1182a
Signed-off-by: Hans Yang <yhx@rock-chips.com>
8 years agosensor: add accel&gyro sensor driver for lsm330
Bin Yang [Tue, 2 Aug 2016 02:17:08 +0000 (10:17 +0800)]
sensor: add accel&gyro sensor driver for lsm330

Change-Id: Ibb0b6fe769774abc1a0f619eb9c626340e8b8bcc
Signed-off-by: Bin Yang <yangbin@rock-chips.com>
8 years agoUPSTREAM: extcon: Block the bit masking operation for cable state except for extcon...
Chanwoo Choi [Thu, 30 Jun 2016 17:41:18 +0000 (02:41 +0900)]
UPSTREAM: extcon: Block the bit masking operation for cable state except for extcon core

This patch restrict the usage of extcon_update_state() in the extcon
core because the extcon_update_state() use the bit masking to change
the state of external connector. When this function is used in device drivers,
it may occur the probelm with the handling mistake of bit masking.

Also, this patch removes the extcon_get/set_state() functions because these
functions use the bit masking which is reluctant way. Instead, extcon
provides the extcon_set/get_cable_state_() functions.

Change-Id: I436b8d4f9485bb318e7d77db8902f85e2bc15778
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit c2692f2dad4f3228579bb0b2cf2d6d9bf283f31a)

8 years agoUPSTREAM: extcon: adc-jack: Remove the usage of extcon_set_state()
Chanwoo Choi [Mon, 18 Jul 2016 07:16:29 +0000 (16:16 +0900)]
UPSTREAM: extcon: adc-jack: Remove the usage of extcon_set_state()

This patch removes the usage of extcon_set_state() because it uses the bit
masking to change the state of external connectors. The extcon framework
should handle the state by extcon_set/get_cable_state_() with extcon id.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
(cherry picked from commit 0ddde3db610d57d28c1fe9a61e32dff1dc55ea59
 git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-next)

Change-Id: I64d5ff0c054ca0bab9a59105bf5c395d998665ff
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoUPSTREAM: extcon: gpio: Remove the usage of extcon_set_state()
Chanwoo Choi [Thu, 21 Jul 2016 11:00:29 +0000 (20:00 +0900)]
UPSTREAM: extcon: gpio: Remove the usage of extcon_set_state()

This patch removes the usage of extcon_set_state() because it uses
the bit masking to change the state of external connectors. The extcon framework
should handle the state by extcon_set_cable_state_() with extcon id.

Change-Id: I726f690d900375d36001fe4eda9b53bcdd2b4f86
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 448991505c967d7b44ae9ea328224ec02858c8da)

8 years agoUPSTREAM: extcon: arizona: Remove the usage of extcon_update_state()
Chanwoo Choi [Thu, 30 Jun 2016 17:36:49 +0000 (02:36 +0900)]
UPSTREAM: extcon: arizona: Remove the usage of extcon_update_state()

This patch remvoes the usage of extcon_update_state() because
the extcon_update_state() use directly the bit masking calculation
to change the state of external connector without the unique id of
external connector. It makes the code diffcult to read it.
So, this patch uses the extcon_set_cable_state_() instead.

Change-Id: I807cce6c46e37b32d5fbdbf65c45d1ddf6587996
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit af67ea70da0e8e906a81ae00d742c82ecda63a27)

8 years agoUPSTREAM: extcon: arizona: Remove unneeded semi-colon
Charles Keepax [Tue, 19 Jul 2016 12:23:56 +0000 (13:23 +0100)]
UPSTREAM: extcon: arizona: Remove unneeded semi-colon

There is no need for a semi-colon at the end of a switch statement so
remove it.

Change-Id: I64a6f485bcb1b064d17cea5f56f22f8b3773bf75
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit fa1723bb3461f42b3c35eeb313f7021d089da5f1)

8 years agoUPSTREAM: extcon: Fix the wrong description about extcon_set/get_cable_state_()
Chanwoo Choi [Mon, 27 Jun 2016 12:09:04 +0000 (21:09 +0900)]
UPSTREAM: extcon: Fix the wrong description about extcon_set/get_cable_state_()

This patch fixes the wrong description about extcon_set/get_cable_state_()
because they use the unique id of external connector instead of legacy name.

Change-Id: I954d0905c966b5128e9de577db9633f6b4b398bb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit bc92126012c8c84988eebbbf9c8a246949b07462)

8 years agoUPSTREAM: extcon: Remove the state_store() to prevent the wrong access
Chanwoo Choi [Mon, 18 Jul 2016 06:39:28 +0000 (15:39 +0900)]
UPSTREAM: extcon: Remove the state_store() to prevent the wrong access

This patch removes the state_store() which change the state of external
connectors with bit masking on user-space. It is wrong access to modify
the change the state of external connectors.

Change-Id: I635e30e2a22ddc313ed90dc7ab0f7fdaa271ed1d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit eeb820116207aa5dd71edbc0b8f0eaf3b20d77a1)

8 years agoUPSTREAM: extcon: Move extcon_get_edev_by_phandle() errors to dbg level
Stephen Boyd [Tue, 5 Jul 2016 18:57:05 +0000 (11:57 -0700)]
UPSTREAM: extcon: Move extcon_get_edev_by_phandle() errors to dbg level

Sometimes drivers may call this API and expect it to fail because
the extcon they're looking for is optional. Let's move these
prints to debug level so it doesn't look like there's a problem
when there isn't one.

Change-Id: Id3297af428cbaaef208e1990e1678b9ef04a7246
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 27210e4efd5259c691c4c3ab53e74239efa0d581)

8 years agoUPSTREAM: extcon: add missing of_node_put after calling of_parse_phandle
Peter Chen [Fri, 1 Jul 2016 09:41:55 +0000 (18:41 +0900)]
UPSTREAM: extcon: add missing of_node_put after calling of_parse_phandle

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Change-Id: I96ad96b55e6f6c5e5335d12aeb5963c1b06451b3
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 5d5c4c139dd766dff903ba35d72fb3ec90022e91)

8 years agoUPSTREAM: extcon: link devres into core module
Arnd Bergmann [Wed, 29 Jun 2016 14:38:30 +0000 (16:38 +0200)]
UPSTREAM: extcon: link devres into core module

Splitting the resource-managed functions into a separate module
means that the extcon core now fails to build because the internal
"extcon_dev_allocate" symbol is not exported:

ERROR: extcon_dev_allocate [drivers/extcon/devres.ko] undefined!

My guess is that the intention was not to have two separate
modules (which could be fixed by adding an export, plus the
normal MODULE_AUTHOR/MODULE_LICENSE/... fields), but have two
source files in the same module.

This fixes the Makefile accordingly, making the name of the
module extcon_core.ko, which is created from building both
extcon.c and devres.c.

Fixes: b225d00f3ad2 ("extcon: Split out the resource-managed functions from extcon core")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
(cherry picked from commit af61f96109b73fefbe0589c320d2219567f4f660
  git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-next)

Change-Id: I8a319f46437cd3d6ce98a4f6ac5d1c56930c9c76
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoUPSTREAM: extcon: Add resource-managed functions to register extcon notifier
Chanwoo Choi [Mon, 27 Jun 2016 11:03:39 +0000 (20:03 +0900)]
UPSTREAM: extcon: Add resource-managed functions to register extcon notifier

This patch adds the resource-managed functions for register/unregister
the extcon notifier with the id of each external connector. This function
will make it easy to handle the extcon notifier.

- int devm_extcon_register_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb);
- void devm_extcon_unregister_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb);

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
(cherry picked from commit 58f386560a68dd98bd6744a28fc853eef11faebe
  git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-next)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Change-Id: I852184d12dc4a03b6d526112e998b087931726e5
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoUPSTREAM: extcon: Split out the resource-managed functions from extcon core
Chanwoo Choi [Mon, 27 Jun 2016 10:28:04 +0000 (19:28 +0900)]
UPSTREAM: extcon: Split out the resource-managed functions from extcon core

This patch split out the resource-managed related functions
from extcon core driver.

Change-Id: I4dd6cff278849c754bd529f44c3489d8bc665b15
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit b225d00f3ad2d996f914790a0f6324a4efd18768)

8 years agoUPSTREAM: extcon: Move struct extcon_cable from header file to core
Chanwoo Choi [Mon, 27 Jun 2016 10:17:06 +0000 (19:17 +0900)]
UPSTREAM: extcon: Move struct extcon_cable from header file to core

This patch moves the struct extcon_cable because that should
be only handled by extcon core. There are no reason to publish
the internal structure.

Change-Id: I7b2e68487ad0ddfa8a2342e7754f16af8623aa58
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 20f7b53dfc24e0caa984087691af82e442229680)

8 years agoUPSTREAM: extcon: Check for incorrect connection type in notifier register
Stephen Boyd [Thu, 23 Jun 2016 10:34:30 +0000 (19:34 +0900)]
UPSTREAM: extcon: Check for incorrect connection type in notifier register

If we call extcon_register_notifier() with the wrong cable type,
it blows up with an oops instead of returning an error code.
Let's be nice and fail gracefully given that the consumer might
not know if the cable is supported by the extcon provider.

Change-Id: I6e357a6af600dac82e9b1c30499b2d0a3d58d716
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit a05f44c89ee1151b0da3ddd43d9e57d8f15b2f20)

8 years agoUPSTREAM: extcon: Remove the deprecated extcon functions
Chanwoo Choi [Tue, 31 May 2016 08:32:30 +0000 (17:32 +0900)]
UPSTREAM: extcon: Remove the deprecated extcon functions

This patch removes the deprecated extcon functions using string type
to identify the type of external connector. The Commit 2a9de9c0f08d61
("extcon: Use the unique id for external connector instead of string)
uses the unique id to separate the type of external connector instead of
string name.
- extcon_register_interest()
- extcon_unregister_interest()
- extcon_set_cable_state()
- extcon_get_cable_state()

And, extcon_register_interest() finds the first extcon device to include the
requested external connector from extcon client device and then register the
notifier if extcon device argument is NULL. Instead, extcon_register_notifier()
supports this feature.

But, this patch remains the deprecatd function definition to prevent
the build break.

Change-Id: I8238aa91a6da91fe66cb6c182602bc3bcc8688ae
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 830ae442202e314c2bdf7cb4c7cc64d76db0e197)

8 years agovideo: rockchip: edp: rk3399: add power domain control
Xubilv [Fri, 29 Jul 2016 10:15:51 +0000 (18:15 +0800)]
video: rockchip: edp: rk3399: add power domain control

Change-Id: I08a57e15bd182e3c4bcf87c383f55c21535a6acc
Signed-off-by: Xubilv <xbl@rock-chips.com>
8 years agoarm64: dts: rk3399-vr: ajust gpu opp table
wlq [Mon, 1 Aug 2016 01:38:12 +0000 (09:38 +0800)]
arm64: dts: rk3399-vr: ajust gpu opp table

ajust gpu voltage for stability

Change-Id: I1927bbe7990d6a9c9c712b53f1d5bf16b6102bb5
Signed-off-by: Liangqing Wu <wlq@rock-chips.com>
8 years agoARM: configs: remove DEBUG_LL relate configures from rockchip_linux_defconfig
Yakir Yang [Mon, 1 Aug 2016 10:10:28 +0000 (18:10 +0800)]
ARM: configs: remove DEBUG_LL relate configures from rockchip_linux_defconfig

If we enable the kernel low-level debugging port option, then we must
assign the right UART types and PHYS address for it. But different
CPUs must have different UART configures, we can't cover all of them
in this common configure file. For example:

* RK3036 would want to chose the UART types would be RK29_UART2, and
  UART_PHYS would be 0x20068000.

* RK3228 would want to chose the UART types would be RK29_UART2, and
  UART_PHYS would be 0x11030000.

* RK3288 would want to chose the UART types would be RK32_UART2, and
  UART_PHYS would be 0xff690000.

Change-Id: I70d0da1fbffbb720b5e464acd79405624d9e7d40
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agodrm/rockchip: dw-mipi: remove mode_valid
Chris Zhong [Tue, 2 Aug 2016 01:44:21 +0000 (09:44 +0800)]
drm/rockchip: dw-mipi: remove mode_valid

The MIPI DSI do not need check the validity of resolution, the max resolution
should depend VOP. So remove rk3288_mipi_dsi_mode_valid here.

Change-Id: I789d184f9a14010795fe595ef31e1bea5d1022e0
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoARM64: dts: rk3399: add support edp screen for evb3
Jianqun Xu [Mon, 1 Aug 2016 08:13:12 +0000 (16:13 +0800)]
ARM64: dts: rk3399: add support edp screen for evb3

Support for some evb3 with edp screen, and with new touchscreen.

Change-Id: I8624ae38faef63aa5205861cfebb2a04f7bb8b30
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Tested-by: Frank Wang <frank.wang@rock-chips.com>
8 years agodt-bindings: display: support drm_mipi_dsi macro
Mark Yao [Tue, 26 Jul 2016 03:25:21 +0000 (11:25 +0800)]
dt-bindings: display: support drm_mipi_dsi macro

Change-Id: Ibbe73605fff42762d88f2bc138ce98914ab200cc
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: get rid of vop->is_enabled
Mark Yao [Mon, 1 Aug 2016 06:32:32 +0000 (14:32 +0800)]
drm/rockchip: get rid of vop->is_enabled

With atomic helpers there's no need to track the enabled state of a pipe
any more, because atomic helpers track this accurately already.

Change-Id: Ic2441b5acefe327cdef797aca88f6a2098643c69
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoUPSTREAM: drm/rockchip: Disarm vop->is_enabled
Mark Yao [Tue, 2 Aug 2016 09:24:37 +0000 (17:24 +0800)]
UPSTREAM: drm/rockchip: Disarm vop->is_enabled

With atomic helpers there's no need to track the enabled state of a pipe
any more, because atomic helpers track this accurately already.

Just disable the early returns, since the debug checks might be useful.

v2: Don't call drm_helper_disable_unused_functions, it blows up
without this check. At least explains why rockchip still needed this
old legacy-style state tracing - to work around issues from calling
other legacy style functions!

Change-Id: Ib63ad83b0212c5e2b0a44c1c5e2d188e7c876107
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Mark yao <mark.yao@rock-chips.com>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-18-git-send-email-daniel.vetter@ffwll.ch
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoMALI: midgard: rockchip: add sysfs files to get GPU utilisation
chenzhen [Wed, 11 May 2016 10:18:04 +0000 (18:18 +0800)]
MALI: midgard: rockchip: add sysfs files to get GPU utilisation

Change-Id: I758369bdd9ef945a89fd87fd7a69bd9f391f0880
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoMerge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Mark Brown [Fri, 29 Jul 2016 20:38:37 +0000 (21:38 +0100)]
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android

8 years agoMerge tag 'v4.4.16' into linux-linaro-lsk-v4.4
Mark Brown [Fri, 29 Jul 2016 20:38:36 +0000 (21:38 +0100)]
Merge tag 'v4.4.16' into linux-linaro-lsk-v4.4

This is the 4.4.16 stable release

# gpg: Signature made Wed 27 Jul 2016 17:48:38 BST using RSA key ID 6092693E
# gpg: requesting key 6092693E from hkp server the.earth.li
# gpg: key 6092693E: public key "Greg Kroah-Hartman (Linux kernel stable release signing key) <greg@kroah.com>" imported
# gpg: public key of ultimately trusted key B4B0BED6 not found
# gpg: 2 marginal(s) needed, 1 complete(s) needed, PGP trust model
# gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
# gpg: Total number processed: 1
# gpg:               imported: 1  (RSA: 1)
# gpg: Good signature from "Greg Kroah-Hartman (Linux kernel stable release signing key) <greg@kroah.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 647F 2865 4894 E3BD 4571  99BE 38DB BDC8 6092 693E

8 years agoMerge remote-tracking branch 'lsk/v4.4/topic/mm-kaslr' into linux-linaro-lsk-v4.4
Mark Brown [Fri, 29 Jul 2016 20:33:51 +0000 (21:33 +0100)]
Merge remote-tracking branch 'lsk/v4.4/topic/mm-kaslr' into linux-linaro-lsk-v4.4

8 years agoarm64: kaslr: increase randomization granularity
Ard Biesheuvel [Mon, 18 Apr 2016 15:09:48 +0000 (17:09 +0200)]
arm64: kaslr: increase randomization granularity

Currently, our KASLR implementation randomizes the placement of the core
kernel at 2 MB granularity. This is based on the arm64 kernel boot
protocol, which mandates that the kernel is loaded TEXT_OFFSET bytes above
a 2 MB aligned base address. This requirement is a result of the fact that
the block size used by the early mapping code may be 2 MB at the most (for
a 4 KB granule kernel)

But we can do better than that: since a KASLR kernel needs to be relocated
in any case, we can tolerate a physical misalignment as long as the virtual
misalignment relative to this 2 MB block size is equal in size, and code to
deal with this is already in place.

Since we align the kernel segments to 64 KB, let's randomize the physical
offset at 64 KB granularity as well (unless CONFIG_DEBUG_ALIGN_RODATA is
enabled). This way, the page table and TLB footprint is not affected.

The higher granularity allows for 5 bits of additional entropy to be used.

Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 6f26b3671184c36d07eb5d61ba9a6d0aeb583c5d)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: relocatable: deal with physically misaligned kernel images
Ard Biesheuvel [Mon, 18 Apr 2016 15:09:47 +0000 (17:09 +0200)]
arm64: relocatable: deal with physically misaligned kernel images

When booting a relocatable kernel image, there is no practical reason
to refuse an image whose load address is not exactly TEXT_OFFSET bytes
above a 2 MB aligned base address, as long as the physical and virtual
misalignment with respect to the swapper block size are equal, and are
both aligned to THREAD_SIZE.

Since the virtual misalignment is under our control when we first enter
the kernel proper, we can simply choose its value to be equal to the
physical misalignment.

So treat the misalignment of the physical load address as the initial
KASLR offset, and fix up the remaining code to deal with that.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 08cdac619c81b3fa8cd73aeed2330ffe0a0b73ca)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: don't map TEXT_OFFSET bytes below the kernel if we can avoid it
Ard Biesheuvel [Mon, 18 Apr 2016 15:09:46 +0000 (17:09 +0200)]
arm64: don't map TEXT_OFFSET bytes below the kernel if we can avoid it

For historical reasons, the kernel Image must be loaded into physical
memory at a 512 KB offset above a 2 MB aligned base address. The region
between the base address and the start of the kernel Image has no
significance to the kernel itself, but it is currently mapped explicitly
into the early kernel VMA range for all translation granules.

In some cases (i.e., 4 KB granule), this is unavoidable, due to the 2 MB
granularity of the early kernel mappings. However, in other cases, e.g.,
when running with larger page sizes, or in the future, with more granular
KASLR, there is no reason to map it explicitly like we do currently.

So update the logic so that the region is mapped only if that happens as
a side effect of rounding the start address of the kernel to swapper block
size, and leave it unmapped otherwise.

Since the symbol kernel_img_size now simply resolves to the memory
footprint of the kernel Image, we can drop its definition from image.h
and opencode its calculation.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 18b9c0d641938242d8bcdba3c14a8f2beec2a97e)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: kernel: replace early 64-bit literal loads with move-immediates
Ard Biesheuvel [Mon, 18 Apr 2016 15:09:45 +0000 (17:09 +0200)]
arm64: kernel: replace early 64-bit literal loads with move-immediates

When building a relocatable kernel, we currently rely on the fact that
early 64-bit literal loads need to be deferred to after the relocation
has been performed only if they involve symbol references, and not if
they involve assemble time constants. While this is not an unreasonable
assumption to make, it is better to switch to movk/movz sequences, since
these are guaranteed to be resolved at link time, simply because there are
no dynamic relocation types to describe them.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit b03cc885328e3c0de61843737d42eb0a0f112aab)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: introduce mov_q macro to move a constant into a 64-bit register
Ard Biesheuvel [Mon, 18 Apr 2016 15:09:44 +0000 (17:09 +0200)]
arm64: introduce mov_q macro to move a constant into a 64-bit register

Implement a macro mov_q that can be used to move an immediate constant
into a 64-bit register, using between 2 and 4 movz/movk instructions
(depending on the operand)

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 30b5ba5cf333cc650e474eaf2cc1ae91bc7cf89f)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: kernel: perform relocation processing from ID map
Ard Biesheuvel [Mon, 18 Apr 2016 15:09:43 +0000 (17:09 +0200)]
arm64: kernel: perform relocation processing from ID map

Refactor the relocation processing so that the code executes from the
ID map while accessing the relocation tables via the virtual mapping.
This way, we can use literals containing virtual addresses as before,
instead of having to use convoluted absolute expressions.

For symmetry with the secondary code path, the relocation code and the
subsequent jump to the virtual entry point are implemented in a function
called __primary_switch(), and __mmap_switched() is renamed to
__primary_switched(). Also, the call sequence in stext() is aligned with
the one in secondary_startup(), by replacing the awkward 'adr_l lr' and
'b cpu_setup' sequence with a simple branch and link.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 0cd3defe0af4153ffc5fe39bcfa4abfc301984e9)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: kernel: use literal for relocated address of __secondary_switched
Ard Biesheuvel [Mon, 18 Apr 2016 15:09:42 +0000 (17:09 +0200)]
arm64: kernel: use literal for relocated address of __secondary_switched

We can simply use a relocated 64-bit literal to store the address of
__secondary_switched(), and the relocation code will ensure that it
holds the correct value at secondary entry time, as long as we make sure
that the literal is not dereferenced until after we have enabled the MMU.

So jump via a small __secondary_switch() function covered by the ID map
that performs the literal load and branch-to-register.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit e5ebeec879b726c755af0c1c15f3699b53268cd5)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: kernel: don't export local symbols from head.S
Ard Biesheuvel [Mon, 18 Apr 2016 15:09:41 +0000 (17:09 +0200)]
arm64: kernel: don't export local symbols from head.S

This unexports some symbols from head.S that are only used locally.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 190c056fc32a528979807cb5d5a0d68285933073)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: simplify kernel segment mapping granularity
Ard Biesheuvel [Wed, 30 Mar 2016 15:43:09 +0000 (17:43 +0200)]
arm64: simplify kernel segment mapping granularity

The mapping of the kernel consist of four segments, each of which is mapped
with different permission attributes and/or lifetimes. To optimize the TLB
and translation table footprint, we define various opaque constants in the
linker script that resolve to different aligment values depending on the
page size and whether CONFIG_DEBUG_ALIGN_RODATA is set.

Considering that
- a 4 KB granule kernel benefits from a 64 KB segment alignment (due to
  the fact that it allows the use of the contiguous bit),
- the minimum alignment of the .data segment is THREAD_SIZE already, not
  PAGE_SIZE (i.e., we already have padding between _data and the start of
  the .data payload in many cases),
- 2 MB is a suitable alignment value on all granule sizes, either for
  mapping directly (level 2 on 4 KB), or via the contiguous bit (level 3 on
  16 KB and 64 KB),
- anything beyond 2 MB exceeds the minimum alignment mandated by the boot
  protocol, and can only be mapped efficiently if the physical alignment
  happens to be the same,

we can simplify this by standardizing on 64 KB (or 2 MB) explicitly, i.e.,
regardless of granule size, all segments are aligned either to 64 KB, or to
2 MB if CONFIG_DEBUG_ALIGN_RODATA=y. This also means we can drop the Kconfig
dependency of CONFIG_DEBUG_ALIGN_RODATA on CONFIG_ARM64_4K_PAGES.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 97740051dd31d200a0efaa84544fe5e4713aac40)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: cover the .head.text section in the .text segment mapping
Ard Biesheuvel [Wed, 30 Mar 2016 15:43:08 +0000 (17:43 +0200)]
arm64: cover the .head.text section in the .text segment mapping

Keeping .head.text out of the .text mapping buys us very little: its actual
payload is only 4 KB, most of which is padding, but the page alignment may
add up to 2 MB (in case of CONFIG_DEBUG_ALIGN_RODATA=y) of additional
padding to the uncompressed kernel Image.

Also, on 4 KB granule kernels, the 4 KB misalignment of .text forces us to
map the adjacent 56 KB of code without the PTE_CONT attribute, and since
this region contains things like the vector table and the GIC interrupt
handling entry point, this region is likely to benefit from the reduced TLB
pressure that results from PTE_CONT mappings.

So remove the alignment between the .head.text and .text sections, and use
the [_text, _etext) rather than the [_stext, _etext) interval for mapping
the .text segment.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 7eb90f2ff7e3ee814ff12f3cd909b965cdd4a869)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: move early boot code to the .init segment
Ard Biesheuvel [Wed, 30 Mar 2016 15:43:07 +0000 (17:43 +0200)]
arm64: move early boot code to the .init segment

Apart from the arm64/linux and EFI header data structures, there is nothing
in the .head.text section that must reside at the beginning of the Image.
So let's move it to the .init section where it belongs.

Note that this involves some minor tweaking of the EFI header, primarily
because the address of 'stext' no longer coincides with the start of the
.text section. It also requires a couple of relocated symbol references
to be slightly rewritten or their definition moved to the linker script.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 546c8c44f092b2f23291fe499c221efc8cabbb67)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: use 'segment' rather than 'chunk' to describe mapped kernel regions
Ard Biesheuvel [Wed, 30 Mar 2016 15:43:06 +0000 (17:43 +0200)]
arm64: use 'segment' rather than 'chunk' to describe mapped kernel regions

Replace the poorly defined term chunk with segment, which is a term that is
already used by the ELF spec to describe contiguous mappings with the same
permission attributes of statically allocated ranges of an executable.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 2c09ec06bc39fc85a2b3856524348c301def27af)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoarm64: mm: Mark .rodata as RO
Jeremy Linton [Fri, 19 Feb 2016 17:50:32 +0000 (11:50 -0600)]
arm64: mm: Mark .rodata as RO

Currently the .rodata section is actually still executable when DEBUG_RODATA
is enabled. This changes that so the .rodata is actually read only, no execute.
It also adds the .rodata section to the mem_init banner.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
[catalin.marinas@arm.com: added vm_struct vmlinux_rodata in map_kernel()]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 2f39b5f91eb4bccd786d194e70db1dccad784755)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoARM: dts: rockchip: fix vdd_cpu to 1.25V on rk3036 kylin board
chenzhen [Tue, 14 Jun 2016 07:16:11 +0000 (15:16 +0800)]
ARM: dts: rockchip: fix vdd_cpu to 1.25V on rk3036 kylin board

In rk3036, the voltages of CPU and GPU are controlled by the same
regulator 'vdd_cpu'.
Here, we fix it to 1.25v to ensure that GPU could work well in
development period.
The actual voltage GPU needs might be much lower, and relative to
the frequence GPU runs at. this would be optimized when we implement
GPU DVFS with devfreq.

Change-Id: Ia25f0a67577fbfe248a25e4d913dc5f14fa40f0d
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoarm64: dts: rockchip: manage the evb cros for rk3399
Caesar Wang [Fri, 29 Jul 2016 06:46:40 +0000 (14:46 +0800)]
arm64: dts: rockchip: manage the evb cros for rk3399

Add the rk3399-evb-cros.dtsi for cros private.
Also, we should add the rev3 dts to support it.

Change-Id: Ie68d4352474c7ea02c188e2c2176244709ac1b48
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
8 years agoARM64: dts: rk3399-box: ajust gpu opp table
Jianqun Xu [Fri, 29 Jul 2016 06:50:35 +0000 (14:50 +0800)]
ARM64: dts: rk3399-box: ajust gpu opp table

Ajust voltage of 800M to 1v, and remove 700M.

Change-Id: Iabcdcee4f84693c9db53fbaf885e946bc8ca4212
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agoARM64: dts: rk3399-vr: ajust gpu opp table
Jianqun Xu [Fri, 29 Jul 2016 06:49:12 +0000 (14:49 +0800)]
ARM64: dts: rk3399-vr: ajust gpu opp table

Ajust voltage of 800M to 1v, and remove 700M.

Change-Id: I429af91ff5660c0398f6c84f6e426be43c068c24
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agoARM: dts: rockchip: enable vpu for rk3288-miniarm
Nickey Yang [Fri, 29 Jul 2016 02:05:39 +0000 (10:05 +0800)]
ARM: dts: rockchip: enable vpu for rk3288-miniarm

Change-Id: Idc6b51984f92caf9ea8c8e608f3cef151d3c6b97
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agoARM64: configs: rockchip_cros_defconfig: enable EAS
Caesar Wang [Thu, 28 Jul 2016 08:47:49 +0000 (16:47 +0800)]
ARM64: configs: rockchip_cros_defconfig: enable EAS

This patch trys to sync the rockchip_defconfig for cros.

Change-Id: Ieeda1e41f05f33ffaa708c9825901553a759b17b
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
8 years agoarm64: dts: rockchip: enable both of otg usb2 phys for rk3399
Wu Liang feng [Thu, 28 Jul 2016 11:29:01 +0000 (19:29 +0800)]
arm64: dts: rockchip: enable both of otg usb2 phys for rk3399

Enable both OTG1 PHY and OTG2 USB2 PHY for rk3399 board.
With this patch, we can support usb battery charger detect
and hold wake lock in OTG peripheral mode.

Change-Id: Icae1924d8a2427c297f28032588f178532acc560
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agoARM: dts: rk3288: add asoc simple card for DW-HDMI audio for fennec board
Jacob Chen [Thu, 21 Jul 2016 09:12:17 +0000 (17:12 +0800)]
ARM: dts: rk3288: add asoc simple card for DW-HDMI audio for fennec board

Change-Id: I36e01d79fe48722369e896992b7086be7a762752
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agoarm64: dts: rockchip: enable dw_hdmi audio support on EVB boards
Yakir Yang [Thu, 28 Jul 2016 06:33:43 +0000 (14:33 +0800)]
arm64: dts: rockchip: enable dw_hdmi audio support on EVB boards

DRM dw_hdmi audio driver is based on common hdmi-codec driver, and bind
with i2s controller through simple-audio-card.

Change-Id: I2d9d5941b8e7c1f256e505338f43869584772e79
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoarm64: configs: enable dw-hdmi i2s audio on rockchip_cros_defconfig
Yakir Yang [Thu, 28 Jul 2016 06:32:18 +0000 (14:32 +0800)]
arm64: configs: enable dw-hdmi i2s audio on rockchip_cros_defconfig

Change-Id: I02762b544f5813036040bf526b0bd2561d79fa88
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoHACK: phy: rockchip-inno-usb2: disable otg phy suspend for rk3399
Wu Liang feng [Thu, 28 Jul 2016 10:59:02 +0000 (18:59 +0800)]
HACK: phy: rockchip-inno-usb2: disable otg phy suspend for rk3399

This patch prevents OTG0 and OTG1 PHY from entering suspend mode.
Because if PHY enter suspend, it will cause DWC3 controller work
abnormally now. We can revert it if fusb302 driver is merged.

Change-Id: I74c3ee5d3e1b925e8dc758bdc6d67372df421b98
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agophy: rockchip-inno-usb2: add phy1 otg-port configurations for rk3399
Wu Liang feng [Wed, 27 Jul 2016 14:04:33 +0000 (22:04 +0800)]
phy: rockchip-inno-usb2: add phy1 otg-port configurations for rk3399

This patch add USB2 PHY1 OTG port configurations for rk3399,
it support PHY1 suspend and bvalid detect, but not support
usb battery charger detect.

Change-Id: I7a6aaf484d6ad2ad097a7d9679a56aa545f217c8
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agoarm64: dts: rockchip: add u2phy1_otg node for rk3399
Wu Liang feng [Wed, 27 Jul 2016 13:57:58 +0000 (21:57 +0800)]
arm64: dts: rockchip: add u2phy1_otg node for rk3399

RK3399 SoC USB2 PHY1 comprises with one host-port and
one otg-port, now we support PHY1 otg-port.

Change-Id: I8e7fd53ce6f1552172044ad2adc3f19e923d1bcd
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agoclk: rockchip: rk3399: delete the CLK_IGNORE_UNUSED for aclk_pcie
Elaine Zhang [Thu, 28 Jul 2016 08:28:00 +0000 (16:28 +0800)]
clk: rockchip: rk3399: delete the CLK_IGNORE_UNUSED for aclk_pcie

allow aclk_pcie and aclk_perf_pcie disabled when unused.

Change-Id: I55edb319d0abbabf841e7d479a40d736e657ad4b
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
8 years agodrm/rockchip: vop: make windows disable take effect
Mark Yao [Tue, 26 Jul 2016 02:53:26 +0000 (10:53 +0800)]
drm/rockchip: vop: make windows disable take effect

Should do vop_cfg_done to let windows disable take effect

Change-Id: Ib2966d8825a195696a963de7bc1d9665e78e5389
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: vop: get rid of vop_initial
Mark Yao [Fri, 22 Jul 2016 11:01:33 +0000 (19:01 +0800)]
drm/rockchip: vop: get rid of vop_initial

It's not need to do reset on vop init.

Change-Id: I25aec554b545471ce435648edc3b1e2ca51df570
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: vop: add vop full series of vop support
Mark Yao [Fri, 22 Jul 2016 10:44:26 +0000 (18:44 +0800)]
drm/rockchip: vop: add vop full series of vop support

The series of vop is:
IP version    chipname
3.1           rk3288
3.2           rk3368
3.4           rk3366
3.5           rk3399 big
3.6           rk3399 lit
3.7           rk322x

The IP version is from VERSION_INFO register

major version: used for IP structure, Vop full framework is 3,
vop little framework is 2.
minor version: on same structure, newer design vop will bigger then
old one.

Change-Id: I032cb3d74cd01440274d3efeefa747e6028c1689
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoARM64: rockchip_cros_defconfig: enable Rockchip Inno usb2phy driver
Chris Zhong [Thu, 28 Jul 2016 03:12:08 +0000 (11:12 +0800)]
ARM64: rockchip_cros_defconfig: enable Rockchip Inno usb2phy driver

Change-Id: I5d3a87aec065b5a3af2cc17888047a2506e8573b
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoarm64: dts: rockchip: add more reboot mode on rk3399
Huang, Tao [Thu, 28 Jul 2016 03:04:52 +0000 (11:04 +0800)]
arm64: dts: rockchip: add more reboot mode on rk3399

Add charging and fastboot mode support.

Change-Id: Ib66c0d8c36ae33eeef2672b2bb31f075f833dd87
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
8 years agopower: reset: reboot-mode: fix normal mode setup
Huang, Tao [Thu, 28 Jul 2016 02:59:22 +0000 (10:59 +0800)]
power: reset: reboot-mode: fix normal mode setup

If cmd is empty in get_reboot_mode_magic, we should return normal magic.

Change-Id: I10931adc49e33f72ae73d9471159f82cc02ff0c0
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
8 years agodt-bindings: soc: rockchip_boot-mode: add charging mode support
Huang, Tao [Thu, 28 Jul 2016 02:56:35 +0000 (10:56 +0800)]
dt-bindings: soc: rockchip_boot-mode: add charging mode support

Change-Id: I66d5eb1813583aae37b2d19a2cf18dd9bbaf7125
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
8 years agoarm64: dts: rockchip: rk3399-box-rev1: increase drive strength for sd/sdio pin
xiaoyao [Thu, 28 Jul 2016 02:03:43 +0000 (10:03 +0800)]
arm64: dts: rockchip: rk3399-box-rev1: increase drive strength for sd/sdio pin

Change-Id: I6566a7ea6e6e91160f4f456f4f402f2b06c63b56
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
8 years agoarm64: dts: rockchip: Add some drive strength properties for rk3399
xiaoyao [Thu, 28 Jul 2016 02:01:21 +0000 (10:01 +0800)]
arm64: dts: rockchip: Add some drive strength properties for rk3399

Change-Id: I8e838901729142dabff3703c52103daf28945edb
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
8 years agoLinux 4.4.16
Greg Kroah-Hartman [Wed, 27 Jul 2016 16:48:30 +0000 (09:48 -0700)]
Linux 4.4.16

8 years agoovl: verify upper dentry before unlink and rename
Miklos Szeredi [Mon, 21 Mar 2016 16:31:44 +0000 (17:31 +0100)]
ovl: verify upper dentry before unlink and rename

commit 11f3710417d026ea2f4fcf362d866342c5274185 upstream.

Unlink and rename in overlayfs checked the upper dentry for staleness by
verifying upper->d_parent against upperdir.  However the dentry can go
stale also by being unhashed, for example.

Expand the verification to actually look up the name again (under parent
lock) and check if it matches the upper dentry.  This matches what the VFS
does before passing the dentry to filesytem's unlink/rename methods, which
excludes any inconsistency caused by overlayfs.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrm/i915: Revert DisplayPort fast link training feature
Mika Kahola [Mon, 20 Jun 2016 08:10:26 +0000 (11:10 +0300)]
drm/i915: Revert DisplayPort fast link training feature

commit 34511dce4b35685d3988d5c8b100d11a068db5bd upstream.

It has been found out that in some HW combination the DisplayPort
fast link training feature caused screen flickering. Let's revert
this feature for now until we can ensure that the feature works for
all platforms.

This is a manual revert of commits 5fa836a9d859 ("drm/i915: DP link
training optimization") and 4e96c97742f4 ("drm/i915: eDP link training
optimization").

Fixes: 5fa836a9d859 ("drm/i915: DP link training optimization")
Fixes: 4e96c97742f4 ("drm/i915: eDP link training optimization")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91393
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466410226-19543-1-git-send-email-mika.kahola@intel.com
(cherry picked from commit 91df09d92ad82c8778ca218097bf827f154292ca)
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agotmpfs: fix regression hang in fallocate undo
Hugh Dickins [Sun, 10 Jul 2016 23:46:32 +0000 (16:46 -0700)]
tmpfs: fix regression hang in fallocate undo

commit 7f556567036cb7f89aabe2f0954b08566b4efb53 upstream.

The well-spotted fallocate undo fix is good in most cases, but not when
fallocate failed on the very first page.  index 0 then passes lend -1
to shmem_undo_range(), and that has two bad effects: (a) that it will
undo every fallocation throughout the file, unrestricted by the current
range; but more importantly (b) it can cause the undo to hang, because
lend -1 is treated as truncation, which makes it keep on retrying until
every page has gone, but those already fully instantiated will never go
away.  Big thank you to xfstests generic/269 which demonstrates this.

Fixes: b9b4bb26af01 ("tmpfs: don't undo fallocate past its last page")
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agotmpfs: don't undo fallocate past its last page
Anthony Romano [Fri, 24 Jun 2016 21:48:43 +0000 (14:48 -0700)]
tmpfs: don't undo fallocate past its last page

commit b9b4bb26af017dbe930cd4df7f9b2fc3a0497bfe upstream.

When fallocate is interrupted it will undo a range that extends one byte
past its range of allocated pages.  This can corrupt an in-use page by
zeroing out its first byte.  Instead, undo using the inclusive byte
range.

Fixes: 1635f6a74152f1d ("tmpfs: undo fallocation on failure")
Link: http://lkml.kernel.org/r/1462713387-16724-1-git-send-email-anthony.romano@coreos.com
Signed-off-by: Anthony Romano <anthony.romano@coreos.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Brandon Philips <brandon@ifup.co>
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>
8 years agocrypto: qat - make qat_asym_algs.o depend on asn1 headers
Jan Stancek [Thu, 30 Jun 2016 10:23:51 +0000 (12:23 +0200)]
crypto: qat - make qat_asym_algs.o depend on asn1 headers

commit 81dc0365cfa7bc7c08a0e44d9ee04964df782e19 upstream.

Parallel build can sporadically fail because asn1 headers may
not be built yet by the time qat_asym_algs.o is compiled:
  drivers/crypto/qat/qat_common/qat_asym_algs.c:55:32: fatal error: qat_rsapubkey-asn1.h: No such file or directory
   #include "qat_rsapubkey-asn1.h"

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoxen/acpi: allow xen-acpi-processor driver to load on Xen 4.7
Jan Beulich [Fri, 8 Jul 2016 12:15:07 +0000 (06:15 -0600)]
xen/acpi: allow xen-acpi-processor driver to load on Xen 4.7

commit 6f2d9d99213514360034c6d52d2c3919290b3504 upstream.

As of Xen 4.7 PV CPUID doesn't expose either of CPUID[1].ECX[7] and
CPUID[0x80000007].EDX[7] anymore, causing the driver to fail to load on
both Intel and AMD systems. Doing any kind of hardware capability
checks in the driver as a prerequisite was wrong anyway: With the
hypervisor being in charge, all such checking should be done by it. If
ACPI data gets uploaded despite some missing capability, the hypervisor
is free to ignore part or all of that data.

Ditch the entire check_prereq() function, and do the only valid check
(xen_initial_domain()) in the caller in its place.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoFile names with trailing period or space need special case conversion
Steve French [Thu, 23 Jun 2016 02:07:32 +0000 (21:07 -0500)]
File names with trailing period or space need special case conversion

commit 45e8a2583d97ca758a55c608f78c4cef562644d1 upstream.

POSIX allows files with trailing spaces or a trailing period but
SMB3 does not, so convert these using the normal Services For Mac
mapping as we do for other reserved characters such as
: < > | ? *
This is similar to what Macs do for the same problem over SMB3.

Signed-off-by: Steve French <steve.french@primarydata.com>
Acked-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agocifs: dynamic allocation of ntlmssp blob
Jerome Marchand [Thu, 26 May 2016 09:52:25 +0000 (11:52 +0200)]
cifs: dynamic allocation of ntlmssp blob

commit b8da344b74c822e966c6d19d6b2321efe82c5d97 upstream.

In sess_auth_rawntlmssp_authenticate(), the ntlmssp blob is allocated
statically and its size is an "empirical" 5*sizeof(struct
_AUTHENTICATE_MESSAGE) (320B on x86_64). I don't know where this value
comes from or if it was ever appropriate, but it is currently
insufficient: the user and domain name in UTF16 could take 1kB by
themselves. Because of that, build_ntlmssp_auth_blob() might corrupt
memory (out-of-bounds write). The size of ntlmssp_blob in
SMB2_sess_setup() is too small too (sizeof(struct _NEGOTIATE_MESSAGE)
+ 500).

This patch allocates the blob dynamically in
build_ntlmssp_auth_blob().

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoFix reconnect to not defer smb3 session reconnect long after socket reconnect
Steve French [Thu, 23 Jun 2016 01:12:05 +0000 (20:12 -0500)]
Fix reconnect to not defer smb3 session reconnect long after socket reconnect

commit 4fcd1813e6404dd4420c7d12fb483f9320f0bf93 upstream.

Azure server blocks clients that open a socket and don't do anything on it.
In our reconnect scenarios, we can reconnect the tcp session and
detect the socket is available but we defer the negprot and SMB3 session
setup and tree connect reconnection until the next i/o is requested, but
this looks suspicous to some servers who expect SMB3 negprog and session
setup soon after a socket is created.

In the echo thread, reconnect SMB3 sessions and tree connections
that are disconnected.  A later patch will replay persistent (and
resilient) handle opens.

Signed-off-by: Steve French <steve.french@primarydata.com>
Acked-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years ago53c700: fix BUG on untagged commands
James Bottomley [Tue, 14 Jun 2016 05:00:07 +0000 (22:00 -0700)]
53c700: fix BUG on untagged commands

commit 8beb330044d0d1878c7b92290e91c0b889e92633 upstream.

The untagged command case in the 53c700 driver has been broken since
host wide tags were enabled because the replaced scsi_find_tag()
function had a special case for the tag value SCSI_NO_TAG to retrieve
sdev->current_cmnd.  The replacement function scsi_host_find_tag() has
no such special case and returns NULL causing untagged commands to
trigger a BUG() in the driver.  Inspection shows that the 53c700 is the
only driver using this SCSI_NO_TAG case, so a local fix in the driver
suffices to fix this problem globally.

Fixes: 64d513ac31b - "scsi: use host wide tags by default"
Reported-by: Helge Deller <deller@gmx.de>
Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: James Bottomley <jejb@linux.vnet.ibm.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agos390: fix test_fp_ctl inline assembly contraints
Martin Schwidefsky [Mon, 27 Jun 2016 15:06:45 +0000 (17:06 +0200)]
s390: fix test_fp_ctl inline assembly contraints

commit bcf4dd5f9ee096bd1510f838dd4750c35df4e38b upstream.

The test_fp_ctl function is used to test if a given value is a valid
floating-point control. The inline assembly in test_fp_ctl uses an
incorrect constraint for the 'orig_fpc' variable. If the compiler
chooses the same register for 'fpc' and 'orig_fpc' the test_fp_ctl()
function always returns true. This allows user space to trigger
kernel oopses with invalid floating-point control values on the
signal stack.

This problem has been introduced with git commit 4725c86055f5bbdcdf
"s390: fix save and restore of the floating-point-control register"

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoscsi: fix race between simultaneous decrements of ->host_failed
Wei Fang [Tue, 7 Jun 2016 06:53:56 +0000 (14:53 +0800)]
scsi: fix race between simultaneous decrements of ->host_failed

commit 72d8c36ec364c82bf1bf0c64dfa1041cfaf139f7 upstream.

sas_ata_strategy_handler() adds the works of the ata error handler to
system_unbound_wq. This workqueue asynchronously runs work items, so the
ata error handler will be performed concurrently on different CPUs. In
this case, ->host_failed will be decreased simultaneously in
scsi_eh_finish_cmd() on different CPUs, and become abnormal.

It will lead to permanently inequality between ->host_failed and
->host_busy, and scsi error handler thread won't start running. IO
errors after that won't be handled.

Since all scmds must have been handled in the strategy handler, just
remove the decrement in scsi_eh_finish_cmd() and zero ->host_busy after
the strategy handler to fix this race.

Fixes: 50824d6c5657 ("[SCSI] libsas: async ata-eh")
Signed-off-by: Wei Fang <fangwei1@huawei.com>
Reviewed-by: James Bottomley <jejb@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoovl: verify upper dentry in ovl_remove_and_whiteout()
Maxim Patlasov [Fri, 22 Jul 2016 01:24:26 +0000 (18:24 -0700)]
ovl: verify upper dentry in ovl_remove_and_whiteout()

commit cfc9fde0b07c3b44b570057c5f93dda59dca1c94 upstream.

The upper dentry may become stale before we call ovl_lock_rename_workdir.
For example, someone could (mistakenly or maliciously) manually unlink(2)
it directly from upperdir.

To ensure it is not stale, let's lookup it after ovl_lock_rename_workdir
and and check if it matches the upper dentry.

Essentially, it is the same problem and similar solution as in
commit 11f3710417d0 ("ovl: verify upper dentry before unlink and rename").

Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoovl: Copy up underlying inode's ->i_mode to overlay inode
Vivek Goyal [Fri, 1 Jul 2016 20:34:25 +0000 (16:34 -0400)]
ovl: Copy up underlying inode's ->i_mode to overlay inode

commit 07a2daab49c549a37b5b744cbebb6e3f445f12bc upstream.

Right now when a new overlay inode is created, we initialize overlay
inode's ->i_mode from underlying inode ->i_mode but we retain only
file type bits (S_IFMT) and discard permission bits.

This patch changes it and retains permission bits too. This should allow
overlay to do permission checks on overlay inode itself in task context.

[SzM] It also fixes clearing suid/sgid bits on write.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reported-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoARM: mvebu: fix HW I/O coherency related deadlocks
Thomas Petazzoni [Thu, 16 Jun 2016 13:42:25 +0000 (15:42 +0200)]
ARM: mvebu: fix HW I/O coherency related deadlocks

commit c5379ba8fccd99d5f99632c789f0393d84a57805 upstream.

Until now, our understanding for HW I/O coherency to work on the
Cortex-A9 based Marvell SoC was that only the PCIe regions should be
mapped strongly-ordered. However, we were still encountering some
deadlocks, especially when testing the CESA crypto engine. After
checking with the HW designers, it was concluded that all the MMIO
registers should be mapped as strongly ordered for the HW I/O coherency
mechanism to work properly.

This fixes some easy to reproduce deadlocks with the CESA crypto engine
driver (dmcrypt on a sufficiently large disk partition).

Tested-by: Terry Stockert <stockert@inkblotadmirer.me>
Tested-by: Romain Perier <romain.perier@free-electrons.com>
Cc: Terry Stockert <stockert@inkblotadmirer.me>
Cc: Romain Perier <romain.perier@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoARM: dts: armada-38x: fix MBUS_ID for crypto SRAM on Armada 385 Linksys
Thomas Petazzoni [Thu, 16 Jun 2016 13:42:27 +0000 (15:42 +0200)]
ARM: dts: armada-38x: fix MBUS_ID for crypto SRAM on Armada 385 Linksys

commit 929e604efa3dc0522214e0dc18984be23993e9f0 upstream.

When the support for the Marvell crypto engine was added in the Device
Tree of the various Armada 385 Device Tree files in commit
d716f2e837ac6 ("ARM: mvebu: define crypto SRAM ranges for all armada-38x
boards"), a typo was made in the MBus window attributes for the Armada
385 Linksys board: 0x09/0x05 are used instead of 0x19/0x15. This commit
fixes this typo, which makes the CESA engines operational on Armada 385
Linksys boards.

Reported-by: Terry Stockert <stockert@inkblotadmirer.me>
Cc: Terry Stockert <stockert@inkblotadmirer.me>
Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: d716f2e837ac6 ("ARM: mvebu: define crypto SRAM ranges for all armada-38x boards")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoARM: sunxi/dt: make the CHIP inherit from allwinner,sun5i-a13
Boris Brezillon [Wed, 15 Jun 2016 11:20:19 +0000 (13:20 +0200)]
ARM: sunxi/dt: make the CHIP inherit from allwinner,sun5i-a13

commit 5fc39d347267bd029fcc9099c70e2fe2d53130e9 upstream.

The sun4i-timer driver registers its sched_clock only if the machine is
compatible with "allwinner,sun5i-a13", "allwinner,sun5i-a10s" or
"allwinner,sun4i-a10".
Add the missing "allwinner,sun5i-a13" string to the machine compatible.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: 465a225fb2af ("ARM: sun5i: Add C.H.I.P DTS")
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoALSA: hda: add AMD Stoney PCI ID with proper driver caps
Awais Belal [Tue, 12 Jul 2016 10:21:28 +0000 (15:21 +0500)]
ALSA: hda: add AMD Stoney PCI ID with proper driver caps

commit d716fb03f76411fc7e138692e33b749cada5c094 upstream.

This allows the device to correctly show up as ATI HDMI
rather than a generic one and allows the driver to use
the available caps.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoALSA: hda - fix use-after-free after module unload
Peter Wu [Mon, 11 Jul 2016 17:51:06 +0000 (19:51 +0200)]
ALSA: hda - fix use-after-free after module unload

commit ab58d8cc870ef3f0771c197700441936898d1f1d upstream.

register_vga_switcheroo() sets the PM ops from the hda structure which
is freed later in azx_free. Make sure that these ops are cleared.

Caught by KASAN, initially noticed due to a general protection fault.

Fixes: 246efa4a072f ("snd/hda: add runtime suspend/resume on optimus support (v4)")
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoALSA: ctl: Stop notification after disconnection
Takashi Iwai [Fri, 8 Jul 2016 06:05:19 +0000 (08:05 +0200)]
ALSA: ctl: Stop notification after disconnection

commit f388cdcdd160687c6650833f286b9c89c50960ff upstream.

snd_ctl_remove() has a notification for the removal event.  It's
superfluous when done during the device got disconnected.  Although
the notification itself is mostly harmless, it may potentially be
harmful, and should be suppressed.  Actually some components PCM may
free ctl elements during the disconnect or free callbacks, thus it's
no theoretical issue.

This patch adds the check of card->shutdown flag for avoiding
unnecessary notifications after (or during) the disconnect.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoALSA: pcm: Free chmap at PCM free callback, too
Takashi Iwai [Fri, 8 Jul 2016 06:23:43 +0000 (08:23 +0200)]
ALSA: pcm: Free chmap at PCM free callback, too

commit a8ff48cb70835f48de5703052760312019afea55 upstream.

The chmap ctls assigned to PCM streams are freed in the PCM disconnect
callback.  However, since the disconnect callback isn't called when
the card gets freed before registering, the chmap ctls may still be
left assigned.  They are eventually freed together with other ctls,
but it may cause an Oops at pcm_chmap_ctl_private_free(), as the
function refers to the assigned PCM stream, while the PCM objects have
been already freed beforehand.

The fix is to free the chmap ctls also at PCM free callback, not only
at PCM disconnect.

Reported-by: Laxminath Kasam <b_lkasam@codeaurora.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoALSA: hda/realtek - add new pin definition in alc225 pin quirk table
Hui Wang [Fri, 8 Jul 2016 06:26:57 +0000 (14:26 +0800)]
ALSA: hda/realtek - add new pin definition in alc225 pin quirk table

commit 8a132099f080d7384bb6ab4cc168f76cb4b47d08 upstream.

We have some Dell laptops which can't detect headset mic, the machines
use the codec ALC225, they have some new pin configuration values,
after adding them in the alc225 pin quirk table, they work well.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoALSA: hda - fix read before array start
Bob Copeland [Sat, 25 Jun 2016 11:58:45 +0000 (07:58 -0400)]
ALSA: hda - fix read before array start

commit 81e43960dce1c8e58e682fb3ec26c1d8f83a9afc upstream.

UBSAN reports the following warning from accessing path->path[-1]
in set_path_power():

[   16.078040] ================================================================================
[   16.078124] UBSAN: Undefined behaviour in sound/pci/hda/hda_generic.c:3981:17
[   16.078198] index -1 is out of range for type 'hda_nid_t [10]'
[   16.078270] CPU: 2 PID: 1738 Comm: modprobe Not tainted 4.7.0-rc1-wt+ #47
[   16.078274] Hardware name: LENOVO 3443CTO/3443CTO, BIOS G6ET23WW (1.02 ) 08/14/2012
[   16.078278]  ffff8800cb246000 ffff8800cb3638b8 ffffffff815c4fe3 0000000000000032
[   16.078286]  ffff8800cb3638e0 ffffffffffffffff ffff8800cb3638d0 ffffffff8162443d
[   16.078294]  ffffffffa0894200 ffff8800cb363920 ffffffff81624af7 0000000000000292
[   16.078302] Call Trace:
[   16.078311]  [<ffffffff815c4fe3>] dump_stack+0x86/0xd3
[   16.078317]  [<ffffffff8162443d>] ubsan_epilogue+0xd/0x40
[   16.078324]  [<ffffffff81624af7>] __ubsan_handle_out_of_bounds+0x67/0x70
[   16.078335]  [<ffffffffa087665f>] set_path_power+0x1bf/0x230 [snd_hda_codec_generic]
[   16.078344]  [<ffffffffa087880d>] add_pin_power_ctls+0x8d/0xc0 [snd_hda_codec_generic]
[   16.078352]  [<ffffffffa087f190>] ? pin_power_down_callback+0x20/0x20 [snd_hda_codec_generic]
[   16.078360]  [<ffffffffa0878947>] add_all_pin_power_ctls+0x107/0x150 [snd_hda_codec_generic]
[   16.078370]  [<ffffffffa08842b3>] snd_hda_gen_parse_auto_config+0x2d73/0x49e0 [snd_hda_codec_generic]
[   16.078376]  [<ffffffff81173360>] ? trace_hardirqs_on_caller+0x1b0/0x2c0
[   16.078390]  [<ffffffffa089df27>] alc_parse_auto_config+0x147/0x310 [snd_hda_codec_realtek]
[   16.078402]  [<ffffffffa08a332a>] patch_alc269+0x23a/0x560 [snd_hda_codec_realtek]
[   16.078417]  [<ffffffffa0838644>] hda_codec_driver_probe+0xa4/0x1a0 [snd_hda_codec]
[   16.078424]  [<ffffffff817bbac1>] driver_probe_device+0x101/0x380
[   16.078430]  [<ffffffff817bbdf9>] __driver_attach+0xb9/0x100
[   16.078438]  [<ffffffff817bbd40>] ? driver_probe_device+0x380/0x380
[   16.078444]  [<ffffffff817b8d20>] bus_for_each_dev+0x70/0xc0
[   16.078449]  [<ffffffff817bb087>] driver_attach+0x27/0x50
[   16.078454]  [<ffffffff817ba956>] bus_add_driver+0x166/0x2c0
[   16.078460]  [<ffffffffa0369000>] ? 0xffffffffa0369000
[   16.078465]  [<ffffffff817bd13d>] driver_register+0x7d/0x130
[   16.078477]  [<ffffffffa083816f>] __hda_codec_driver_register+0x6f/0x90 [snd_hda_codec]
[   16.078488]  [<ffffffffa036901e>] realtek_driver_init+0x1e/0x1000 [snd_hda_codec_realtek]
[   16.078493]  [<ffffffff8100215e>] do_one_initcall+0x4e/0x1d0
[   16.078499]  [<ffffffff8119f54d>] ? rcu_read_lock_sched_held+0x6d/0x80
[   16.078504]  [<ffffffff813701b1>] ? kmem_cache_alloc_trace+0x391/0x560
[   16.078510]  [<ffffffff812bb314>] ? do_init_module+0x28/0x273
[   16.078515]  [<ffffffff812bb387>] do_init_module+0x9b/0x273
[   16.078522]  [<ffffffff811e3782>] load_module+0x20b2/0x3410
[   16.078527]  [<ffffffff811df140>] ? m_show+0x210/0x210
[   16.078533]  [<ffffffff813b2b26>] ? kernel_read+0x66/0xe0
[   16.078541]  [<ffffffff811e4cfa>] SYSC_finit_module+0xba/0xc0
[   16.078547]  [<ffffffff811e4d1e>] SyS_finit_module+0xe/0x10
[   16.078552]  [<ffffffff81a860fc>] entry_SYSCALL_64_fastpath+0x1f/0xbd
[   16.078556] ================================================================================

Fix by checking path->depth before use.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoALSA: hda - Add PCI ID for Kabylake-H
Vinod Koul [Wed, 29 Jun 2016 04:57:52 +0000 (10:27 +0530)]
ALSA: hda - Add PCI ID for Kabylake-H

commit 6858107e78b4ecb9f244db814ffbdba1b5ce759b upstream.

Kabylake-H shows up as PCI ID 0xa2f0. We missed adding this
earlier with other KBL IDs.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoALSA: hda/realtek: Add Lenovo L460 to docking unit fixup
Torsten Hilbrich [Tue, 5 Jul 2016 08:40:22 +0000 (10:40 +0200)]
ALSA: hda/realtek: Add Lenovo L460 to docking unit fixup

commit 9cd25743765cfe851aed8d655a62d60156aed293 upstream.

This solves the issue that a headphone is not working on the docking
unit.

Signed-off-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>