@@ -697,33 +697,33 @@ static int rknpu_power_off(struct rknpu_device *rknpu_dev)
697
697
698
698
pm_runtime_put_sync (dev );
699
699
700
+ if (rknpu_dev -> multiple_domains ) {
700
701
#ifndef FPGA_PLATFORM
701
- /*
702
- * Because IOMMU's runtime suspend callback is asynchronous,
703
- * So it may be executed after the NPU is turned off after PD/CLK/VD,
704
- * and the runtime suspend callback has a register access.
705
- * If the PD/VD/CLK is closed, the register access will crash.
706
- * As a workaround, it's safe to close pd stuff until iommu disabled.
707
- * If pm runtime framework can handle this issue in the future, remove
708
- * this.
709
- */
710
- ret = readx_poll_timeout (rockchip_iommu_is_enabled , dev , val , ! val ,
711
- NPU_MMU_DISABLED_POLL_PERIOD_US ,
712
- NPU_MMU_DISABLED_POLL_TIMEOUT_US );
713
- if (ret ) {
714
- LOG_DEV_ERROR (dev , "iommu still enabled\n" );
715
- pm_runtime_get_sync (dev );
702
+ /*
703
+ * Because IOMMU's runtime suspend callback is asynchronous,
704
+ * So it may be executed after the NPU is turned off after PD/CLK/VD,
705
+ * and the runtime suspend callback has a register access.
706
+ * If the PD/VD/CLK is closed, the register access will crash.
707
+ * As a workaround, it's safe to close pd stuff until iommu disabled.
708
+ * If pm runtime framework can handle this issue in the future, remove
709
+ * this.
710
+ */
711
+ ret = readx_poll_timeout (rockchip_iommu_is_enabled , dev , val ,
712
+ ! val , NPU_MMU_DISABLED_POLL_PERIOD_US ,
713
+ NPU_MMU_DISABLED_POLL_TIMEOUT_US );
714
+ if (ret ) {
715
+ LOG_DEV_ERROR (dev , "iommu still enabled\n" );
716
+ pm_runtime_get_sync (dev );
716
717
#if KERNEL_VERSION (5 , 10 , 0 ) <= LINUX_VERSION_CODE
717
- rockchip_monitor_volt_adjust_unlock (rknpu_dev -> mdev_info );
718
+ rockchip_monitor_volt_adjust_unlock (
719
+ rknpu_dev -> mdev_info );
718
720
#endif
719
- return ret ;
720
- }
721
+ return ret ;
722
+ }
721
723
#else
722
- if (rknpu_dev -> iommu_en )
723
- msleep (20 );
724
+ if (rknpu_dev -> iommu_en )
725
+ msleep (20 );
724
726
#endif
725
-
726
- if (rknpu_dev -> multiple_domains ) {
727
727
if (rknpu_dev -> genpd_dev_npu2 )
728
728
pm_runtime_put_sync (rknpu_dev -> genpd_dev_npu2 );
729
729
if (rknpu_dev -> genpd_dev_npu1 )
0 commit comments