Skip to contentSkip to conversation

bus: mhi: core: Use current ee in intvec handler

PATCH In review Jeffrey Hugo 2 participants 4 messages May 15, 2020 – May 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: mhi: core: Use current ee in intvec handler

The intvec handler stores the caches ee in a local variable for use in processing the intvec. It should instead use the current ee which is read at the beginning of the intvec incase that the intvec is related to an ee change. Otherwise, the handler might make the wrong decision based on an incorrect ee.

Fixes 3000f85b8f47 (bus: mhi: core: Add support for basic PM operations)
---
 drivers/bus/mhi/core/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/core/main.c +1 -1
index 7272a5a..0a41fe5 100644
@@ -386,8 +386,8 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *dev)
 	write_lock_irq(&mhi_cntrl->pm_lock);
 	if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
 		state = mhi_get_mhi_state(mhi_cntrl);
-		ee = mhi_cntrl->ee;
 		mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl);
+		ee = mhi_cntrl->ee;
 	}
 
 	if (state == MHI_STATE_SYS_ERR) {
Signature · 2 lines
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#1 lore raw
Quoted 26 lines · Jeffrey Hugo

The intvec handler stores the caches ee in a local variable for use in processing the intvec. It should instead use the current ee which is read at the beginning of the intvec incase that the intvec is related to an ee change. Otherwise, the handler might make the wrong decision based on an incorrect ee.

Fixes 3000f85b8f47 (bus: mhi: core: Add support for basic PM operations)
---
 drivers/bus/mhi/core/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/core/main.c +1 -1
index 7272a5a..0a41fe5 100644
@@ -386,8 +386,8 @@ irqreturn_t mhi_intvec_threaded_handler(int
 irq_number, void *dev)
 	write_lock_irq(&mhi_cntrl->pm_lock);
 	if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
 		state = mhi_get_mhi_state(mhi_cntrl);
-		ee = mhi_cntrl->ee;
 		mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl);
+		ee = mhi_cntrl->ee;
 	}
 
Quoted 1 line

if (state == MHI_STATE_SYS_ERR) {

Hi Jeff,

Let's hold off on this change for now please as we have some good set of bug fixes and improvements coming in very soon. They're only pending post to LKML.

Thanks

#2 lore raw
Quoted 27 lines · On 5/15/2020 8:58 PM, [email protected] wrote:
Quoted 26 lines · Jeffrey Hugo

The intvec handler stores the caches ee in a local variable for use in processing the intvec.  It should instead use the current ee which is read at the beginning of the intvec incase that the intvec is related to an ee change.  Otherwise, the handler might make the wrong decision based on an incorrect ee.

Fixes 3000f85b8f47 (bus: mhi: core: Add support for basic PM operations)

---
 drivers/bus/mhi/core/main.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/core/main.c +1 -1
index 7272a5a..0a41fe5 100644
@@ -386,8 +386,8 @@ irqreturn_t mhi_intvec_threaded_handler(int
 irq_number, void *dev)
      write_lock_irq(&mhi_cntrl->pm_lock);
      if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
          state = mhi_get_mhi_state(mhi_cntrl);
-        ee = mhi_cntrl->ee;
          mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl);
+        ee = mhi_cntrl->ee;
      }
 
Quoted 6 lines
Quoted 1 line

     if (state == MHI_STATE_SYS_ERR) {

Hi Jeff,

Let's hold off on this change for now please as we have some good set of bug fixes and improvements coming in very soon. They're only pending post to LKML.

Does that series of changes address the same issue this patch does, and are they going to be posted soon (ie this week)?

Signature · 3 lines
Jeffrey Hugo
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#3 lore raw
Quoted 31 lines · Jeffrey Hugo
Quoted 30 lines · On 5/15/2020 8:58 PM, [email protected] wrote:
Quoted 26 lines · Jeffrey Hugo

The intvec handler stores the caches ee in a local variable for use in processing the intvec.  It should instead use the current ee which is read at the beginning of the intvec incase that the intvec is related to an ee change.  Otherwise, the handler might make the wrong decision based on an incorrect ee.

Fixes 3000f85b8f47 (bus: mhi: core: Add support for basic PM operations)

---
 drivers/bus/mhi/core/main.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/core/main.c +1 -1
index 7272a5a..0a41fe5 100644
@@ -386,8 +386,8 @@ irqreturn_t mhi_intvec_threaded_handler(int
 irq_number, void *dev)
      write_lock_irq(&mhi_cntrl->pm_lock);
      if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
          state = mhi_get_mhi_state(mhi_cntrl);
-        ee = mhi_cntrl->ee;
          mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl);
+        ee = mhi_cntrl->ee;
      }
 
Quoted 1 line

     if (state == MHI_STATE_SYS_ERR) {

Hi Jeff,

Quoted 6 lines
Quoted 3 lines

Let's hold off on this change for now please as we have some good set of bug fixes and improvements coming in very soon. They're only pending post to LKML.

Does that series of changes address the same issue this patch does, and are they going to be posted soon (ie this week)?

Yes.