linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] bus: mhi: ep: Clear channel interrupts that are unmasked
@ 2023-08-11  9:57 Subramanian Ananthanarayanan
  2023-08-14  8:14 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 2+ messages in thread
From: Subramanian Ananthanarayanan @ 2023-08-11  9:57 UTC (permalink / raw)
  To: manivannan.sadhasivam
  Cc: helgaas, linux-pci, linux-arm-msm, linux-kernel, quic_vbadigan,
	quic_nitegupt, quic_skananth, quic_ramkri, quic_parass,
	krzysztof.kozlowski, Manivannan Sadhasivam, Jeffrey Hugo,
	Greg Kroah-Hartman, Dan Carpenter, open list:MHI BUS

Change is to avoid clearing of interrupts that could have been masked.

Signed-off-by: Subramanian Ananthanarayanan <quic_skananth@quicinc.com>
---
 drivers/bus/mhi/ep/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
index 6008818..a818781 100644
--- a/drivers/bus/mhi/ep/main.c
+++ b/drivers/bus/mhi/ep/main.c
@@ -867,7 +867,7 @@ static void mhi_ep_check_channel_interrupt(struct mhi_ep_cntrl *mhi_cntrl)
 		if (ch_int) {
 			mhi_ep_queue_channel_db(mhi_cntrl, ch_int, ch_idx);
 			mhi_ep_mmio_write(mhi_cntrl, MHI_CHDB_INT_CLEAR_n(i),
-							mhi_cntrl->chdb[i].status);
+							ch_int);
 		}
 	}
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] bus: mhi: ep: Clear channel interrupts that are unmasked
  2023-08-11  9:57 [PATCH v1] bus: mhi: ep: Clear channel interrupts that are unmasked Subramanian Ananthanarayanan
@ 2023-08-14  8:14 ` Manivannan Sadhasivam
  0 siblings, 0 replies; 2+ messages in thread
From: Manivannan Sadhasivam @ 2023-08-14  8:14 UTC (permalink / raw)
  To: Subramanian Ananthanarayanan
  Cc: helgaas, linux-pci, linux-arm-msm, linux-kernel, quic_vbadigan,
	quic_nitegupt, quic_ramkri, quic_parass, krzysztof.kozlowski,
	Manivannan Sadhasivam, Jeffrey Hugo, Greg Kroah-Hartman,
	Dan Carpenter, open list:MHI BUS

On Fri, Aug 11, 2023 at 02:57:08AM -0700, Subramanian Ananthanarayanan wrote:
> Change is to avoid clearing of interrupts that could have been masked.
> 
> Signed-off-by: Subramanian Ananthanarayanan <quic_skananth@quicinc.com>

Is this scenario possible in real life? We unmask all the interrupts during
power_up and later mask the interrupts specific to channels when they are
started. So I do not see a possibility where the CHDB status would be set for an
unmasked channel.

Looking at the code now, I think we can get rid of the mask check, even the
local copy of mask if there is a guarantee that doorbell interrupts won't be
enabled behind the back of the MHI stack.

IIRC, I added the mask check as the HW channel interrupts were enabled behind
the back. But that was fixed with all unmask during power_up and mask only
started channels strategy.

PS: The term "mask" is horribly used in an inverted manner in MHI.

- Mani

> ---
>  drivers/bus/mhi/ep/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
> index 6008818..a818781 100644
> --- a/drivers/bus/mhi/ep/main.c
> +++ b/drivers/bus/mhi/ep/main.c
> @@ -867,7 +867,7 @@ static void mhi_ep_check_channel_interrupt(struct mhi_ep_cntrl *mhi_cntrl)
>  		if (ch_int) {
>  			mhi_ep_queue_channel_db(mhi_cntrl, ch_int, ch_idx);
>  			mhi_ep_mmio_write(mhi_cntrl, MHI_CHDB_INT_CLEAR_n(i),
> -							mhi_cntrl->chdb[i].status);
> +							ch_int);
>  		}
>  	}
>  }
> -- 
> 2.7.4
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-14  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11  9:57 [PATCH v1] bus: mhi: ep: Clear channel interrupts that are unmasked Subramanian Ananthanarayanan
2023-08-14  8:14 ` Manivannan Sadhasivam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).