diff mbox series

[v10,1/2] bus: mhi: Add mhi_queue_is_full function

Message ID 1604424234-24446-1-git-send-email-loic.poulain@linaro.org
State Superseded
Headers show
Series [v10,1/2] bus: mhi: Add mhi_queue_is_full function | expand

Commit Message

Loic Poulain Nov. 3, 2020, 5:23 p.m. UTC
This function can be used by client driver to determine whether it's
possible to queue new elements in a channel ring.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 v1->v5: not part of the series
 v6: Add this commit, used for stopping TX queue
 v7: no change
 v8: remove static change (up to the compiler)
 v9: no change + Mani reviewed-by tag
 v10: no change

 drivers/bus/mhi/core/main.c | 11 +++++++++++
 include/linux/mhi.h         |  7 +++++++
 2 files changed, 18 insertions(+)

Comments

Jakub Kicinski Nov. 6, 2020, 12:57 a.m. UTC | #1
On Tue,  3 Nov 2020 18:23:53 +0100 Loic Poulain wrote:
> This function can be used by client driver to determine whether it's

> possible to queue new elements in a channel ring.

> 

> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>


Applied.
Jakub Kicinski Nov. 6, 2020, 12:57 a.m. UTC | #2
On Tue,  3 Nov 2020 18:23:54 +0100 Loic Poulain wrote:
> This patch adds a new network driver implementing MHI transport for
> network packets. Packets can be in any format, though QMAP (rmnet)
> is the usual protocol (flow control + PDN mux).
> 
> It support two MHI devices, IP_HW0 which is, the path to the IPA
> (IP accelerator) on qcom modem, And IP_SW0 which is the software
> driven IP path (to modem CPU).
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Applied, thanks!
Manivannan Sadhasivam Nov. 6, 2020, 5:13 a.m. UTC | #3
On Thu, Nov 05, 2020 at 04:57:08PM -0800, Jakub Kicinski wrote:
> On Tue,  3 Nov 2020 18:23:53 +0100 Loic Poulain wrote:
> > This function can be used by client driver to determine whether it's
> > possible to queue new elements in a channel ring.
> > 
> > Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> 
> Applied.

Oops. I should've mentioned this (my bad) that we should use an immutable
branch to take this change. Because, there are changes going to get merged
into the MHI tree which will introduce merge conflicts. And moreover, we
planned to have an immutable branch to handle a similar case with ath11k.

Since you've applied now, what would you propose?

Thanks,
Mani
Jakub Kicinski Nov. 6, 2020, 4:04 p.m. UTC | #4
On Fri, 6 Nov 2020 10:43:53 +0530 Manivannan Sadhasivam wrote:
> On Thu, Nov 05, 2020 at 04:57:08PM -0800, Jakub Kicinski wrote:

> > On Tue,  3 Nov 2020 18:23:53 +0100 Loic Poulain wrote:  

> > > This function can be used by client driver to determine whether it's

> > > possible to queue new elements in a channel ring.

> > > 

> > > Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

> > > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>  

> > 

> > Applied.  

> 

> Oops. I should've mentioned this (my bad) that we should use an immutable

> branch to take this change. Because, there are changes going to get merged

> into the MHI tree which will introduce merge conflicts. And moreover, we

> planned to have an immutable branch to handle a similar case with ath11k.


Damn, sorry.

> Since you've applied now, what would you propose?


Do you need mhi_queue_is_full() in other branches, or are you just
concerned about the conflicts?

I'm assuming the concern is just about the mhi/core patch, or would 
you need to refactor something in the net driver as well?
Manivannan Sadhasivam Nov. 6, 2020, 4:28 p.m. UTC | #5
On 6 November 2020 9:34:45 PM IST, Jakub Kicinski <kuba@kernel.org> wrote:
>On Fri, 6 Nov 2020 10:43:53 +0530 Manivannan Sadhasivam wrote:

>> On Thu, Nov 05, 2020 at 04:57:08PM -0800, Jakub Kicinski wrote:

>> > On Tue,  3 Nov 2020 18:23:53 +0100 Loic Poulain wrote:  

>> > > This function can be used by client driver to determine whether

>it's

>> > > possible to queue new elements in a channel ring.

>> > > 

>> > > Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

>> > > Reviewed-by: Manivannan Sadhasivam

><manivannan.sadhasivam@linaro.org>  

>> > 

>> > Applied.  

>> 

>> Oops. I should've mentioned this (my bad) that we should use an

>immutable

>> branch to take this change. Because, there are changes going to get

>merged

>> into the MHI tree which will introduce merge conflicts. And moreover,

>we

>> planned to have an immutable branch to handle a similar case with

>ath11k.

>

>Damn, sorry.

>

>> Since you've applied now, what would you propose?

>

>Do you need mhi_queue_is_full() in other branches, or are you just

>concerned about the conflicts?

>


Yes, I need this patch in mhi-next.

>I'm assuming the concern is just about the mhi/core patch, or would 

>you need to refactor something in the net driver as well?


Just the mhi_queue_is_full() patch. 

Thanks, 
Mani

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Jakub Kicinski Nov. 6, 2020, 4:39 p.m. UTC | #6
On Fri, 06 Nov 2020 21:58:12 +0530 Manivannan Sadhasivam wrote:
>>> Since you've applied now, what would you propose?  

>>

>> Do you need mhi_queue_is_full() in other branches, or are you just

>> concerned about the conflicts?

> 

> Yes, I need this patch in mhi-next.

> 

>> I'm assuming the concern is just about the mhi/core patch, or would 

>> you need to refactor something in the net driver as well?  

> 

> Just the mhi_queue_is_full() patch. 


Okay, I think you can just apply that patch to your tree again and git
should figure out it's a duplicate. Not optimal, because the change will
have two hashes, but the function is trivial, shouldn't be an issue
even if conflict happens.

Will you need it in wireless (ath11k), or only in other trees?

If it ends up in the wireless tree Dave or I will do the resolution when
we pull from Kalle so it won't even appear to Linus (but then it should
go into wireless through an immutable branch).
Kalle Valo Nov. 10, 2020, 6:44 p.m. UTC | #7
+ ath11k list

Jakub Kicinski <kuba@kernel.org> writes:

> On Fri, 06 Nov 2020 21:58:12 +0530 Manivannan Sadhasivam wrote:

>>>> Since you've applied now, what would you propose?  

>>>

>>> Do you need mhi_queue_is_full() in other branches, or are you just

>>> concerned about the conflicts?

>> 

>> Yes, I need this patch in mhi-next.

>> 

>>> I'm assuming the concern is just about the mhi/core patch, or would 

>>> you need to refactor something in the net driver as well?  

>> 

>> Just the mhi_queue_is_full() patch. 

>

> Okay, I think you can just apply that patch to your tree again and git

> should figure out it's a duplicate. Not optimal, because the change will

> have two hashes, but the function is trivial, shouldn't be an issue

> even if conflict happens.

>

> Will you need it in wireless (ath11k), or only in other trees?

>

> If it ends up in the wireless tree Dave or I will do the resolution when

> we pull from Kalle so it won't even appear to Linus (but then it should

> go into wireless through an immutable branch).


I think in the next few releases we need close coordination between mhi
and ath11k, both are in active development and there can be changes
which break ath11k functionality. Let's see how this goes.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
patchwork-bot+linux-arm-msm@kernel.org Dec. 29, 2020, 8:15 p.m. UTC | #8
Hello:

This series was applied to qcom/linux.git (refs/heads/for-next):

On Tue,  3 Nov 2020 18:23:53 +0100 you wrote:
> This function can be used by client driver to determine whether it's

> possible to queue new elements in a channel ring.

> 

> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

> ---

>  v1->v5: not part of the series

>  v6: Add this commit, used for stopping TX queue

>  v7: no change

>  v8: remove static change (up to the compiler)

>  v9: no change + Mani reviewed-by tag

>  v10: no change

> 

> [...]


Here is the summary with links:
  - [v10,1/2] bus: mhi: Add mhi_queue_is_full function
    https://git.kernel.org/qcom/c/d8c4a2236385
  - [v10,2/2] net: Add mhi-net driver
    https://git.kernel.org/qcom/c/3ffec6a14f24

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
index a588eac..bab38d2 100644
--- a/drivers/bus/mhi/core/main.c
+++ b/drivers/bus/mhi/core/main.c
@@ -1173,6 +1173,17 @@  int mhi_queue_buf(struct mhi_device *mhi_dev, enum dma_data_direction dir,
 }
 EXPORT_SYMBOL_GPL(mhi_queue_buf);
 
+bool mhi_queue_is_full(struct mhi_device *mhi_dev, enum dma_data_direction dir)
+{
+	struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
+	struct mhi_chan *mhi_chan = (dir == DMA_TO_DEVICE) ?
+					mhi_dev->ul_chan : mhi_dev->dl_chan;
+	struct mhi_ring *tre_ring = &mhi_chan->tre_ring;
+
+	return mhi_is_ring_full(mhi_cntrl, tre_ring);
+}
+EXPORT_SYMBOL_GPL(mhi_queue_is_full);
+
 int mhi_send_cmd(struct mhi_controller *mhi_cntrl,
 		 struct mhi_chan *mhi_chan,
 		 enum mhi_cmd_type cmd)
diff --git a/include/linux/mhi.h b/include/linux/mhi.h
index 9d67e75..f72c3a4 100644
--- a/include/linux/mhi.h
+++ b/include/linux/mhi.h
@@ -745,4 +745,11 @@  int mhi_queue_buf(struct mhi_device *mhi_dev, enum dma_data_direction dir,
 int mhi_queue_skb(struct mhi_device *mhi_dev, enum dma_data_direction dir,
 		  struct sk_buff *skb, size_t len, enum mhi_flags mflags);
 
+/**
+ * mhi_queue_is_full - Determine whether queueing new elements is possible
+ * @mhi_dev: Device associated with the channels
+ * @dir: DMA direction for the channel
+ */
+bool mhi_queue_is_full(struct mhi_device *mhi_dev, enum dma_data_direction dir);
+
 #endif /* _MHI_H_ */