All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND] soc: qcom-geni-se: Update Tx and Rx fifo depth based on QUP HW version
@ 2023-02-06 12:22 Visweswara Tanuku
  2023-02-06 12:38 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Visweswara Tanuku @ 2023-02-06 12:22 UTC (permalink / raw)
  To: konrad.dybcio, gregkh, bartosz.golaszewski, linux-kernel
  Cc: quic_vnivarth, nicolas.dechesne, srinivas.kandagatla, vinod.koul,
	quic_eberman, quic_satyap, Visweswara Tanuku

From QUP HW Version 3.10 and above the Tx and Rx
fifo depth bits are increased to 23:16 bits from
21:16 bits in SE_HW_PARAM registers accomodating
256bytes of fifo depth.

Updated geni_se_get_tx_fifo_depth and
geni_se_get_rx_fifo_depth to retrieve right fifo
depth based on QUP HW version.

Signed-off-by: Visweswara Tanuku <quic_vtanuku@quicinc.com>
---
 include/linux/qcom-geni-se.h | 42 ++++++++++++++++++++++++++++++------
 1 file changed, 36 insertions(+), 6 deletions(-)

diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h
index 400213daa461..c55a0bc8cb0e 100644
--- a/include/linux/qcom-geni-se.h
+++ b/include/linux/qcom-geni-se.h
@@ -245,12 +245,22 @@ struct geni_se {
 /* SE_HW_PARAM_0 fields */
 #define TX_FIFO_WIDTH_MSK		GENMASK(29, 24)
 #define TX_FIFO_WIDTH_SHFT		24
+/*
+ * For QUP HW Version >= 3.10 Tx fifo depth support is increased
+ * to 256bytes and corresponding bits are 16 to 23
+ */
+#define TX_FIFO_DEPTH_MSK_256_BYTES	GENMASK(23, 16)
 #define TX_FIFO_DEPTH_MSK		GENMASK(21, 16)
 #define TX_FIFO_DEPTH_SHFT		16
 
 /* SE_HW_PARAM_1 fields */
 #define RX_FIFO_WIDTH_MSK		GENMASK(29, 24)
 #define RX_FIFO_WIDTH_SHFT		24
+/*
+ * For QUP HW Version >= 3.10 Rx fifo depth support is increased
+ * to 256bytes and corresponding bits are 16 to 23
+ */
+#define RX_FIFO_DEPTH_MSK_256_BYTES	GENMASK(23, 16)
 #define RX_FIFO_DEPTH_MSK		GENMASK(21, 16)
 #define RX_FIFO_DEPTH_SHFT		16
 
@@ -391,7 +401,8 @@ static inline void geni_se_abort_s_cmd(struct geni_se *se)
 
 /**
  * geni_se_get_tx_fifo_depth() - Get the TX fifo depth of the serial engine
- * @se:	Pointer to the concerned serial engine.
+ * based on QUP HW version
+ * @se: Pointer to the concerned serial engine.
  *
  * This function is used to get the depth i.e. number of elements in the
  * TX fifo of the serial engine.
@@ -400,11 +411,20 @@ static inline void geni_se_abort_s_cmd(struct geni_se *se)
  */
 static inline u32 geni_se_get_tx_fifo_depth(struct geni_se *se)
 {
-	u32 val;
+	u32 val, hw_version, hw_major, hw_minor, tx_fifo_depth_mask;
+
+	hw_version = geni_se_get_qup_hw_version(se);
+	hw_major = GENI_SE_VERSION_MAJOR(hw_version);
+	hw_minor = GENI_SE_VERSION_MINOR(hw_version);
+
+	if ((hw_major == 3 && hw_minor >= 10) || hw_major > 3)
+		tx_fifo_depth_mask = TX_FIFO_DEPTH_MSK_256_BYTES;
+	else
+		tx_fifo_depth_mask = TX_FIFO_DEPTH_MSK;
 
 	val = readl_relaxed(se->base + SE_HW_PARAM_0);
 
-	return (val & TX_FIFO_DEPTH_MSK) >> TX_FIFO_DEPTH_SHFT;
+	return (val & tx_fifo_depth_mask) >> TX_FIFO_DEPTH_SHFT;
 }
 
 /**
@@ -427,7 +447,8 @@ static inline u32 geni_se_get_tx_fifo_width(struct geni_se *se)
 
 /**
  * geni_se_get_rx_fifo_depth() - Get the RX fifo depth of the serial engine
- * @se:	Pointer to the concerned serial engine.
+ * based on QUP HW version
+ * @se: Pointer to the concerned serial engine.
  *
  * This function is used to get the depth i.e. number of elements in the
  * RX fifo of the serial engine.
@@ -436,11 +457,20 @@ static inline u32 geni_se_get_tx_fifo_width(struct geni_se *se)
  */
 static inline u32 geni_se_get_rx_fifo_depth(struct geni_se *se)
 {
-	u32 val;
+	u32 val, hw_version, hw_major, hw_minor, rx_fifo_depth_mask;
+
+	hw_version = geni_se_get_qup_hw_version(se);
+	hw_major = GENI_SE_VERSION_MAJOR(hw_version);
+	hw_minor = GENI_SE_VERSION_MINOR(hw_version);
+
+	if ((hw_major == 3 && hw_minor >= 10) || hw_major > 3)
+		rx_fifo_depth_mask = RX_FIFO_DEPTH_MSK_256_BYTES;
+	else
+		rx_fifo_depth_mask = RX_FIFO_DEPTH_MSK;
 
 	val = readl_relaxed(se->base + SE_HW_PARAM_1);
 
-	return (val & RX_FIFO_DEPTH_MSK) >> RX_FIFO_DEPTH_SHFT;
+	return (val & rx_fifo_depth_mask) >> RX_FIFO_DEPTH_SHFT;
 }
 
 void geni_se_init(struct geni_se *se, u32 rx_wm, u32 rx_rfr);
-- 
2.17.1


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

* Re: [RESEND] soc: qcom-geni-se: Update Tx and Rx fifo depth based on QUP HW version
  2023-02-06 12:22 [RESEND] soc: qcom-geni-se: Update Tx and Rx fifo depth based on QUP HW version Visweswara Tanuku
@ 2023-02-06 12:38 ` Greg KH
       [not found]   ` <ca31f247-0297-7582-c16f-a85453872ca4@quicinc.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2023-02-06 12:38 UTC (permalink / raw)
  To: Visweswara Tanuku
  Cc: konrad.dybcio, bartosz.golaszewski, linux-kernel, quic_vnivarth,
	nicolas.dechesne, srinivas.kandagatla, vinod.koul, quic_eberman,
	quic_satyap

On Mon, Feb 06, 2023 at 04:22:15AM -0800, Visweswara Tanuku wrote:
> >From QUP HW Version 3.10 and above the Tx and Rx
> fifo depth bits are increased to 23:16 bits from
> 21:16 bits in SE_HW_PARAM registers accomodating
> 256bytes of fifo depth.
> 
> Updated geni_se_get_tx_fifo_depth and
> geni_se_get_rx_fifo_depth to retrieve right fifo
> depth based on QUP HW version.
> 
> Signed-off-by: Visweswara Tanuku <quic_vtanuku@quicinc.com>
> ---
>  include/linux/qcom-geni-se.h | 42 ++++++++++++++++++++++++++++++------
>  1 file changed, 36 insertions(+), 6 deletions(-)

Why is this a RESEND?  What was wrong with the first version?

confused,

greg k-h

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

* Re: [RESEND] soc: qcom-geni-se: Update Tx and Rx fifo depth based on QUP HW version
       [not found]   ` <ca31f247-0297-7582-c16f-a85453872ca4@quicinc.com>
@ 2023-02-06 18:09     ` Greg KH
       [not found]       ` <0afc0752-1a4e-be3a-e9bd-0f56243d5e41@quicinc.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2023-02-06 18:09 UTC (permalink / raw)
  To: Visweswara Tanuku
  Cc: konrad.dybcio, bartosz.golaszewski, linux-kernel, quic_vnivarth,
	nicolas.dechesne, srinivas.kandagatla, vinod.koul, quic_eberman,
	quic_satyap

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Mon, Feb 06, 2023 at 07:36:49PM +0530, Visweswara Tanuku wrote:
> Added RESEND for resubmission of first version which is not modified in any
> way from the previous submission.

Then why was it resent?  What will cause this to be accepted when the
previous submission was not?

confused,

greg k-h

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

* Re: [RESEND] soc: qcom-geni-se: Update Tx and Rx fifo depth based on QUP HW version
       [not found]       ` <0afc0752-1a4e-be3a-e9bd-0f56243d5e41@quicinc.com>
@ 2023-02-08 11:57         ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-02-08 11:57 UTC (permalink / raw)
  To: Visweswara Tanuku
  Cc: konrad.dybcio, bartosz.golaszewski, linux-kernel, quic_vnivarth,
	nicolas.dechesne, srinivas.kandagatla, vinod.koul, quic_eberman,
	quic_satyap

On Tue, Feb 07, 2023 at 04:54:13PM +0530, Visweswara Tanuku wrote:
> 
> On 2/6/2023 11:39 PM, Greg KH wrote:
> > A:http://en.wikipedia.org/wiki/Top_post
> > Q: Were do I find info about this thing called top-posting?
> > A: Because it messes up the order in which people normally read text.
> > Q: Why is top-posting such a bad thing?
> > A: Top-posting.
> > Q: What is the most annoying thing in e-mail?
> > 
> > A: No.
> > Q: Should I include quotations after my reply?
> 
> Apologies will take care.
> 
> > http://daringfireball.net/2007/07/on_top
> > 
> > On Mon, Feb 06, 2023 at 07:36:49PM +0530, Visweswara Tanuku wrote:
> > > Added RESEND for resubmission of first version which is not modified in any
> > > way from the previous submission.
> > 
> > Then why was it resent?  What will cause this to be accepted when the
> > previous submission was not?
> > 
> > confused,
> > 
> > greg k-h
> 
> https://lkml.org/lkml/2022/11/21/549
> 
> I had posted the same patch in November last year but did not receive any
> response in spite of periodic reminders.
> 
> Suspecting that the patch did not reach all the required recipients
> re-posted the same and hence RESEND.

When you resend, you need to say _why_ it was resent.  "adding more
people" is a valid reason, don't make us guess.

Remember, some of us get hundreds of patches a day/week to review, we
have no saved context.

thanks,

greg k-h

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

end of thread, other threads:[~2023-02-08 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-06 12:22 [RESEND] soc: qcom-geni-se: Update Tx and Rx fifo depth based on QUP HW version Visweswara Tanuku
2023-02-06 12:38 ` Greg KH
     [not found]   ` <ca31f247-0297-7582-c16f-a85453872ca4@quicinc.com>
2023-02-06 18:09     ` Greg KH
     [not found]       ` <0afc0752-1a4e-be3a-e9bd-0f56243d5e41@quicinc.com>
2023-02-08 11:57         ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.