From 66235b72747b61980d1afa565a09dff890efd3f7 Mon Sep 17 00:00:00 2001 From: Rakibul Hassan Date: Fri, 25 Jul 2025 20:31:47 +0000 Subject: [PATCH] coe: disable allocation power of 2 check In fringe unexpected cases, HSB (Holoscan sensor bringe) sends image byte offset larger then allocated image size (e.g. if HSB just sends incorrect packet, or is configured incorrectly for a different image size. or just packet corruption). In such cases, we run into SMMU faults. To mitigate this, a buffer size of two check was introduced so even were this to happen, it would not cause SMMU errors. However, the support for this in UMD is not complete. Therefore, disable this check until UMD is able to comply with this buffer constraint. Jira L4T-7463 Change-Id: I2de31740284627ca117f1fa0a28bde2ef9a82785 Signed-off-by: Rakibul Hassan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3419644 Reviewed-by: Igor Mitsyanko GVS: buildbot_gerritrpt Reviewed-by: Narendra Kondapalli Reviewed-by: svcacv --- drivers/media/platform/tegra/camera/coe/rtcpu-coe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/tegra/camera/coe/rtcpu-coe.c b/drivers/media/platform/tegra/camera/coe/rtcpu-coe.c index 50450324..c5e9b029 100644 --- a/drivers/media/platform/tegra/camera/coe/rtcpu-coe.c +++ b/drivers/media/platform/tegra/camera/coe/rtcpu-coe.c @@ -639,7 +639,12 @@ static int coe_ioctl_handle_capture_req(struct coe_channel_state * const ch, * up to the next closest power of two boundary to eliminate a risk of a malformed * incoming network packet triggerring invalid memory access. */ +#define L4T7463 +#ifndef L4T7463 alloc_size_min = roundup_pow_of_two(req->buf_size); +#else + alloc_size_min = req->buf_size; +#endif if (alloc_size_min > buf_max_size) { dev_err(ch->dev, "CAPTURE_REQ: capture too long %u\n", req->buf_size);