linux-stable/drivers
Jonas Karlman 92e2dcf941 iommu: rockchip: Fix directory table address encoding
[ Upstream commit 6df63b7ebd ]

The physical address to the directory table is currently encoded using
the following bit layout for IOMMU v2.

 31:12 - Address bit 31:0
 11: 4 - Address bit 39:32

This is also the bit layout used by the vendor kernel.

However, testing has shown that addresses to the directory/page tables
and memory pages are all encoded using the same bit layout.

IOMMU v1:
 31:12 - Address bit 31:0

IOMMU v2:
 31:12 - Address bit 31:0
 11: 8 - Address bit 35:32
  7: 4 - Address bit 39:36

Change to use the mk_dtentries ops to encode the directory table address
correctly. The value written to DTE_ADDR may include the valid bit set,
a bit that is ignored and DTE_ADDR reg read it back as 0.

This also update the bit layout comment for the page address and the
number of nybbles that are read back for DTE_ADDR comment.

These changes render the dte_addr_phys and dma_addr_dte ops unused and
is removed.

Fixes: 227014b33f ("iommu: rockchip: Add internal ops to handle variants")
Fixes: c55356c534 ("iommu: rockchip: Add support for iommu v2")
Fixes: c987b65a57 ("iommu/rockchip: Fix physical address decoding")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20230617182540.3091374-2-jonas@kwiboo.se
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-13 09:42:50 +02:00
..
accessibility
acpi ACPI: x86: s2idle: Fix a logic error parsing AMD constraints table 2023-09-13 09:42:29 +02:00
amba
android
ata ata: pata_arasan_cf: Use dev_err_probe() instead dev_err() in data_xfer() 2023-09-13 09:42:23 +02:00
atm
auxdisplay
base regmap: rbtree: Use alloc_flags for memory allocations 2023-09-13 09:42:31 +02:00
bcma
block ublk: remove check IO_URING_F_SQE128 in ublk_ch_uring_cmd 2023-08-30 16:11:11 +02:00
bluetooth Bluetooth: btusb: Do not call kfree_skb() under spin_lock_irqsave() 2023-09-13 09:42:34 +02:00
bus bus: ti-sysc: Fix cast to enum warning 2023-09-13 09:42:43 +02:00
cdrom
char ipmi:ssif: Fix a memory leak when scanning for an adapter 2023-09-13 09:42:44 +02:00
clk clk: imx: composite-8m: fix clock pauses when set_rate would be a no-op 2023-09-13 09:42:47 +02:00
clocksource
comedi
connector
counter
cpufreq cpufreq: powernow-k8: Use related_cpus instead of cpus in driver.exit() 2023-09-13 09:42:30 +02:00
cpuidle powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-09-13 09:42:48 +02:00
crypto crypto: caam - fix unchecked return value error 2023-09-13 09:42:33 +02:00
cxl
dax
dca
devfreq
dio
dma idmaengine: make FSL_EDMA and INTEL_IDMA64 depends on HAS_IOMEM 2023-09-13 09:42:24 +02:00
dma-buf dma-buf/sw_sync: Avoid recursive lock during fence signal 2023-08-30 16:11:12 +02:00
edac EDAC/igen6: Fix the issue of no error events 2023-09-13 09:42:45 +02:00
eisa
extcon
firewire firewire: net: fix use after free in fwnet_finish_incoming_packet() 2023-08-23 17:52:24 +02:00
firmware firmware: cs_dsp: Fix new control name check 2023-09-13 09:42:44 +02:00
fpga
fsi fsi: master-ast-cf: Add MODULE_FIRMWARE macro 2023-09-06 21:27:02 +01:00
gnss
gpio gpio: sim: pass the GPIO device's software node to irq domain 2023-08-30 16:11:13 +02:00
gpu drm/radeon: Use RMW accessors for changing LNKCTL 2023-09-13 09:42:47 +02:00
greybus
hid HID: wacom: remove the battery when the EKR is off 2023-09-06 21:27:01 +01:00
hsi
hte
hv
hwmon hwmon: (tmp513) Fix the channel number in tmp51x_is_visible() 2023-09-13 09:42:35 +02:00
hwspinlock
hwtracing
i2c i2c: designware: Handle invalid SMBus block data response length value 2023-08-23 17:52:31 +02:00
i3c
idle
iio
infiniband RDMA/qedr: Remove a duplicate assignment in irdma_query_ah() 2023-09-13 09:42:49 +02:00
input Input: i8042 - add quirk for TUXEDO Gemini 17 Gen1/Clevo PD70PN 2023-09-13 09:42:26 +02:00
interconnect
iommu iommu: rockchip: Fix directory table address encoding 2023-09-13 09:42:50 +02:00
ipack
irqchip irqchip/loongson-eiointc: Fix return value checking of eiointc_index 2023-09-13 09:42:29 +02:00
isdn
leds led: qcom-lpg: Fix resource leaks in for_each_available_child_of_node() loops 2023-08-23 17:52:23 +02:00
macintosh
mailbox
mcb
md md: raid0: account for split bio in iostat accounting 2023-09-13 09:42:44 +02:00
media media: v4l2-core: Fix a potential resource leak in v4l2_fwnode_parse_link() 2023-09-13 09:42:49 +02:00
memory
memstick
message
mfd
misc accel/habanalabs: add pci health check during heartbeat 2023-08-23 17:52:21 +02:00
mmc mmc: au1xmmc: force non-modular build and remove symbol_get usage 2023-09-06 21:26:59 +01:00
most
mtd
mux
net wifi: ath10k: Use RMW accessors for changing LNKCTL 2023-09-13 09:42:48 +02:00
nfc
ntb
nubus
nvdimm nvdimm: Fix dereference after free in register_nvdimm_pmu() 2023-09-13 09:42:47 +02:00
nvme nvme-rdma: fix potential unbalanced freeze & unfreeze 2023-08-16 18:27:30 +02:00
nvmem
of of: unittest: Fix overlay type in apply/revert check 2023-09-13 09:42:44 +02:00
opp OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-13 09:42:28 +02:00
parisc
parport
pci PCI/ASPM: Use RMW accessors for changing LNKCTL 2023-09-13 09:42:46 +02:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-23 17:52:24 +02:00
peci
perf perf/imx_ddr: don't enable counter0 if none of 4 counters are used 2023-09-13 09:42:29 +02:00
phy phy: qcom-snps-femto-v2: use qcom_snps_hsphy_suspend/resume error code 2023-09-13 09:42:20 +02:00
pinctrl pinctrl: mcp23s08: check return value of devm_kasprintf() 2023-09-13 09:42:46 +02:00
platform platform/mellanox: Fix mlxbf-tmfifo not handling all virtio CONSOLE notifications 2023-09-13 09:42:25 +02:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-06 21:27:00 +01:00
s390 s390/pkey: fix PKEY_TYPE_EP11_AES handling for sysfs attributes 2023-09-13 09:42:29 +02:00
sbus
scsi scsi: lpfc: Fix incorrect big endian type assignment in bsg loopback path 2023-09-13 09:42:25 +02:00
sh
siox
slimbus
soc soc: qcom: smem: Fix incompatible types in comparison 2023-09-13 09:42:42 +02:00
soundwire
spi spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe() 2023-09-13 09:42:31 +02:00
spmi
ssb
staging staging: fbtft: ili9341: use macro FBTFT_REGISTER_SPI_DRIVER 2023-09-13 09:42:23 +02:00
target
tc
tee
thermal thermal/of: Fix potential uninitialized value access 2023-09-13 09:42:29 +02:00
thunderbolt thunderbolt: Fix a backport error for display flickering issue 2023-09-02 09:16:20 +02:00
tty serial: sc16is7xx: fix bug when first setting GPIO direction 2023-09-06 21:27:02 +01:00
ufs scsi: ufs: Try harder to change the power mode 2023-09-13 09:42:20 +02:00
uio
usb usb: typec: tcpci: clear the fault status bit 2023-09-06 21:27:03 +01:00
vdpa vdpa: Enable strict validation for netlinks ops 2023-08-23 17:52:31 +02:00
vfio vfio/type1: fix cap_migration information leak 2023-09-13 09:42:47 +02:00
vhost
video video/aperture: Move vga handling to pci function 2023-08-30 16:10:58 +02:00
virt
virtio virtio-mmio: don't break lifecycle of vm_dev 2023-08-23 17:52:29 +02:00
vlynq
w1
watchdog watchdog: sp5100_tco: support Hygon FCH/SCH (Server Controller Hub) 2023-08-23 17:52:25 +02:00
xen
zorro
Kconfig
Makefile