linux-stable/arch/s390
Niklas Schnelle 59bbf59679 iommu/s390: Make attach succeed even if the device is in error state
If a zPCI device is in the error state while switching IOMMU domains
zpci_register_ioat() will fail and we would end up with the device not
attached to any domain. In this state since zdev->dma_table == NULL
a reset via zpci_hot_reset_device() would wrongfully re-initialize the
device for DMA API usage using zpci_dma_init_device(). As automatic
recovery is currently disabled while attached to an IOMMU domain this
only affects slot resets triggered through other means but will affect
automatic recovery once we switch to using dma-iommu.

Additionally with that switch common code expects attaching to the
default domain to always work so zpci_register_ioat() should only fail
if there is no chance to recover anyway, e.g. if the device has been
unplugged.

Improve the robustness of attach by specifically looking at the status
returned by zpci_mod_fc() to determine if the device is unavailable and
in this case simply ignore the error. Once the device is reset
zpci_hot_reset_device() will then correctly set the domain's DMA
translation tables.

Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/r/20221109142903.4080275-2-schnelle@linux.ibm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2022-11-19 10:28:15 +01:00
..
appldata
boot s390/boot: add secure boot trailer 2022-10-26 14:47:31 +02:00
configs s390: update defconfigs 2022-08-30 21:57:07 +02:00
crypto crypto: Kconfig - simplify cipher entries 2022-08-26 18:50:43 +08:00
hypfs s390/hypfs: avoid error message under KVM 2022-08-15 17:19:51 +02:00
include iommu/s390: Make attach succeed even if the device is in error state 2022-11-19 10:28:15 +01:00
kernel s390/pai: fix raw data collection for PMU pai_ext 2022-10-26 14:47:31 +02:00
kvm iommu/s390: Make attach succeed even if the device is in error state 2022-11-19 10:28:15 +01:00
lib s390/uaccess: add missing EX_TABLE entries to __clear_user() 2022-10-26 14:47:30 +02:00
mm treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
net s390/bpf: Fix typo in comment 2022-05-23 11:25:53 -07:00
pci iommu/s390: Make attach succeed even if the device is in error state 2022-11-19 10:28:15 +01:00
purgatory s390/purgatory: remove duplicated build rule of kexec-purgatory.o 2022-06-30 14:18:16 +02:00
tools KVM: s390: Add facility 197 to the allow list 2022-07-13 15:25:25 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig Random number generator updates for Linux 6.0-rc1. 2022-08-02 17:31:35 -07:00
Kconfig.debug s390/Kconfig.debug: fix indentation 2022-06-01 12:03:15 +02:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00