The vfio_ap_mdev_unlink_adapter and vfio_ap_mdev_unlink_domain functions
add the associated vfio_ap_queue objects to the hashtable that links them
to the matrix mdev to which their APQN is assigned. In order to unlink
them, they must be deleted from the hashtable; if not, they will continue
to be reset whenever userspace closes the mdev fd or removes the mdev.
This patch fixes that issue.
Cc: stable(a)vger.kernel.org
Fixes: 70aeefe574cb ("s390/vfio-ap: reset queues after adapter/domain unassignment")
Reported-by: Tony Krowiak <akrowiak(a)linux.ibm.com>
Signed-off-by: Tony Krowiak <akrowiak(a)linux.ibm.com>
---
drivers/s390/crypto/vfio_ap_ops.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
index ee82207b4e60..2493926b5dfb 100644
--- a/drivers/s390/crypto/vfio_ap_ops.c
+++ b/drivers/s390/crypto/vfio_ap_ops.c
@@ -1049,8 +1049,7 @@ static void vfio_ap_mdev_unlink_adapter(struct ap_matrix_mdev *matrix_mdev,
if (q && qtable) {
if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) &&
test_bit_inv(apqi, matrix_mdev->shadow_apcb.aqm))
- hash_add(qtable->queues, &q->mdev_qnode,
- q->apqn);
+ vfio_ap_unlink_queue_fr_mdev(q);
}
}
}
@@ -1236,8 +1235,7 @@ static void vfio_ap_mdev_unlink_domain(struct ap_matrix_mdev *matrix_mdev,
if (q && qtable) {
if (test_bit_inv(apid, matrix_mdev->shadow_apcb.apm) &&
test_bit_inv(apqi, matrix_mdev->shadow_apcb.aqm))
- hash_add(qtable->queues, &q->mdev_qnode,
- q->apqn);
+ vfio_ap_unlink_queue_fr_mdev(q);
}
}
}
--
2.31.1
On stable-rc 5.15 arm builds failed due to following errors / warnings.
arch/arm/mach-at91/pm.c: In function 'at91_suspend_finish':
arch/arm/mach-at91/pm.c:370:52: error: 'DDR3PHY_ZQ0SR0' undeclared
(first use in this function)
370 | tmp = readl(soc_pm.data.ramc_phy + DDR3PHY_ZQ0SR0);
| ^~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:35:51: note: in
definition of macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
arch/arm/include/asm/io.h:303:46: note: in expansion of macro 'readl_relaxed'
303 | #define readl(c) ({ u32 __v = readl_relaxed(c);
__iormb(); __v; })
| ^~~~~~~~~~~~~
arch/arm/mach-at91/pm.c:370:23: note: in expansion of macro 'readl'
370 | tmp = readl(soc_pm.data.ramc_phy + DDR3PHY_ZQ0SR0);
| ^~~~~
arch/arm/mach-at91/pm.c:370:52: note: each undeclared identifier is
reported only once for each function it appears in
370 | tmp = readl(soc_pm.data.ramc_phy + DDR3PHY_ZQ0SR0);
| ^~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:35:51: note: in
definition of macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
arch/arm/include/asm/io.h:303:46: note: in expansion of macro 'readl_relaxed'
303 | #define readl(c) ({ u32 __v = readl_relaxed(c);
__iormb(); __v; })
| ^~~~~~~~~~~~~
arch/arm/mach-at91/pm.c:370:23: note: in expansion of macro 'readl'
370 | tmp = readl(soc_pm.data.ramc_phy + DDR3PHY_ZQ0SR0);
| ^~~~~
arch/arm/mach-at91/pm.c:373:33: error: 'DDR3PHY_ZQ0SR0_PDO_OFF'
undeclared (first use in this function)
373 | index = (tmp >> DDR3PHY_ZQ0SR0_PDO_OFF) & 0x1f;
| ^~~~~~~~~~~~~~~~~~~~~~
arch/arm/mach-at91/pm.c:377:33: error: 'DDR3PHY_ZQ0SR0_PUO_OFF'
undeclared (first use in this function)
377 | index = (tmp >> DDR3PHY_ZQ0SR0_PUO_OFF) & 0x1f;
| ^~~~~~~~~~~~~~~~~~~~~~
arch/arm/mach-at91/pm.c:381:33: error: 'DDR3PHY_ZQ0SR0_PDODT_OFF'
undeclared (first use in this function)
381 | index = (tmp >> DDR3PHY_ZQ0SR0_PDODT_OFF) & 0x1f;
| ^~~~~~~~~~~~~~~~~~~~~~~~
arch/arm/mach-at91/pm.c:385:33: error: 'DDR3PHY_ZQ0SRO_PUODT_OFF'
undeclared (first use in this function)
385 | index = (tmp >> DDR3PHY_ZQ0SRO_PUODT_OFF) & 0x1f;
| ^~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:289: arch/arm/mach-at91/pm.o] Error 1
Reported-by: Linux Kernel Functional Testing <lkft(a)linaro.org>
Build link:
- https://builds.tuxbuild.com/2EfrKWiY7k1znh1Nt7nFQmRuyRc/
# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake
#
tuxmake --runtime podman --target-arch arm --toolchain gcc-11
--kconfig at91_dt_defconfig
Following patch seems to be causing these build failures on stable-rc 5.15.
---
ARM: at91: pm: fix DDR recalibration when resuming from backup and self-refresh
[ Upstream commit 7a94b83a7dc551607b6c4400df29151e6a951f07 ]
On SAMA7G5, when resuming from backup and self-refresh, the bootloader
performs DDR PHY recalibration by restoring the value of ZQ0SR0 (stored
in RAM by Linux before going to backup and self-refresh). It has been
discovered that the current procedure doesn't work for all possible values
that might go to ZQ0SR0 due to hardware bug. The workaround to this is to
avoid storing some values in ZQ0SR0. Thus Linux will read the ZQ0SR0
register and cache its value in RAM after processing it (using
modified_gray_code array). The bootloader will restore the processed value.
Fixes: d2d4716d8384 ("ARM: at91: pm: save ddr phy calibration data to securam")
Suggested-by: Frederic Schumacher <frederic.schumacher(a)microchip.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea(a)microchip.com>
Link: https://lore.kernel.org/r/20220826083927.3107272-4-claudiu.beznea@microchip…
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
--
Linaro LKFT
https://lkft.linaro.org