net: ipa: use Qtime for IPA v4.5 aggregation time limit
authorAlex Elder <elder@linaro.org>
Mon, 30 Nov 2020 23:37:11 +0000 (17:37 -0600)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Dec 2020 02:05:28 +0000 (18:05 -0800)
commit1954704136d3d3f168fc38ebe4024d7574faf1ef
treea760d529de78a5351f60b8032160601f6f50ea6c
parent36426411021a6b4082c6203a6e9ee244c5887026
net: ipa: use Qtime for IPA v4.5 aggregation time limit

Change aggr_time_limit_encoded() to properly calculate the
aggregation time limit to use for IPA v4.5.

Older IPA versions program the AGGR_GRANULARITY field of the
of the COUNTER_CFG register to set the granularity of the
aggregation timer, which we configure to be 500 microseconds.

Instead, IPA v4.5 selects between two possible granularity values
derived from the 19.2 MHz Qtime clock.  These granularities are
100 microseconds or 1 millisecond per tick.  We use the smaller
granularity if possible, unless the desired period is too large
to be specified that way.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_endpoint.c