Commit Graph

84336 Commits

Author SHA1 Message Date
Elaine Zhang
fb4fc53dc8 dt-bindings: clock: rk1808-cru: fix up the ID number repetition
HCLK_ISP and HCLK_CIF ID num are all 205.

Change-Id: Ia43cf6a8cd65e43673b4ebfe63bd92a3115740ab
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-10-09 09:27:51 +08:00
vkorjani
2a45f7557a UPSTREAM: drm: Add support for pps and compression mode command packet
After enabling DSC we need to send compression mode command packet
and pps data packet, for which 2 new data types are added
07h  Compression Mode Data Type Write , short write, 2 parameters
0Ah  PPS Long Write (word count determines number of bytes)
This patch adds support to send these packets.

Cc: David Airlie <airlied@linux.ie>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org

Changes in v3:
- None

Signed-off-by: vkorjani <vikas.korjani@intel.com>
[seanpaul removed pps_write_buffer fn, added types to packet_format helpers]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>

Change-Id: I5597a4ca8fdf128faa52d87e7513a5be1e7a87da
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit ea107a183b)
2018-10-08 16:32:59 +08:00
Vinay Simha BN
98d6838916 UPSTREAM: drm/dsi: Implement DCS set/get display brightness
Provide a small convenience wrapper that set/get the display brightness.

Cc: John Stultz <john.stultz@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Archit Taneja <archit.taneja@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Vinay Simha BN <simhavcs@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

Change-Id: I501ffb4b31ab2c8950ed1c4b84fb241d4b6aaae0
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit 1a9d759331)
2018-10-08 16:32:58 +08:00
Thierry Reding
6f75206dd7 UPSTREAM: drm/dsi: Order DCS helpers by command code
Most of these helpers had been introduced in the correct order, but some
were simply appended, which wasn't detected when they were applied.

Signed-off-by: Thierry Reding <treding@nvidia.com>

Change-Id: Ic540fb4d541b32c21f9f2348aba3f4cae5c99fa6
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit bbdcf516a6)
2018-10-08 16:32:58 +08:00
Thierry Reding
53db5bc1ac UPSTREAM: drm/dsi: Make set_tear_scanline command consistent
Use a consistent name for the function that implements set_tear_scanline
and reword and reformat the kerneldoc slightly.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160613133327.7630-1-thierry.reding@gmail.com

Change-Id: I67354ce8ff2bccfd9cd51a573d3007952057230c
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit 6308c983d7)
2018-10-08 16:32:58 +08:00
Thierry Reding
62f4efb216 UPSTREAM: drm/dsi: Add uevent callback
Implement a uevent callback for devices on the MIPI DSI bus. This
callback will append MODALIAS information to the uevent and allow
modules to be loaded when devices are added to the bus.

Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

Change-Id: I580c1fb721330a5088f8ddf233a635c607277729
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit babb24fec1)
2018-10-08 16:32:57 +08:00
Vinay Simha BN
bf8bc184f3 UPSTREAM: drm/dsi: Implement set tear scanline
Provide a small convenience wrapper that transmits
a set_tear_scanline command.

v2:
  * helper function suggested by Thierry
    for set_tear_scanline
  * Also includes small build fixes from Sumit Semwal.

v3: one scanline parameter suggested by jani

v4: passing the payload properly as suggested by jani

Cc: Archit Taneja <archit.taneja@gmail.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Vinay Simha BN <simhavcs@gmail.com>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1465285532-12676-1-git-send-email-simhavcs@gmail.com

Change-Id: Ic20f27190dd048ecd16b01a23ccd815156ee9512
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit e839508163)
2018-10-08 16:32:57 +08:00
Archit Taneja
84beccf97f UPSTREAM: drm/dsi: Get DSI host by DT device node
MIPI DSI devices are inherently aware of their host because they share a
parent-child hierarchy in the device tree.

Non-DSI drivers that create DSI device don't have this data. In order to
get this information, they require to a phandle to the DSI host in the
device tree.

Maintain a list of all the DSI hosts that are currently registered. This
list will be used to find the struct mipi_dsi_host corresponding to the
device tree node passed to of_find_mipi_dsi_host_by_node().

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

Change-Id: I9d1a42c45707ec4b22e67e6b4aad058b3a5254df
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit 97b6ae50e0)
2018-10-08 16:32:57 +08:00
Archit Taneja
8f107f3db3 UPSTREAM: drm/dsi: Add routine to unregister a DSI device
A driver calling mipi_dsi_device_register_full() might want to remove
the device once it's done. It might also require it in an error handling
path in case something went wrong.

Create mipi_dsi_device_unregister() for this purpose and use it within
mipi_dsi_remove_device_fn() as it does the same thing.

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

Change-Id: I538bd028851bb27dbf7c93d459b8276d7271dae8
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit 509e42ce04)
2018-10-08 16:32:57 +08:00
Archit Taneja
c853fbcafc UPSTREAM: drm/dsi: Try to match non-DT DSI devices
Add a device name field in struct mipi_dsi_device. This name is not the
same as the device name (which is of the format "hostname.reg"). When
the device is created via DT, this name is set to the modalias string.
In the non-DT case, the driver creating the DSI device provides the
name by populating a field in struct mipi_dsi_device_info.

Matching for DT case would be as it was before. For the non-DT case, we
compare the device and driver names. Other buses (like I2C/SPI) perform
a non-DT match by comparing the device name and entries in the driver's
id_table. Such a mechanism isn't used for the DSI bus.

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

Change-Id: I68d4e46fb82ccce4e578256c031d6ee329d5eb1b
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit bf4363ce3a)
2018-10-08 16:32:56 +08:00
Archit Taneja
fe98b92275 UPSTREAM: drm/dsi: Use mipi_dsi_device_register_full() for DSI device creation
Use mipi_dsi_device_register_full() for device creation. This takes in
a struct mipi_dsi_device_info as a template to populate the DSI device
information.

The reason to introduce this is to have a way to create DSI devices not
available via DT. Drivers that want to create a DSI device can populate
a struct mipi_dsi_device_info and call this function. For DSI devices
available via DT, of_mipi_dsi_device_add() is used as before, but this
now calls mipi_dsi_device_register_full() internally.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

Change-Id: I0fc26d2bbffd9368ceb50c1660ff74c4ab808b6b
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit c63ae8a968)
2018-10-08 16:32:56 +08:00
Deepak M
f549a90fc4 UPSTREAM: drm: Add new DCS commands in the enum list
Adding new DCS commands which are specified in the
DCS 1.3 spec related to CABC.

v2: Sorted the Macro`s by value (Andrzej)

v3 by Jani: sort all of enum, refer to MIPI DCS 1.3

Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: <dri-devel@lists.freedesktop.org>
Suggested-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Deepak M <m.deepak@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1459346623-30752-1-git-send-email-jani.nikula@intel.com

Change-Id: I7efe6989d3c10b26d21137bfab7e933b00859a20
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit 249c4f538b)
2018-10-08 16:32:55 +08:00
Meghana Madhyastha
ef16a0c44b UPSTREAM: video: backlight: Add helpers to enable and disable backlight
Add helper functions backlight_enable and backlight_disable to
enable/disable a backlight device. These helper functions can
then be used by different drm and tinydrm drivers to avoid
repetition of code and also to enforce a uniform and consistent
way to enable/disable a backlight device.

Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/39b5bf0a02008a8072d910bdf8231c431e9ef504.1516810725.git.meghana.madhyastha@gmail.com

Change-Id: I66bb87531ee94977376cde33070ab2650f6dfcf5
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit 5b698be049)
2018-10-08 16:32:55 +08:00
Joseph Chen
a572f1ce77 dt-bindings: suspend: rk3308: add pdm clk off control macro
Change-Id: I8f9d782e3676ccd0c866b24ba7a4da0df7f23029
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-28 17:11:42 +08:00
Sugar Zhang
c7bf0d5658 clk: rockchip: rk1808: fixup wrong id-name for HCLK_I2S1
Change-Id: I10254f5c6144443d614a34d75d2400c22c448514
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-09-26 12:00:46 +08:00
Finley Xiao
ea0d7ad774 clk: rockchip: rk3308: Add some new clocks
Add clock for pwm1, pwm2, can, owire.

Change-Id: Id9a9330da359c3d2c53ae0f0f2e41cf4ff495cc4
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-09-17 17:31:25 +08:00
Elaine Zhang
a79ff0ae89 clk: rockchip: rk1808: add aclk_dmac for dma
Change-Id: I22208521b4de30228e14d47dd5117582fbf888b6
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-09-14 18:44:31 +08:00
Hu Kejun
2ff670508e media: rockchip: isp1: support for isp new version in rk3326
Change-Id: I226cc2d87053d1951252122c44b570030470ba42
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-09-10 19:25:58 +08:00
Jianqun Xu
ffbd3042bc soc: rockchip: add CONFIG_ROCKCHIP_OPP for rockchip_opp_select.c
Change-Id: I0cde56d1ad7482c8d4e8b518fc49cc028da6501b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-09-10 18:38:51 +08:00
Tao Huang
75654db877 Merge branch 'linux-linaro-lsk-v4.4' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4: (519 commits)
  Linux 4.4.154
  cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
  iscsi target: fix session creation failure handling
  scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock
  scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
  MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7
  MIPS: Correct the 64-bit DSP accumulator register size
  kprobes: Make list and blacklist root user read only
  s390/pci: fix out of bounds access during irq setup
  s390/qdio: reset old sbal_state flags
  s390: fix br_r1_trampoline for machines without exrl
  x86/spectre: Add missing family 6 check to microcode check
  x86/irqflags: Mark native_restore_fl extern inline
  pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
  ASoC: sirf: Fix potential NULL pointer dereference
  ASoC: dpcm: don't merge format from invalid codec dai
  udl-kms: fix crash due to uninitialized memory
  udl-kms: handle allocation failure
  udl-kms: change down_interruptible to down
  fuse: Add missed unlock_page() to fuse_readpages_fill()
  ...

Conflicts:
	Makefile
	arch/arm64/mm/init.c
	fs/squashfs/block.c
	include/uapi/linux/prctl.h
	kernel/sys.c

Change-Id: Ie03b5adfbbb4ab2bf16bc55d99f0d8a9c540a53b
2018-09-07 17:34:34 +08:00
Joseph Chen
7083a3390f mfd: rk808: initial rk816 LDOs write mask bit 1.
RK816 ldo write mask bit is always 1 after setting finished, but
when system start, the write mask bit is 0 even enable bit is 1.

So that rk816 regulator driver '.is_enabled()' returns disabled state
even the ldo is power on when system start, we need to initial write
mask bit as 1.

Change-Id: I8b5b83f33d668e4bdd1f96d77208931d25b8f6d9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-07 10:40:40 +08:00
Mark Brown
82eacc8a7b Merge tag 'v4.4.154' into linux-linaro-lsk-v4.4
This is the 4.4.154 stable release
2018-09-06 10:40:13 +01:00
Bart Van Assche
461a6385e5 scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
commit 2afc9166f7 upstream.

Introduce these two functions and export them such that the next patch
can add calls to these functions from the SCSI core.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-05 09:18:40 +02:00
Elaine Zhang
c5a692d3ea dt-bindings: power: add power-domain header for RK1808 SoCs
According to a description from TRM, add all the power domains

Change-Id: Id8c4af687c877e206f8ce08416dcb4e41a78ce46
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-31 14:23:38 +08:00
Elaine Zhang
8c98270171 clk: rockchip: rk1808: add HCLK_NPU clk ID for npu
Change-Id: Idd409a818cd3e2b122ed30f01f8fdc495a8bc53f
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-31 14:19:49 +08:00
Elaine Zhang
22282d70ee clk: rockchip: rk1808: add HCLK_HOST_ARB and PCLK_USB3PHY_PIPE ID for usb
Change-Id: I5cc084d2fc21c5cf4972b5a38ab0ee1ab8b4e377
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-30 12:28:25 +08:00
Mark Brown
3a9cbd70c7 Merge tag 'v4.4.153' into linux-linaro-lsk-v4.4
This is the 4.4.153 stable release
2018-08-29 15:39:57 +01:00
Jianqun Xu
a3b25912fd clk: rockchip: rk1808: modify RGMI to RGMII
Change-Id: I7b846ecf5c9dd73a08de1b0d38de94943c79dcf4
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2018-08-29 09:34:38 +08:00
Randy Dunlap
0821ddad49 net/ethernet/freescale/fman: fix cross-build error
[ Upstream commit c133459765 ]

  CC [M]  drivers/net/ethernet/freescale/fman/fman.o
In file included from ../drivers/net/ethernet/freescale/fman/fman.c:35:
../include/linux/fsl/guts.h: In function 'guts_set_dmacr':
../include/linux/fsl/guts.h:165:2: error: implicit declaration of function 'clrsetbits_be32' [-Werror=implicit-function-declaration]
  clrsetbits_be32(&guts->dmacr, 3 << shift, device << shift);
  ^~~~~~~~~~~~~~~

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Madalin Bucur <madalin.bucur@nxp.com>
Cc: netdev@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:27:00 +02:00
Yuchung Cheng
43707aa8c5 tcp: remove DELAYED ACK events in DCTCP
[ Upstream commit a69258f7aa ]

After fixing the way DCTCP tracking delayed ACKs, the delayed-ACK
related callbacks are no longer needed

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Lawrence Brakmo <brakmo@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:26:59 +02:00
Eric Dumazet
8747d9e7d4 netfilter: ipv6: nf_defrag: reduce struct net memory waste
[ Upstream commit 9ce7bc036a ]

It is a waste of memory to use a full "struct netns_sysctl_ipv6"
while only one pointer is really used, considering netns_sysctl_ipv6
keeps growing.

Also, since "struct netns_frags" has cache line alignment,
it is better to move the frags_hdr pointer outside, otherwise
we spend a full cache line for this pointer.

This saves 192 bytes of memory per netns.

Fixes: c038a767cd ("ipv6: add a new namespace for nf_conntrack_reasm")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:26:53 +02:00
Sugar Zhang
31ed99d1b4 ASoC: rockchip: vad: add snd_pcm_vad_memcpy
Change-Id: I43c7e317f94e08aee0d55da1400493f510ff6e77
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-08-24 14:55:33 +08:00
Dong Aisheng
6d2c4f3a6d UPSTREAM: clk: add more __must_check for bulk APIs
we need it even when !CONFIG_HAVE_CLK because it allows
us to catch missing checking return values in the non-clk
compile configurations too. More test coverage.

Change-Id: Ibc620a329c849361dba72f41ff8a6f2f83d45abd
Cc: Stephen Boyd <sboyd@codeaurora.org>
Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 6e0d4ff458)
2018-08-24 14:42:19 +08:00
Bjorn Andersson
511f7b03fe UPSTREAM: clk: Provide bulk prepare_enable disable_unprepare variants
This extends the existing set of bulk helpers with prepare_enable and
disable_unprepare variants.

Change-Id: I38d42d5d028f3d096cbd5b7b8d369ff250f038dc
Cc: Russell King <linux@armlinux.org.uk>,
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 3c48d86cc9)
2018-08-24 14:42:19 +08:00
Dong Aisheng
2a0b3c4802 UPSTREAM: clk: add managed version of clk_bulk_get
This patch introduces the managed version of clk_bulk_get.

Change-Id: Idd7ef3cb3825573821c9b7736ad459e8a4e25beb
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Anson Huang <anson.huang@nxp.com>
Cc: Robin Gong <yibin.gong@nxp.com>
Cc: Bai Ping <ping.bai@nxp.com>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Octavian Purdila <octavian.purdila@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 618aee02e2)
2018-08-24 14:42:19 +08:00
Dong Aisheng
c26eceeb47 UPSTREAM: clk: add clk_bulk_get accessories
These helper function allows drivers to get several clk consumers in
one operation. If any of the clk cannot be acquired then any clks
that were got will be put before returning to the caller.

This can relieve the driver owners' life who needs to handle many clocks,
as well as each clock error reporting.

Change-Id: I6dd3e713af340be51b29c7dc852c1d51ee090c32
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Anson Huang <anson.huang@nxp.com>
Cc: Robin Gong <yibin.gong@nxp.com>
Cc: Bai Ping <ping.bai@nxp.com>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Octavian Purdila <octavian.purdila@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 266e4e9d91)
2018-08-24 14:42:19 +08:00
Kuninori Morimoto
5d92d533cf UPSTREAM: clk: add devm_get_clk_from_child() API
Some driver is using this type of DT bindings for clock (more detail,
see ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.txt).

	sound_soc {
		...
		cpu {
			clocks = <&xxx>;
			...
		};
		codec {
			clocks = <&xxx>;
			...
		};
	};

Current driver in this case uses of_clk_get() for each node, but there
is no devm_of_clk_get() today.
OTOH, the problem of having devm_of_clk_get() is that it encourages the
use of of_clk_get() when clk_get() is more desirable.

Thus, this patch adds new devm_get_clk_from_chile() which explicitly
reads as get a clock from a child node of this device.
By this function, we can also use this type of DT bindings

	sound_soc {
		clocks = <&xxx>, <&xxx>;
		clock-names = "cpu", "codec";
		clock-ranges;
		...
		cpu {
			...
		};
		codec {
			...
		};
	};

Change-Id: Ie5b3bf7bda683a47ff07bea85982e916db12a1cb
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[sboyd@codeurora.org: Rename subject to clk + add API]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 71a2f11511)
2018-08-24 14:42:19 +08:00
Krzysztof Kozlowski
0c1c319127 UPSTREAM: clk: Provide notifier stubs when !COMMON_CLK
The clk notifier symbols are hidden by COMMON_CLK.  However on some
platforms HAVE_CLK might be set while COMMON_CLK not which leads to
compile test build errors like:

$ make.cross ARCH=sh
   drivers/devfreq/tegra-devfreq.c: In function 'tegra_actmon_rate_notify_cb':
>> drivers/devfreq/tegra-devfreq.c:391:16: error: 'POST_RATE_CHANGE' undeclared (first use in this function)
     if (action != POST_RATE_CHANGE)
                   ^
   drivers/devfreq/tegra-devfreq.c: In function 'tegra_devfreq_probe':
>> drivers/devfreq/tegra-devfreq.c:654:8: error: implicit declaration of function 'clk_notifier_register' [-Werror=implicit-function-declaration]
     err = clk_notifier_register(tegra->emc_clock, &tegra->rate_change_nb);
           ^

Export the macros and data type declarations outside of COMMON_CLK ifdef
and provide stubs to fix the compile testing.

Change-Id: I1172439272d961be2ed38f4857f1c646c9a4e651
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit e81b87d22a)
2018-08-24 14:42:19 +08:00
Daniel Lezcano
a676be7b55 UPSTREAM: clk: Add missing clk_get_sys() stub
When compiling with the COMPILE_TEST option set, the clps711x does not
compile because of the clk_get_sys() noop stub missing.

Change-Id: I8bf02a5725f294e59164c3674f2e480a61084517
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit b81ea96870)
2018-08-24 14:42:19 +08:00
Joseph Chen
0031c0242e dt-bindings: suspend: rk3308: add timer test control macro
Change-Id: If87cdc53f1fdeedf1b5cdfd5f867408ed8008a49
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-24 09:56:11 +08:00
Benjamin Herrenschmidt
80d62ecfaa UPSTREAM: devres: Add devm_of_iomap()
There are still quite a few cases where a device might want
to get to a different node of the device-tree, obtain the
resources and map them.

We have of_iomap() and of_io_request_and_map() but they both
have shortcomings, such as not returning the size of the
resource found (which can be useful) and not being "managed".

This adds a devm_of_iomap() that provides all of these and
should probably replace uses of the above in most drivers.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
(cherry picked from commit d5e838275c)

Change-Id: I5d68c3e23637c5e83e5f2bed3a1aa2c654d7d6a1
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2018-08-23 17:48:43 +08:00
Mark Brown
7057964870 Merge tag 'v4.4.151' into linux-linaro-lsk-v4.4
This is the 4.4.151 stable release
2018-08-23 10:48:19 +01:00
Andy Yan
86b17a821c soc: rockchip: cpuinfo: init soc id for rk3308/rk3308b
RK3308B is a enhanced variant of RK3308 with more flexible
iomux and peripherals(for example, RK3308B has 12 pwms, but
RK3308 has 4).

The CHIP_ID is stored in GRF_CHIP_ID:

RK3308:  0xcea (3306 in decimal)
RK3308B: 0x3308

Change-Id: I8f675656c012bdedb43043f5dbeea8bd11ea4ded
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-08-22 20:53:01 +08:00
Cong Wang
62209d1f27 vsock: split dwork to avoid reinitializations
[ Upstream commit 455f05ecd2 ]

syzbot reported that we reinitialize an active delayed
work in vsock_stream_connect():

	ODEBUG: init active (active state 0) object type: timer_list hint:
	delayed_work_timer_fn+0x0/0x90 kernel/workqueue.c:1414
	WARNING: CPU: 1 PID: 11518 at lib/debugobjects.c:329
	debug_print_object+0x16a/0x210 lib/debugobjects.c:326

The pattern is apparently wrong, we should only initialize
the dealyed work once and could repeatly schedule it. So we
have to move out the initializations to allocation side.
And to avoid confusion, we can split the shared dwork
into two, instead of re-using the same one.

Fixes: d021c34405 ("VSOCK: Introduce VM Sockets")
Reported-by: <syzbot+8a9b1bd330476a4f3db6@syzkaller.appspotmail.com>
Cc: Andy king <acking@vmware.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-22 07:48:35 +02:00
Cong Wang
813fb06fe6 llc: use refcount_inc_not_zero() for llc_sap_find()
[ Upstream commit 0dcb82254d ]

llc_sap_put() decreases the refcnt before deleting sap
from the global list. Therefore, there is a chance
llc_sap_find() could find a sap with zero refcnt
in this global list.

Close this race condition by checking if refcnt is zero
or not in llc_sap_find(), if it is zero then it is being
removed so we can just treat it as gone.

Reported-by: <syzbot+278893f3f7803871f7ce@syzkaller.appspotmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-22 07:48:35 +02:00
Mark Brown
b44f7e7a0f Merge tag 'v4.4.150' into linux-linaro-lsk-v4.4
This is the 4.4.150 stable release
2018-08-20 14:27:37 +01:00
Chintan Pandya
29f475cbff ioremap: Update pgtable free interfaces with addr
commit 785a19f9d1 upstream.

The following kernel panic was observed on ARM64 platform due to a stale
TLB entry.

 1. ioremap with 4K size, a valid pte page table is set.
 2. iounmap it, its pte entry is set to 0.
 3. ioremap the same address with 2M size, update its pmd entry with
    a new value.
 4. CPU may hit an exception because the old pmd entry is still in TLB,
    which leads to a kernel panic.

Commit b6bdb7517c ("mm/vmalloc: add interfaces to free unmapped page
table") has addressed this panic by falling to pte mappings in the above
case on ARM64.

To support pmd mappings in all cases, TLB purge needs to be performed
in this case on ARM64.

Add a new arg, 'addr', to pud_free_pmd_page() and pmd_free_pte_page()
so that TLB purge can be added later in seprate patches.

[toshi.kani@hpe.com: merge changes, rewrite patch description]
Fixes: 28ee90fe60 ("x86/mm: implement free pmd/pte page interfaces")
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: mhocko@suse.com
Cc: akpm@linux-foundation.org
Cc: hpa@zytor.com
Cc: linux-mm@kvack.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Will Deacon <will.deacon@arm.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: stable@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20180627141348.21777-3-toshi.kani@hpe.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-17 20:56:45 +02:00
Eric Biggers
335e988310 crypto: vmac - separate tfm and request context
commit bb29648102 upstream.

syzbot reported a crash in vmac_final() when multiple threads
concurrently use the same "vmac(aes)" transform through AF_ALG.  The bug
is pretty fundamental: the VMAC template doesn't separate per-request
state from per-tfm (per-key) state like the other hash algorithms do,
but rather stores it all in the tfm context.  That's wrong.

Also, vmac_final() incorrectly zeroes most of the state including the
derived keys and cached pseudorandom pad.  Therefore, only the first
VMAC invocation with a given key calculates the correct digest.

Fix these bugs by splitting the per-tfm state from the per-request state
and using the proper init/update/final sequencing for requests.

Reproducer for the crash:

    #include <linux/if_alg.h>
    #include <sys/socket.h>
    #include <unistd.h>

    int main()
    {
            int fd;
            struct sockaddr_alg addr = {
                    .salg_type = "hash",
                    .salg_name = "vmac(aes)",
            };
            char buf[256] = { 0 };

            fd = socket(AF_ALG, SOCK_SEQPACKET, 0);
            bind(fd, (void *)&addr, sizeof(addr));
            setsockopt(fd, SOL_ALG, ALG_SET_KEY, buf, 16);
            fork();
            fd = accept(fd, NULL, NULL);
            for (;;)
                    write(fd, buf, 256);
    }

The immediate cause of the crash is that vmac_ctx_t.partial_size exceeds
VMAC_NHBYTES, causing vmac_final() to memset() a negative length.

Reported-by: syzbot+264bca3a6e8d645550d3@syzkaller.appspotmail.com
Fixes: f1939f7c56 ("crypto: vmac - New hash algorithm for intel_txt support")
Cc: <stable@vger.kernel.org> # v2.6.32+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-17 20:56:45 +02:00
Mark Brown
15b787de81 Merge tag 'v4.4.148' into linux-linaro-lsk-v4.4
This is the 4.4.148 stable release
2018-08-16 15:59:39 +01:00
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