s390/pci: improve DMA translation init and exit
authorNiklas Schnelle <schnelle@linux.ibm.com>
Fri, 16 Jul 2021 09:53:37 +0000 (11:53 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 25 Aug 2021 09:03:34 +0000 (11:03 +0200)
commit1f3f76812d5dfc791193b39c2140a8bd09962c0e
tree8f61dd33029e218e765af3ad8753856ad6d5881b
parentcc049eecfb7adc4bfecd05eb25e425d8def96fce
s390/pci: improve DMA translation init and exit

Currently zpci_dma_init_device()/zpci_dma_exit_device() is called as
part of zpci_enable_device()/zpci_disable_device() and errors for
zpci_dma_exit_device() are always ignored even if we could abort.

Improve upon this by moving zpci_dma_exit_device() out of
zpci_disable_device() and check for errors whenever we have a way to
abort the current operation. Note that for example in
zpci_event_hard_deconfigured() the device is expected to be gone so we
really can't abort and proceed even in case of error.

Similarly move the cc == 3 special case out of zpci_unregister_ioat()
and into the callers allowing to abort when finding an already disabled
devices precludes proceeding with the operation.

While we are at it log IOAT register/unregister errors in the s390
debugfs log,

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/pci.h
arch/s390/include/asm/pci_dma.h
arch/s390/pci/pci.c
arch/s390/pci/pci_bus.c
arch/s390/pci/pci_dma.c
arch/s390/pci/pci_event.c
arch/s390/pci/pci_sysfs.c
drivers/iommu/s390-iommu.c