the vop is binded before iommu init, if alloc hdr gem object in
vop bind stage, which may get the wrong dma address. To fix this
issue, alloc hdr gem object when first used it.
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I99359cc345cb49aee1ce34ff6d5ee33d04ac2283
Add a vendor hook to arch_setup_dma_ops to allow vendors to perform
any necessary post-actions on setting up DMA ops for a given device,
focusing mainly on enabling those to opt-in for the Cortex-A510
erratum 2454944.
Bug: 263236925
Change-Id: I6fd4d3a30829437fc113ec15ca2e5d060a38e60c
Signed-off-by: Beata Michalska <beata.michalska@arm.com>
Cortex-A510 erratum 2454944 may cause clean cache lines to be
erroneously written back to memory, breaking the assumptions we rely on
for non-coherent DMA. Try to mitigate this by implementing special DMA
ops that do their best to avoid cacheable aliases via a combination of
bounce-buffering and manipulating the linear map directly, to minimise
the chance of DMA-mapped pages being speculated back into caches.
The other main concern is initial entry, where cache lines covering the
kernel image might potentially become affected between being cleaned by
the bootloader and the kernel being called, which might require additional
cache maintenance from the bootloader to be safe in that regard too.
Cortex-A510 supports S2FWB, so KVM should be unaffected.
For the workaround to be applied, it needs to be explicitly requested
through dedicated arm64_noalias_setup_dma_ops callback.
Bug: 223346425
(cherry picked from commit 683efc5fc6eeb653caf85c33a2fb92a33c8faa75
https://git.gitlab.arm.com/linux-arm/linux-rm.git arm64/2454944-dev)
Change-Id: If76b97dc39c278edb80f9b750129975ab2ac563e
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
[BM: Stripping-down the original solution by removing support for
cpu capabilities and ammending relevant bits, with the final
version being reduced to dedicated DMA ops with dependencies on
rodata_full being enabled (CONFIG_RODATA_FULL_DEFAULT_ENABLED),
swiotlb late init and disabling lazy tlb flushing.
Also, as a consequence, reducing debugging support.]
Signed-off-by: Beata Michalska <beata.michalska@arm.com>
Add an interface to disable lazy vunmap by forcing the threshold
to zero. This might be interesting for debugging/testing in general,
but primarily helps a horrible situation which needs to guarantee
that vmalloc aliases are up-to-date from atomic context, wherein
the only practical solution is to never let them get stale in
the first place.
Bug: 223346425
(cherry picked from commit 2a34c1503b85f49dd472dfd932dfcd16cab8ee8a
https://git.gitlab.arm.com/linux-arm/linux-rm.git arm64/2454944-dev)
Change-Id: I12fbbe3903f76a028ceea91ed078f0de2abe3815
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
[BM: Convert to a flag that can be explicitly modified at runtime
instead of relying on arch specific bits]
Signed-off-by: Beata Michalska <beata.michalska@arm.com>
Use aviif_chg_irq interrupts to monitor scenarios where
the TMDS signal is not disconnected but the resolution,
frame rate, color range or image format changes.
Change-Id: I2f6e3d0d734de1c5a8033b00d3b6b14d1815f6ca
Signed-off-by: Wangqiang Guo <kay.guo@rock-chips.com>
As the number of Rockchip drivers increase, entries in SoC menu looks
scattered with other SoC drivers. Make a submenu for Rockchip drivers
to make it visibly clear while selecting Rockchip SoC specific drivers.
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ia657e184a32c9b28f6ddd585838890ba5ec814cf
There is a race contition seen in rockchip platform which seems expose a long
existing bug in PCI sysfs code.
1. pci_bus_add_device() called pcibios_bus_add_device() or
pci_fixup_device() but have not called pci_create_sysfs_dev_files() yet.
Meanwhile pci_sysfs_init() is running and pci_create_sysfs_dev_files()
was called for newly registered device. In this case function
pci_create_sysfs_dev_files() is called two times, ones from
pci_bus_add_device() and once from pci_sysfs_init().
2. pci_sysfs_init() is called. It first sets sysfs_initialized to 1
which unblock calling pci_create_sysfs_dev_files(). Then another bus
registers new PCI device and calls pci_bus_add_device() which calls
pci_create_sysfs_dev_files() and registers sysfs files. Function
pci_sysfs_init() continues execution and calls function
pci_create_sysfs_dev_files() also for this newly registered device. So
pci_create_sysfs_dev_files() is again called two times.
The call trace looks like:
[ 2.822232] [ T143] sysfs: cannot create duplicate filename '/devices/platform/fe170000.pcie/pci0002:20/0002:20:00.0/0002:21:00.0/config'
[ 2.822240] [ T143] CPU: 1 PID: 143 Comm: rk-pcie Not tainted 5.10.66 #56
[ 2.822245] [ T143] Hardware name: Telpo RK3588 F206 Board (DT)
[ 2.822251] [ T143] Call trace:
[ 2.822262] [ T143] dump_backtrace+0x0/0x1c8
[ 2.822269] [ T143] show_stack+0x1c/0x2c
[ 2.822276] [ T143] dump_stack_lvl+0xdc/0x12c
[ 2.822282] [ T143] dump_stack+0x1c/0x64
[ 2.822289] [ T143] sysfs_warn_dup+0x6c/0x8c
[ 2.822296] [ T143] sysfs_create_bin_file+0xe4/0x130
[ 2.822303] [ T143] pci_create_sysfs_dev_files+0x50/0x210
[ 2.822310] [ T143] pci_bus_add_device+0x30/0xac
[ 2.822316] [ T143] pci_bus_add_devices+0x44/0x88
[ 2.822321] [ T143] pci_bus_add_devices+0x70/0x88
[ 2.822327] [ T143] pci_host_probe+0x78/0xb0
[ 2.822335] [ T143] dw_pcie_host_init+0x308/0x3f8
[ 2.822340] [ T143] rk_pcie_really_probe+0x954/0xe04
[ 2.822347] [ T143] kthread+0x13c/0x344
[ 2.822353] [ T143] ret_from_fork+0x10/0x30
There are continuous reporting about this bug[1] can be found here[1].
The above link leads me to the fix[2]. Upstream kernel has contained the fix:
0ad52e381d85eb86906749e2b8073cdc2265844b ("Convert "config" to static attribute")
However there are still corner bugs around directory create. So Bijorn created
a Bugzilla item[3] for it. After a long time, Korneliusz Osmenda pushed a new
patch to fix it. Then we wait for another long period of time without any update.
IMO, [4] is better than other proposes. So just backport the better fix into vendor
tree.
[1] https: //lore.kernel.org/all/m3eebg9puj.fsf@t19.piap.pl/
[2] https: //patchwork.kernel.org/project/linux-pci/patch/20210416205856.3234481-2-kw@linux.com/
[3] Bug: https://bugzilla.kernel.org/show_bug.cgi?id=215515
[4] https: //patchwork.kernel.org/project/linux-pci/patch/4469eba2-188b-aab7-07d1-5c77313fc42f@gmail.com/
Signed-off-by: Korneliusz Osmenda <korneliuszo@gmail.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
[Shawn: backport and reword to explain what happened]
Change-Id: Ib0a54bc2204afa7d9136e8d3156b00ec6aa4d8b3
(cherry-picked from https: //patchwork.kernel.org/project/linux-pci/patch/4469eba2-188b-aab7-07d1-5c77313fc42f@gmail.com/)
Set the rga node to be "disabled" defaultly for rk3288.
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Idccb5dfd79e7bfd5005307f5fba576df1ff03a0d
Fixes: 043ddfca3f ("ARM: dts: rockchip: rk3288: add operating-points-v2 for cpu nodes")
The pvtm driver will find a thermal by name of the thermal node.
This patch fixes a issue as following:
[ 5.215126] cpu cpu0: failed to read out thermal zone (-22)
[ 5.221562] thermal thermal_zone1: binding zone cpu_thermal with cdev thermal-cpufreq-0 failed:-17
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I475e4035ab797f9d374feaddce8fda68af0d522c
The U2PHY sent "peripheral connected" extcon message to DWC3 even if
there is no USB cable pluuged when the otg_sm_work is scheduled first
time, this would be resumed DWC3 unexpectedly and cause the DWC3 gadget
to incorrect state. So initialize the perip_connected to false before
send the extcon message to fix it.
This can fix the ADB can not be enumerated when plug the USB cable
in the first time after the system boot up and the below messages
may find in the Kernel log on RK3562-EVB2 board.
[ 7.218101] read descriptors
[ 7.218191] read strings
[ 7.306784] dwc3 fe500000.usb: failed to enable ep0out
Fixes: 00168bb5b5 ("phy: rockchip: inno-usb2: fix otg port with vbus always on")
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I90209f15605d16ca746dd6c44fbaf6d9c1684eaa
This patch handle HCLK with runtime PM to save a little
bit of power consumption.
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I4ab16fd21d592245a0d0eb2240740f0a90403f0a