summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-08-02 03:00:59 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-08-02 03:00:59 +0000
commit0817801477c2c4f71cabc6352336f51bd4715a65 (patch)
tree95b5634cd16ad6b0e7716c3505bf45b8acfe5cec
parenta625474383084e0b4c2db911a0f52161d661a6ba (diff)
parent905da76f2793187b702439117c78e009da99cc90 (diff)
downloaduwb-android-gs-raviole-5.10-u-beta5.2.tar.gz
Change-Id: Ia34ca8db3010294fd525ab38debd753da1badb2a
-rw-r--r--kernel/drivers/net/ieee802154/dw3000_spi.c2
-rw-r--r--mac/nfcc_coex_region_call.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/kernel/drivers/net/ieee802154/dw3000_spi.c b/kernel/drivers/net/ieee802154/dw3000_spi.c
index 76f1f3f..cadc9b1 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...050423");
+ dev_info(dw->dev, "Loading driver...06202023");
dw3000_sysfs_init(dw);
/* Setup SPI parameters */
diff --git a/mac/nfcc_coex_region_call.c b/mac/nfcc_coex_region_call.c
index a7e63cd..bf8fb9b 100644
--- a/mac/nfcc_coex_region_call.c
+++ b/mac/nfcc_coex_region_call.c
@@ -64,7 +64,7 @@ static int nfcc_coex_session_set_parameters(struct nfcc_coex_local *local,
struct nfcc_coex_session *session = &local->session;
struct nfcc_coex_session_params *p = &session->params;
/* Maximum dtu duration is INT32_MAX. */
- const u64 max_time0_ns =
+ const s64 max_time0_ns =
(S32_MAX * NS_PER_SECOND) / local->llhw->dtu_freq_hz;
int r;
@@ -98,7 +98,7 @@ static int nfcc_coex_session_set_parameters(struct nfcc_coex_local *local,
local->llhw->dtu_freq_hz + now_ns;
}
- if (p->time0_ns - now_ns > max_time0_ns)
+ if ((s64)(p->time0_ns - now_ns) > max_time0_ns)
return -ERANGE;
return 0;
}
@@ -129,9 +129,13 @@ static int nfcc_coex_session_start(struct nfcc_coex_local *local,
return r;
diff_ns = p->time0_ns - now_ns;
- diff_dtu = (diff_ns * local->llhw->dtu_freq_hz) / NS_PER_SECOND;
- if (diff_dtu < local->llhw->anticip_dtu)
- return -ETIMEDOUT;
+ diff_dtu = div64_s64(diff_ns * local->llhw->dtu_freq_hz, NS_PER_SECOND);
+ /* If the requested start date is in the past, start immediately */
+ if (diff_dtu < local->llhw->anticip_dtu) {
+ pr_warn("dw3000: Computed start date is in the past, scheduling"
+ " to anticip_dtu instead");
+ diff_dtu = local->llhw->anticip_dtu;
+ }
session->region_demand.timestamp_dtu = now_dtu + diff_dtu;
session->region_demand.max_duration_dtu = 0;