@@ -124,14 +124,13 @@ int zpci_register_ioat(struct zpci_dev *zdev, u8 dmaas,
124124 struct zpci_fib fib = {0 };
125125 u8 cc ;
126126
127- WARN_ON_ONCE (iota & 0x3fff );
128127 fib .pba = base ;
129128 /* Work around off by one in ISM virt device */
130129 if (zdev -> pft == PCI_FUNC_TYPE_ISM && limit > base )
131130 fib .pal = limit + (1 << 12 );
132131 else
133132 fib .pal = limit ;
134- fib .iota = iota | ZPCI_IOTA_RTTO_FLAG ;
133+ fib .iota = iota ;
135134 fib .gd = zdev -> gisa ;
136135 cc = zpci_mod_fc (req , & fib , status );
137136 if (cc )
@@ -690,6 +689,23 @@ int zpci_enable_device(struct zpci_dev *zdev)
690689}
691690EXPORT_SYMBOL_GPL (zpci_enable_device );
692691
692+ int zpci_reenable_device (struct zpci_dev * zdev )
693+ {
694+ u8 status ;
695+ int rc ;
696+
697+ rc = zpci_enable_device (zdev );
698+ if (rc )
699+ return rc ;
700+
701+ rc = zpci_iommu_register_ioat (zdev , & status );
702+ if (rc )
703+ zpci_disable_device (zdev );
704+
705+ return rc ;
706+ }
707+ EXPORT_SYMBOL_GPL (zpci_reenable_device );
708+
693709int zpci_disable_device (struct zpci_dev * zdev )
694710{
695711 u32 fh = zdev -> fh ;
@@ -739,7 +755,6 @@ EXPORT_SYMBOL_GPL(zpci_disable_device);
739755 */
740756int zpci_hot_reset_device (struct zpci_dev * zdev )
741757{
742- u8 status ;
743758 int rc ;
744759
745760 lockdep_assert_held (& zdev -> state_lock );
@@ -758,19 +773,9 @@ int zpci_hot_reset_device(struct zpci_dev *zdev)
758773 return rc ;
759774 }
760775
761- rc = zpci_enable_device (zdev );
762- if (rc )
763- return rc ;
764-
765- if (zdev -> dma_table )
766- rc = zpci_register_ioat (zdev , 0 , zdev -> start_dma , zdev -> end_dma ,
767- virt_to_phys (zdev -> dma_table ), & status );
768- if (rc ) {
769- zpci_disable_device (zdev );
770- return rc ;
771- }
776+ rc = zpci_reenable_device (zdev );
772777
773- return 0 ;
778+ return rc ;
774779}
775780
776781/**
0 commit comments