Commit Graph

1066174 Commits

Author SHA1 Message Date
Subbaraman Narayanamurthy
35afadf0da FROMLIST: thermal: Fix a NULL pointer dereference
of_parse_thermal_zones() parses the thermal-zones node and registers a
thermal_zone device for each subnode. However, if a thermal zone is
consuming a thermal sensor and that thermal sensor device hasn't probed
yet, an attempt to set trip_point_*_temp for that thermal zone device
can cause a NULL pointer dereference. Fix it.

 console:/sys/class/thermal/thermal_zone87 # echo 120000 > trip_point_0_temp
 ...
 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
 ...
 Call trace:
  of_thermal_set_trip_temp+0x40/0xc4
  trip_point_temp_store+0xc0/0x1dc
  dev_attr_store+0x38/0x88
  sysfs_kf_write+0x64/0xc0
  kernfs_fop_write_iter+0x108/0x1d0
  vfs_write+0x2f4/0x368
  ksys_write+0x7c/0xec
  __arm64_sys_write+0x20/0x30
  el0_svc_common.llvm.7279915941325364641+0xbc/0x1bc
  do_el0_svc+0x28/0xa0
  el0_svc+0x14/0x24
  el0_sync_handler+0x88/0xec
  el0_sync+0x1c0/0x200

While at it, fix the possible NULL pointer dereference in other
functions as well: of_thermal_get_temp(), of_thermal_set_emul_temp(),
of_thermal_get_trend().

Cc: stable@vger.kernel.org
Suggested-by: David Collins <quic_collinsd@quicinc.com>
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>

Bug: 199134856
Link: https://lore.kernel.org/linux-pm/1631041289-11804-1-git-send-email-quic_subbaram@quicinc.com/T/#u
Change-Id: I6d5108d3abc7554f91f2e98f2617162224bf0ce3
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2021-09-07 12:26:49 -07:00
Jerome Brunet
3d371f087c UPSTREAM: usb: gadget: f_uac2: fixup feedback endpoint stop
When the uac2 function is stopped, there seems to be an issue reported on
some platforms (Intel Merrifield at least)

BUG: kernel NULL pointer dereference, address: 0000000000000008
...
RIP: 0010:dwc3_gadget_del_and_unmap_request+0x19/0xe0
...
Call Trace:
 dwc3_remove_requests.constprop.0+0x12f/0x170
 __dwc3_gadget_ep_disable+0x7a/0x160
 dwc3_gadget_ep_disable+0x3d/0xd0
 usb_ep_disable+0x1c/0x70
 u_audio_stop_capture+0x79/0x120 [u_audio]
 afunc_set_alt+0x73/0x80 [usb_f_uac2]
 composite_setup+0x224/0x1b90 [libcomposite]

The issue happens only when the gadget is using the sync type "async", not
"adaptive". This indicates that problem is coming from the feedback
endpoint, which is only used with async synchronization mode.

The problem is that request is freed regardless of usb_ep_dequeue(), which
ends up badly if the request is not actually dequeued yet.

Update the feedback endpoint free function to release the endpoint the same
way it is done for the data endpoint, which takes care of the problem.

Fixes: 24f779dac8 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support")
Reported-by: Ferry Toth <ftoth@exalondelft.nl>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210827075853.266912-1-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: I96cc41a0dc0e3ad15f9c9bbe5737f22e0fc74433
(cherry picked from commit 75432ba583)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 12:47:44 +00:00
Ruslan Bilovol
406a51b486 UPSTREAM: usb: gadget: u_audio: add real feedback implementation
This adds interface between userspace and feedback endpoint to report real
feedback frequency to the Host.

Current implementation adds new userspace interface ALSA mixer control
"Capture Pitch 1000000" (similar to aloop driver's "PCM Rate Shift 100000"
mixer control)

Value in PPM is chosen to have correction value agnostic of the actual HW
rate, which the application is not necessarily dealing with, while still
retaining a good enough precision to allow smooth clock correction on the
playback side, if necessary.

Similar to sound/usb/endpoint.c, a slow down is allowed up to 25%. This
has no impact on the required bandwidth. Speedup correction has an impact
on the bandwidth reserved for the isochronous endpoint. The default
allowed speedup is 500ppm. This seems to be more than enough but, if
necessary, this is configurable through a module parameter. The reserved
bandwidth is rounded up to the next packet size.

Usage of this new control is easy to implement in existing userspace tools
like alsaloop from alsa-utils.

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210603220104.1216001-4-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: If23b59a8bd19a32ba688c688fbfd9e34eb4330c7
(cherry picked from commit e89bb42883)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 12:47:31 +00:00
David Wu
701fbf7d72 dt-bindings: net: rockchip-dwmac: add rk3588 compatible string
Add compatible string for RK3588 gmac, and constrain it to
be compatible with Synopsys dwmac 4.20a.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I6d36dffc9f33d15cb87c19e93d7e07ca47ea73f4
2021-09-07 18:59:19 +08:00
Ruslan Bilovol
d33287acf3 UPSTREAM: usb: gadget: f_uac2: add adaptive sync support for capture
Current f_uac2 USB OUT (aka 'capture') synchronization
implements 'ASYNC' scenario which means USB Gadget has
it's own freerunning clock and can update Host about
real clock frequency through feedback endpoint so Host
can align number of samples sent to the USB gadget to
prevent overruns/underruns

In case if Gadget can has no it's internal clock and
can consume audio samples at any rate (for example,
on the Gadget side someone records audio directly to
a file, or audio samples are played through an
external DAC as soon as they arrive), UAC2 spec
suggests 'ADAPTIVE' synchronization type.

Change UAC2 driver to make it configurable through
additional 'c_sync' configfs file.

Default remains 'asynchronous' with possibility to
switch it to 'adaptive'

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210603220104.1216001-3-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: I5003048575535b97274fe9137b53894deb6647d6
(cherry picked from commit 40c73b3054)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 10:52:14 +00:00
Greg Kroah-Hartman
0115d3d9f9 ANDROID: GKI: add virtio_break_device to the symbol list
The 5.10.62 kernel added the virtio_break_device symbol as a requirement
for the virtio_pci module, so add it to the list so that the
virt_aarch64 target will build properly.

Functions changes summary: 0 Removed, 0 Changed (335 filtered out), 1 Added functions
Variables changes summary: 0 Removed, 0 Changed (3 filtered out), 0 Added variables

1 Added function:

  [A] 'function void virtio_break_device(virtio_device*)'

Fixes: 674d2ac211 ("Merge 5.10.62 into android12-5.10-lts")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3937438f3c54d1aebbd2db683da239776e84fcaf
2021-09-07 10:49:29 +02:00
Yu Qiaowei
c1a0c8a181 video/rockchip: rga2: Add RGA debugger.
1. Support procfs, both debugfs and procfs.
2. Modify the debug node name:
   /sys/kernel/debug/rga2_debug/rga2
   -> /sys/kernel/debug/rkrga/debug
   -> /proc/rkrga/debug (add)
3. Add a node to view the driver version number: driver_version.
4. Add CONFIG_ROCKCHIP_RGA2_PROC_FS/ROCKCHIP_RGA2_DEBUG_FS/
   ROCKCHIP_RGA2_DEBUGGER, Where CONFIG_ROCKCHIP_RGA2_PROC_FS
   defaults to n, CONFIG_ROCKCHIP_RGA2_DEBUGGER defaults to y.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I89a971f18301ffa9cc7ac1962ebeee5e97d209aa
2021-09-07 15:50:53 +08:00
Jon Lin
e51271b834 spi: rockchip_sfc: support dll traning
The dll threshold is 50MHz and traning from spiflash JEDEC id.

Change-Id: I042a4826531cc399ef0ed129b2933cad92462e55
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-07 15:36:19 +08:00
Ruslan Bilovol
c71892dd9e UPSTREAM: usb: gadget: f_uac2/u_audio: add feedback endpoint support
As per USB and UAC2 specs, asynchronous audio sink endpoint
requires explicit synchronization mechanism (Isochronous
Feedback Endpoint)

Implement feedback companion endpoint for ISO OUT endpoint

This patch adds all required infrastructure and USB requests
handling for feedback endpoint. Syncrhonization itself is
still dummy (feedback ep always reports 'nomimal frequency'
 e.g. no adjustement is needed). This satisfies hosts that
require feedback endpoint (like Win10) and poll it periodically

Actual synchronization mechanism should be implemented
separately

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210603220104.1216001-2-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: I07b5b3e54251c68bff24a2c78ed4e0b30f107693
(cherry picked from commit 24f779dac8)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 06:19:13 +00:00
Ruslan Bilovol
a844dfbbcb UPSTREAM: usb: gadget: u_audio: convert to strscpy
Usage of strlcpy in Linux Kernel has been recently
deprecated [1], convert driver to strscpy

[1] https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Link: https://lore.kernel.org/r/1614603943-11668-2-git-send-email-ruslan.bilovol@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: If27abc1574f89f344d191f538d671d0f8390d4cb
(cherry picked from commit d23922fcac)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 06:18:44 +00:00
Greg Kroah-Hartman
59911be7e5 Revert "once: Fix panic when module unload"
This reverts commit 6815e21fe2 which is
commit 1027b96ec9 upstream.

The function __do_once_done() added a new parameter to handle the
problem when unloading modules with that function in it.  Android does
not support module unloading so just revert this as it breaks the kabi.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4d5279c00c64f2f1836837c13c27cea5ed3ea073
2021-09-07 07:58:44 +02:00
Greg Kroah-Hartman
4b20d2de0b Revert "pipe: avoid unnecessary EPOLLET wakeups under normal loads"
This reverts commit e91da23c1b which is
commit 3b844826b6 upstream.

It is a nice pipe benchmark improvement, but not really needed for the
android trees, especially as it breaks the abi, so revert it.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie785d08c9f6bea569c9cf5623736fa303bff56b1
2021-09-06 14:28:23 +02:00
Greg Kroah-Hartman
b6e7497caf Revert "pipe: do FASYNC notifications for every pipe IO, not just state changes"
This reverts commit 3b2018f9c9 which is
commit fe67f4dd8d upstream.

It is a nice pipe benchmark improvement, but not really needed for the
android trees, especially as it breaks the abi, so revert it.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iad762803506a73baa89def463c610d493f8d0bfd
2021-09-06 14:27:35 +02:00
Hans de Goede
03bf239b59 UPSTREAM: usb: typec: tcpm: Add support for altmodes
Add support for altmodes described in the usb-connector fwnode
associated with the Type-C controller by calling the new
typec_port_register_altmodes_from_fwnode() helper for this.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210409134033.105834-3-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I0d7de11b08f1c297e78c7f4cbea90b6d85f8abe5
Signed-off-by: yubing.zhang <yubing.zhang@rock-chips.com>
(cherry picked from commit 55d8b34772)
2021-09-06 20:16:51 +08:00
Tao Huang
afaeb74a36 usb: typec: typec_port_register_altmodes() depends on CONFIG_NO_GKI
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I030231375933eabe85c2c15cc6e9bd96748fa934
2021-09-06 20:16:51 +08:00
Hans de Goede
9cf9c33b76 UPSTREAM: usb: typec: Add typec_port_register_altmodes()
This can be used by Type-C controller drivers which use a standard
usb-connector fwnode, with altmodes sub-node, to describe the available
altmodes.

Note there are is no devicetree bindings documentation for the altmodes
node, this is deliberate. ATM the fwnodes used to register the altmodes
are only used internally to pass platform info from a drivers/platform/x86
driver to the type-c subsystem.

When a devicetree user of this functionally comes up and the dt-bindings
have been hashed out the internal use can be adjusted to match the
dt-bindings.

Currently the typec_port_register_altmodes() function expects
an "altmodes" child fwnode on port->dev with this "altmodes" fwnode having
child fwnodes itself with each child containing 2 integer properties:

1. A "svid" property, which sets the id of the altmode, e.g. displayport
altmode has a svid of 0xff01.

2. A "vdo" property, typically used as a bitmask describing the
capabilities of the altmode, the bits in the vdo are specified in the
specification of the altmode.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210409134033.105834-2-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Ib78f0b67b985751a32b6f42e79c7976f5515f6b2
Signed-off-by: yubing.zhang <yubing.zhang@rock-chips.com>
(cherry picked from commit 7b458a4c5d)
2021-09-06 20:16:51 +08:00
Zefa Chen
5f3c2be123 phy: rockchip: mipi-rx-dphy: fix compile error
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Id883341c7d91dda5d45a36442bd504393dd8fd76
2021-09-06 19:38:30 +08:00
Tobias Schramm
555b11d168 UPSTREAM: spi: rockchip: handle zero length transfers without timing out
Previously zero length transfers submitted to the Rokchip SPI driver would
time out in the SPI layer. This happens because the SPI peripheral does
not trigger a transfer completion interrupt for zero length transfers.

Fix that by completing zero length transfers immediately at start of
transfer.

(cherry picked from commit 5457773ef9)
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Change-Id: I0c14eee10fbf0ffd2938d52b6d0c88910d8fd9d7
2021-09-06 19:37:12 +08:00
Jon Lin
d54e777875 UPSTREAM: spi: rockchip-sfc: Remove redundant IO operations
Coherent dma buffer is uncached and memcpy is enough.

(cherry picked from commit 8d00f98194)
Change-Id: Ie11dae881c4a51f783f00c628442092cd9be81a5
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-06 19:37:12 +08:00
Colin Ian King
f396f06dcd UPSTREAM: spi: rockchip-sfc: Fix assigned but never used return error codes
Currently there are two places where the error return variable ret is
being assigned -ETIMEDOUT on timeout errors and this value is not
being returned. Fix this by returning -ETIMEDOUT rather than redundantly
assigning it to ret.

(cherry picked from commit 745649c59a)
Addresses-Coverity: ("Unused value")
Fixes: 0b89fc0a36 ("spi: rockchip-sfc: add rockchip serial flash controller")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Change-Id: I0d92c38cbc2c0d9b663c6e5107ee8b4b73290c74
2021-09-06 19:37:12 +08:00
Chris Morgan
b7f1f596d1 UPSTREAM: spi: rockchip-sfc: add rockchip serial flash controller
Add the rockchip serial flash controller (SFC) driver.

(cherry picked from commit 0b89fc0a36)
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Tested-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20210812134546.31340-3-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Change-Id: I9accd02b355d9c9ea4cf05f7bd1216d01df12aa2
2021-09-06 19:37:12 +08:00
Chris Morgan
ccafbb753c UPSTREAM: spi: rockchip-sfc: Bindings for Rockchip serial flash controller
Add bindings for the Rockchip serial flash controller. New device
specific parameter of rockchip,sfc-no-dma included in documentation.

(cherry picked from commit 538d7c2ed7)
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Tested-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20210812134546.31340-2-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Change-Id: I3126a6f39044c6c5dce4a92ba04b1b93c784c6a5
2021-09-06 19:37:12 +08:00
Elaine Zhang
de8a7dc11e clk: rockchip: rk3588: export clk_gmac id
The mux of Clk_gmac is special and is in the php_grf register.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I678f87a48b04a9701029f455d2e67378ca9072b6
2021-09-06 19:18:27 +08:00
Elaine Zhang
f2e0ab3238 arm64: dts: rockchip: rk3588: add rockchip,grf for cru node
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I0d6091f0a3efd672acf8a21cb0b3244e51ef475c
2021-09-06 19:18:13 +08:00
David Wu
91dd9f5729 arm64: boot: dts: rockchip: Add i2c6 ~ i2c8 nodes for rk3588
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ic123685e5814a1e814a3cd16e18c6885aeec90df
2021-09-06 19:04:19 +08:00
David Wu
4927ac44de dt-bindings: net: rockchip-dwmac: add rv1126 compatible string
Add compatible string for RV1126 gmac, and constrain it to
be compatible with Synopsys dwmac 4.20a.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I1df64ba422fc44dc4887ab1de3916fbfb165a4e7
2021-09-06 18:58:53 +08:00
Ezequiel Garcia
21cada760c UPSTREAM: dt-bindings: net: rockchip-dwmac: add rk3568 compatible string
Add compatible string for RK3568 gmac, and constrain it to
be compatible with Synopsys dwmac 4.20a.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry-picked from f9da1c9d7f)
Change-Id: Ied235b90f32a368f434280f9233c2446bdcd40d3
Signed-off-by: David Wu <david.wu@rock-chips.com>
2021-09-06 18:58:33 +08:00
Tobias Schramm
c372cd663c UPSTREAM: dt-bindings: net: rockchip-dwmac: add rk3308 gmac compatible
The Rockchip RK3308 has a gmac that is not fully compatible with any of the
other Rockchip gmacs.
This patch adds a compatible string for it.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry-picked from 2cc8c910f5)
Change-Id: Ia9aaf7af18175b814a95252376fd299a6156f7d1
Signed-off-by: David Wu <david.wu@rock-chips.com>
2021-09-06 18:58:33 +08:00
Ezequiel Garcia
91df479e31 UPSTREAM: dt-bindings: net: convert rockchip-dwmac to json-schema
Convert Rockchip dwmac controller dt-bindings to YAML.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry-picked from b331b8ef86)
Change-Id: Ibb8e639fea8532260df3444e0deccf108affe70f
2021-09-06 18:58:33 +08:00
Ezequiel Garcia
e3a2a37fa6 UPSTREAM: dt-bindings: net: dwmac: Add Rockchip DWMAC support
Add Rockchip DWMAC controllers, which are based on snps,dwmac.
Some of the SoCs require up to eight clocks, so maxItems
for clocks and clock-names need to be increased.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 517a882aa2)
Change-Id: Ie758eda2091dac5081bed325e2169a23ee3dc311
2021-09-06 18:58:33 +08:00
Tao Huang
09bf3f24b1 arm64: rockchip_defconfig: Enable CONFIG_RT_SOFTINT_OPTIMIZATION
According to gki commit a0e331ecd3 ("ANDROID: GKI: Enable CONFIG_RT_SOFTINT_OPTIMIZATION").

This config helps address audio buffer underrun issues on arm64 targets.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I1d75b165a8f7afc9e53a28f89e1922c0d4deb726
2021-09-06 18:16:00 +08:00
Jiewen Wang
955f917251 ANDROID: vendor_hooks: Add hook in try_to_unmap_one()
Add hook in try_to_unmap_one() to trace this function for debug memory
swap bugs.

Bug: 198385827
Change-Id: I1fdbe60e09bb491b949e06a07133710453ecca03
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
2021-09-06 17:00:04 +08:00
Jiewen Wang
878e0caa77 ANDROID: vendor_hooks: Add hook in mmap_region()
Add hook in mmap_region() to record the vma and address information
of monitored processes.

Bug: 198385827
Change-Id: I0bde29113b47ca7f4a9f5d42a54188e791ca3b7e
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
2021-09-06 16:51:38 +08:00
Liang Chen
dc824982a5 softirq: retrieve wakeup_softirqd()
We need call wakeup_softirqd() for the softirqs not completed in irq_exit()
when CONFIG_RT_SOFTINT_OPTIMIZATION is not defined.

Fixes: 0578248bed ("ANDROID: softirq: defer softirq processing to ksoftirqd if CPU is busy with RT")
Change-Id: Id71afcd252ddc69d97ec5167845c602f3aaba3ac
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-09-06 16:18:59 +08:00
Sugar Zhang
8bce8175e3 UPSTREAM: ASoC: rockchip: i2s: Fix concurrency between tx/rx
This patch adds lock to fix comcurrency between tx/rx
to fix 'rockchip-i2s ff070000.i2s; fail to clear'

Considering the situation;

       tx stream              rx stream
           |                      |
           |                   disable
         enable                   |
           |                    reset

After this patch:

         lock
           |
       tx stream
           |
         enable
           |
        unlock
       --------               ---------
                                lock
                                  |
                              rx stream
                                  |
                               disable
                                  |
                                reset
                                  |
                               unlock

Change-Id: Idc2f7586772a1051b6926ad1558f401b87f71978
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1630674434-650-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit fcb958ee8e)
2021-09-06 16:16:00 +08:00
Sugar Zhang
723a615b45 UPSTREAM: ASoC: rockchip: i2s: Add support for frame inversion
This patch adds support for frame inversion.

Change-Id: I008686fe3084b7805dacede76350a4c6a696e36b
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950594-14345-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 917f07719b)
2021-09-06 16:16:00 +08:00
Sugar Zhang
c2a7461c38 UPSTREAM: ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs
This patch adds compatible strings for more SoCs.

Change-Id: Ic68c30d38fc086f7c38a2deff2abd88ee4cbc14d
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629950594-14345-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit d5ceed036f)
2021-09-06 16:16:00 +08:00
Sugar Zhang
f0cde942a2 UPSTREAM: ASoC: rockchip: i2s: Add compatible for more SoCs
This patch adds more compatible strings for SoCs.

Change-Id: I4238842f559d89b24fefc1d3bfebb9e8a64de3bd
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-5-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit f005dc6db1)
2021-09-06 16:16:00 +08:00
Sugar Zhang
ca35f030a7 UPSTREAM: ASoC: rockchip: i2s: Make playback/capture optional
There are some controllers which support playback only or
capture only. so, make it optional. and initial capability
by 'dma-names' of DT.

Change-Id: I6e3b519217e02db49ea7593cf356d138c14741d3
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 4455f26a55)
2021-09-06 16:16:00 +08:00
Xiaotan Luo
6f28200648 UPSTREAM: ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B
- DSP_A: PCM delay 1 bit mode, L data MSB after FRM LRC
- DSP_B: PCM no delay mode, L data MSB during FRM LRC

Change-Id: I9af4d98cf3c9fd9699093c44dba600d2fcfebdeb
Signed-off-by: Xiaotan Luo <lxt@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 1bf56843e6)
2021-09-06 16:16:00 +08:00
Sugar Zhang
f1e03c22c5 UPSTREAM: ASoC: dt-bindings: rockchip: Document reset property for i2s
This patch documents reset property for i2s.

Change-Id: I758123e579195ffbe6f6dfe5550a751d880c4a1b
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629950562-14281-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 296713a360)
2021-09-06 16:16:00 +08:00
Sugar Zhang
25fb9fce0e UPSTREAM: ASoC: rockchip: i2s: Fix regmap_ops hang
API 'set_fmt' maybe called when PD is off, in the situation,
any register access will hang the system. so, enable PD
before r/w register.

Change-Id: I142537194d0ee279118a1d8d1377ca3c88ef68a9
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 53ca9b9777)
2021-09-06 16:16:00 +08:00
Sugar Zhang
3752871a8c UPSTREAM: ASoC: rockchip: i2s: Improve dma data transfer efficiency
This patch changes dma data burst from 4 to 8 to improve
data transfer efficiency.

Change-Id: I0c33b4c37581ff4212dd86a936c7215fab9207b1
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 7a2df53bc0)
2021-09-06 16:16:00 +08:00
Sugar Zhang
559b95ba2c UPSTREAM: ASoC: rockchip: i2s: Fixup clk div error
MCLK maybe not precise as required because of PLL,
but which still can be used and no side effect. so,
using DIV_ROUND_CLOSEST instead div.

e.g.

set mclk to 11289600 Hz, but get 11289598 Hz.

Change-Id: If622b02308860ef731047c05b675239554b7879e
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 6b76bcc004)
2021-09-06 16:16:00 +08:00
Sugar Zhang
2ca4af8b6d UPSTREAM: ASoC: rockchip: i2s: Add support for set bclk ratio
This patch adds support for set bclk ratio from machine driver.

Change-Id: Id2ffa4f0e50fa0c2c36fa3eace4d47b901a7820c
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit ebfea67125)
2021-09-06 16:16:00 +08:00
Sugar Zhang
e09d949bc7 UPSTREAM: ASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif
This patch adds compatible string for rk3568 spdif.

Change-Id: Idf2ed43ca8186f62efa732ca7e0be5377709c1d1
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629800162-12824-5-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit e79ef3c2cf)
2021-09-06 16:16:00 +08:00
Sugar Zhang
8d8d68847f UPSTREAM: ASoC: rockchip: spdif: Add support for rk3568 spdif
This patch adds support for rk3568 spdif which is the same
with rk3366.

Change-Id: I0b874471afda6c48283131aeb02e10de893673a7
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit c5d4f09feb)
2021-09-06 16:16:00 +08:00
Sugar Zhang
d2f314d9f5 UPSTREAM: ASoC: rockchip: spdif: Fix some coding style
This patch fix some coding style.

Change-Id: I41dfa8a6b04cfdcd716a929a9eec7f27dee49fcb
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit acc8b9d117)
2021-09-06 16:16:00 +08:00
Sugar Zhang
ef49a84f7a UPSTREAM: ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile
This patch marks SPDIF_SMPDR as volatile to make it resaonable,
which also requires marking it as readable, even though it isn't.

Change-Id: If74b1f79da6695af05ac08028c6637d8cfc5c4c9
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 023a3f3a1c)
2021-09-06 16:16:00 +08:00
Yang Yingliang
9ee45b537d UPSTREAM: ASoC: rockchip: spdif: Use devm_platform_get_and_ioremap_resource()
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Change-Id: I6a9ed25c24734e8b34c3f27aa610d7ce99a0f25a
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210615141502.1683686-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit 3325b1515a)
2021-09-06 16:16:00 +08:00