Merge tag 'dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / drivers / bus / mhi / core / pm.c
index bbf6cd0..fb99e37 100644 (file)
@@ -1059,28 +1059,8 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
        if (ret)
                goto error_setup_irq;
 
-       /* Setup BHI offset & INTVEC */
+       /* Setup BHI INTVEC */
        write_lock_irq(&mhi_cntrl->pm_lock);
-       ret = mhi_read_reg(mhi_cntrl, mhi_cntrl->regs, BHIOFF, &val);
-       if (ret) {
-               write_unlock_irq(&mhi_cntrl->pm_lock);
-               goto error_bhi_offset;
-       }
-
-       mhi_cntrl->bhi = mhi_cntrl->regs + val;
-
-       /* Setup BHIE offset */
-       if (mhi_cntrl->fbc_download) {
-               ret = mhi_read_reg(mhi_cntrl, mhi_cntrl->regs, BHIEOFF, &val);
-               if (ret) {
-                       write_unlock_irq(&mhi_cntrl->pm_lock);
-                       dev_err(dev, "Error reading BHIE offset\n");
-                       goto error_bhi_offset;
-               }
-
-               mhi_cntrl->bhie = mhi_cntrl->regs + val;
-       }
-
        mhi_write_reg(mhi_cntrl, mhi_cntrl->bhi, BHI_INTVEC, 0);
        mhi_cntrl->pm_state = MHI_PM_POR;
        mhi_cntrl->ee = MHI_EE_MAX;
@@ -1089,12 +1069,16 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
 
        /* Confirm that the device is in valid exec env */
        if (!MHI_IN_PBL(current_ee) && current_ee != MHI_EE_AMSS) {
-               dev_err(dev, "Not a valid EE for power on\n");
+               dev_err(dev, "%s is not a valid EE for power on\n",
+                       TO_MHI_EXEC_STR(current_ee));
                ret = -EIO;
-               goto error_bhi_offset;
+               goto error_async_power_up;
        }
 
        state = mhi_get_mhi_state(mhi_cntrl);
+       dev_dbg(dev, "Attempting power on with EE: %s, state: %s\n",
+               TO_MHI_EXEC_STR(current_ee), TO_MHI_STATE_STR(state));
+
        if (state == MHI_STATE_SYS_ERR) {
                mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET);
                ret = wait_event_timeout(mhi_cntrl->state_event,
@@ -1110,7 +1094,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
                if (!ret) {
                        ret = -EIO;
                        dev_info(dev, "Failed to reset MHI due to syserr state\n");
-                       goto error_bhi_offset;
+                       goto error_async_power_up;
                }
 
                /*
@@ -1132,7 +1116,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
 
        return 0;
 
-error_bhi_offset:
+error_async_power_up:
        mhi_deinit_free_irq(mhi_cntrl);
 
 error_setup_irq: