From: Alex Elder <hidden> Date: 2020-06-29 21:55:44
This series makes three small changes to some endpoint configuration
code. The first uses a constant to represent the frequency of an
internal clock used for timers in the IPA. The second modifies a
limit used so it matches Qualcomm's internal code. And the third
reworks a few lines of code, eliminating a multi-line function call.
-Alex
Alex Elder (3):
net: ipa: rework ipa_aggr_granularity_val()
net: ipa: reduce aggregation time limit
net: ipa: reuse a local variable in ipa_endpoint_init_aggr()
drivers/net/ipa/ipa_endpoint.c | 17 ++++++++++-------
drivers/net/ipa/ipa_main.c | 5 +++++
drivers/net/ipa/ipa_reg.h | 17 ++++++++---------
3 files changed, 23 insertions(+), 16 deletions(-)
--
2.25.1
From: Alex Elder <hidden> Date: 2020-06-29 21:55:52
Halve the time limit used when aggregation is enabled on an RX
endpoint, to half a millisecond.
Use DIV_ROUND_CLOSEST() to compute the value that represents the
time period, to get better accuracy in the event the time limit is
not an even multiple of the granularity.
Signed-off-by: Alex Elder <redacted>
---
drivers/net/ipa/ipa_endpoint.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
From: Alex Elder <hidden> Date: 2020-06-29 21:55:56
The timer used for aggregation makes use of an internal 32 KHz clock.
The granularity of the timer is programmed by a field whose value is
computed by ipa_aggr_granularity_val(). Redefine the way that value
is computed by using a new TIMER_FREQUENCY constant representing the
underlying clock frequency.
Add two BUILD_BUG_ON() calls to ensure the value used is valid.
Signed-off-by: Alex Elder <redacted>
---
drivers/net/ipa/ipa_main.c | 5 +++++
drivers/net/ipa/ipa_reg.h | 17 ++++++++---------
2 files changed, 13 insertions(+), 9 deletions(-)
@@ -674,6 +674,11 @@ static void ipa_validate_build(void)/* This is used as a divisor */BUILD_BUG_ON(!IPA_AGGR_GRANULARITY);++/* Aggregation granularity value can't be 0, and must fit */+BUILD_BUG_ON(!ipa_aggr_granularity_val(IPA_AGGR_GRANULARITY));+BUILD_BUG_ON(ipa_aggr_granularity_val(IPA_AGGR_GRANULARITY)>+field_max(AGGR_GRANULARITY));#endif /* IPA_VALIDATE */}
@@ -190,24 +190,23 @@ static inline u32 ipa_reg_bcr_val(enum ipa_version version)return0x00000000;}-#define IPA_REG_LOCAL_PKT_PROC_CNTXT_BASE_OFFSET 0x000001e8#define IPA_REG_AGGR_FORCE_CLOSE_OFFSET 0x000001ec/* ipa->available defines the valid bits in the AGGR_FORCE_CLOSE register */+/* The internal inactivity timer clock is used for the aggregation timer */+#define TIMER_FREQUENCY 32000 /* 32 KHz inactivity timer clock */+#define IPA_REG_COUNTER_CFG_OFFSET 0x000001f0#define AGGR_GRANULARITY GENMASK(8, 4)-/* Compute the value to use in the AGGR_GRANULARITY field representing-*thegivennumberofmicroseconds(upto1millisecond).-*x=(32*usec)/1000-1+/* Compute the value to use in the AGGR_GRANULARITY field representing the+*givennumberofmicroseconds.Thevalueisonelessthanthenumberof+*timerticksintherequestedperiod.Zeronotavalidgranularityvalue.*/-staticinlineu32ipa_aggr_granularity_val(u32microseconds)+staticinlineu32ipa_aggr_granularity_val(u32usec){-/* assert(microseconds >= 16); (?) */-/* assert(microseconds <= 1015); */--returnDIV_ROUND_CLOSEST(32*microseconds,1000)-1;+returnDIV_ROUND_CLOSEST(usec*TIMER_FREQUENCY,USEC_PER_SEC)-1;}#define IPA_REG_TX_CFG_OFFSET 0x000001fc
From: David Miller <davem@davemloft.net> Date: 2020-07-01 22:27:25
From: Alex Elder <redacted>
Date: Mon, 29 Jun 2020 16:55:20 -0500
This series makes three small changes to some endpoint configuration
code. The first uses a constant to represent the frequency of an
internal clock used for timers in the IPA. The second modifies a
limit used so it matches Qualcomm's internal code. And the third
reworks a few lines of code, eliminating a multi-line function call.