summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Rocher <jeremy.rocher@qorvo.com>2024-02-16 11:50:02 +0100
committerVictor Liu <victorliu@google.com>2024-02-16 11:08:24 -0800
commit20eeeaf070d6d2bb4021848e70a58b6bab9ca129 (patch)
tree621a9a9e6a9d690e0be2eda9364ddc57d2fcef98
parentab669fdc037be92576600c4014e711dab6a53862 (diff)
downloaddw3000-android-gs-lynx-5.10-android14-qpr3-beta.tar.gz
* P-STS: fix key rotation * CCC: Fix ETIME error on idle_duration close to anticip_dtu Bug: 321792737 Bug: 316371073 Bug: 315336416 Bug: 320736554 Change-Id: Ic01c66d2a3022f1ae1b9f90d24c93f09f40c205f Signed-off-by: Jeremy Rocher <jeremy.rocher@qorvo.com>
-rw-r--r--kernel/drivers/net/ieee802154/dw3000_nfcc_coex_mcps.c9
-rw-r--r--kernel/drivers/net/ieee802154/dw3000_spi.c2
-rwxr-xr-xmac/fira_crypto.c8
3 files changed, 14 insertions, 5 deletions
diff --git a/kernel/drivers/net/ieee802154/dw3000_nfcc_coex_mcps.c b/kernel/drivers/net/ieee802154/dw3000_nfcc_coex_mcps.c
index 2214859..ce3343c 100644
--- a/kernel/drivers/net/ieee802154/dw3000_nfcc_coex_mcps.c
+++ b/kernel/drivers/net/ieee802154/dw3000_nfcc_coex_mcps.c
@@ -29,6 +29,7 @@
#include "dw3000_core.h"
#define DW3000_NFCC_COEX_WATCHDOG_DEFAULT_DURATION_MS 24000
+#define DW3000_MARGIN_TO_ENTER_IDLE 2
static int dw3000_nfcc_coex_wakeup_and_send(struct dw3000 *dw,
s32 idle_duration_dtu,
@@ -40,7 +41,13 @@ static int dw3000_nfcc_coex_wakeup_and_send(struct dw3000 *dw,
trace_dw3000_nfcc_coex_wakeup_and_send(
dw, nfcc_coex->send, idle_duration_dtu, send_timestamp_dtu);
- if (idle_duration_dtu > dw->llhw->anticip_dtu) {
+ if (idle_duration_dtu >
+ DW3000_MARGIN_TO_ENTER_IDLE * dw->llhw->anticip_dtu) {
+ /* If idle_duration_dtu is too close to anticip_dtu, the
+ * idle_delay computed in dw3000_idle might end up negative
+ * and fail with -ETIME. A DW3000_MARGIN_TO_ENTER_IDLE
+ * multiplicator is used to avoid this.
+ */
r = dw3000_idle(dw, true, send_timestamp_dtu,
dw3000_nfcc_coex_idle_timeout,
DW3000_OP_STATE_MAX);
diff --git a/kernel/drivers/net/ieee802154/dw3000_spi.c b/kernel/drivers/net/ieee802154/dw3000_spi.c
index cadc9b1..18372c7 100644
--- a/kernel/drivers/net/ieee802154/dw3000_spi.c
+++ b/kernel/drivers/net/ieee802154/dw3000_spi.c
@@ -116,7 +116,7 @@ static int dw3000_spi_probe(struct spi_device *spi)
hrtimer_init(&dw->idle_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
dw->idle_timer.function = dw3000_idle_timeout;
- dev_info(dw->dev, "Loading driver...06202023");
+ dev_info(dw->dev, "Loading driver...02162024");
dw3000_sysfs_init(dw);
/* Setup SPI parameters */
diff --git a/mac/fira_crypto.c b/mac/fira_crypto.c
index 3613c9a..3329a75 100755
--- a/mac/fira_crypto.c
+++ b/mac/fira_crypto.c
@@ -468,9 +468,11 @@ int fira_crypto_rotate_elements(struct fira_crypto *fira_crypto_ctx,
if (r)
goto error_out;
- if (fira_crypto_ctx->base.aead.ctx == NULL)
- r = fira_crypto_aead_set_key(&fira_crypto_ctx->base.aead,
- fira_crypto_ctx->base.derived_payload_key);
+ if (fira_crypto_ctx->base.aead.ctx)
+ fira_crypto_aead_destroy(&fira_crypto_ctx->base.aead);
+
+ r = fira_crypto_aead_set_key(&fira_crypto_ctx->base.aead,
+ fira_crypto_ctx->base.derived_payload_key);
error_out:
memzero_explicit(context, sizeof(context));