@@ -134,14 +134,13 @@ int zpci_register_ioat(struct zpci_dev *zdev, u8 dmaas,
134134 struct zpci_fib fib = {0 };
135135 u8 cc ;
136136
137- WARN_ON_ONCE (iota & 0x3fff );
138137 fib .pba = base ;
139138 /* Work around off by one in ISM virt device */
140139 if (zdev -> pft == PCI_FUNC_TYPE_ISM && limit > base )
141140 fib .pal = limit + (1 << 12 );
142141 else
143142 fib .pal = limit ;
144- fib .iota = iota | ZPCI_IOTA_RTTO_FLAG ;
143+ fib .iota = iota ;
145144 fib .gd = zdev -> gisa ;
146145 cc = zpci_mod_fc (req , & fib , status );
147146 if (cc )
@@ -700,6 +699,23 @@ int zpci_enable_device(struct zpci_dev *zdev)
700699}
701700EXPORT_SYMBOL_GPL (zpci_enable_device );
702701
702+ int zpci_reenable_device (struct zpci_dev * zdev )
703+ {
704+ u8 status ;
705+ int rc ;
706+
707+ rc = zpci_enable_device (zdev );
708+ if (rc )
709+ return rc ;
710+
711+ rc = zpci_iommu_register_ioat (zdev , & status );
712+ if (rc )
713+ zpci_disable_device (zdev );
714+
715+ return rc ;
716+ }
717+ EXPORT_SYMBOL_GPL (zpci_reenable_device );
718+
703719int zpci_disable_device (struct zpci_dev * zdev )
704720{
705721 u32 fh = zdev -> fh ;
@@ -749,7 +765,6 @@ EXPORT_SYMBOL_GPL(zpci_disable_device);
749765 */
750766int zpci_hot_reset_device (struct zpci_dev * zdev )
751767{
752- u8 status ;
753768 int rc ;
754769
755770 lockdep_assert_held (& zdev -> state_lock );
@@ -768,19 +783,9 @@ int zpci_hot_reset_device(struct zpci_dev *zdev)
768783 return rc ;
769784 }
770785
771- rc = zpci_enable_device (zdev );
772- if (rc )
773- return rc ;
774-
775- if (zdev -> dma_table )
776- rc = zpci_register_ioat (zdev , 0 , zdev -> start_dma , zdev -> end_dma ,
777- virt_to_phys (zdev -> dma_table ), & status );
778- if (rc ) {
779- zpci_disable_device (zdev );
780- return rc ;
781- }
786+ rc = zpci_reenable_device (zdev );
782787
783- return 0 ;
788+ return rc ;
784789}
785790
786791/**
0 commit comments