diff options
author | PixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com> | 2023-07-23 18:29:46 -0700 |
---|---|---|
committer | SecurityBot <android-nexus-securitybot@system.gserviceaccount.com> | 2023-07-23 18:29:47 -0700 |
commit | 24b668d6f545a33179189a4ed79a4343e6a8593a (patch) | |
tree | 95b5634cd16ad6b0e7716c3505bf45b8acfe5cec | |
parent | db8b652786d7522b6e05eed9b356310b1110bbf9 (diff) | |
parent | 905da76f2793187b702439117c78e009da99cc90 (diff) | |
download | uwb-24b668d6f545a33179189a4ed79a4343e6a8593a.tar.gz |
Merge android13-gs-pixel-5.10-udc into android13-gs-pixel-5.10-udc-qpr1
SBMerger: 526756187
Change-Id: Ic44bef83b805abfe8048c5c1d3a2b079ef670255
Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r-- | kernel/drivers/net/ieee802154/dw3000_spi.c | 2 | ||||
-rw-r--r-- | mac/nfcc_coex_region_call.c | 14 |
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; |