firmware: imx: se_ctrl: serialize command receiver registration
PATCH 1/1 firmware: imx: se_ctrl: serialize command receiver registration
SE_IOCTL_ENABLE_CMD_RCV updates the global command receiver state in priv->cmd_receiver_clbk_hdl, but it is currently protected only by the per-file dev_ctx->fops_lock. Concurrent ioctl calls from different file descriptors can therefore race and register multiple receivers against the same priv instance.
Protect command receiver registration with priv->priv_dev_ctx->fops_lock, which serializes access to the shared callback state.
--- drivers/firmware/imx/se_ctrl.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/firmware/imx/se_ctrl.c +11 -10
@@ -919,21 +919,22 @@ static long se_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) scoped_cond_guard(mutex_intr, return -EBUSY, &dev_ctx->fops_lock) {switch (cmd) {case SE_IOCTL_ENABLE_CMD_RCV : -if (!priv->cmd_receiver_clbk_hdl.dev_ctx) { + scoped_guard(mutex, &priv->priv_dev_ctx->fops_lock) { +if (priv->cmd_receiver_clbk_hdl.dev_ctx) { + err = -EBUSY ; + goto out_enable_cmd_rcv; + } + priv->cmd_receiver_clbk_hdl.rx_msg = +kzalloc (MAX_NVM_MSG_LEN , +GFP_KERNEL );if (!priv->cmd_receiver_clbk_hdl.rx_msg) { - priv->cmd_receiver_clbk_hdl.rx_msg = -kzalloc (MAX_NVM_MSG_LEN , -GFP_KERNEL ); -if (!priv->cmd_receiver_clbk_hdl.rx_msg) { - err = -ENOMEM ; -break ; - } + err = -ENOMEM ; + goto out_enable_cmd_rcv; } priv->cmd_receiver_clbk_hdl.rx_msg_sz =MAX_NVM_MSG_LEN ; priv->cmd_receiver_clbk_hdl.dev_ctx = dev_ctx; err =0 ; - }else { - err = -EBUSY ; +out_enable_cmd_rcv: }break ;case SE_IOCTL_GET_MU_INFO :
Signature · 1 line
2.43.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider:
New issues:
- [Medium] Acquiring two mutexes of the same lock class without nested locking primitives triggers a lockdep warning.
- [Low] Placing a label at the end of a compound statement inside a scoped_guard causes a build breakage.
Pre-existing issues:
- [Critical] The hardware mailbox receive callback dereferences receiver state without validation or locks, causing panics on unexpected messages.
- [Critical] A missing else block causes bounds check capping to be immediately overwritten, leading to a heap buffer overflow.
- [High] Incomplete locking leaves a race condition between receiver registration and deregistration, leading to a Use-After-Free and list corruption.
- [High] The per-file dev_ctx is freed while its fops_lock is still held by scoped_cond_guard(), causing a UAF upon scope exit.
- [High] Using an interruptible lock in the .release file operation allows it to fail silently, permanently leaking resources. --
commit 8ac1aa6f680ca2f1601120862da0213321d4329f
Author: Pankaj Gupta <[email protected]>
firmware: imx: se_ctrl: serialize command receiver registration
This commit addresses a race condition in SE_IOCTL_ENABLE_CMD_RCV where concurrent ioctls from different file descriptors could register multiple receivers against the same priv instance. It attempts to serialize this by acquiring the global priv->priv_dev_ctx->fops_lock.
drivers/firmware/imx/se_ctrl.c static long se_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) · line 918
Quoted 10 lines
drivers/firmware/imx/se_ctrl.c +1
-1@@ -915,21 +915,22 @@ static long se_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) scoped_cond_guard(mutex_intr, return -EBUSY, &dev_ctx->fops_lock) {switch (cmd) {case SE_IOCTL_ENABLE_CMD_RCV : -if (!priv->cmd_receiver_clbk_hdl.dev_ctx) { + scoped_guard(mutex, &priv->priv_dev_ctx->fops_lock) {
[Severity: Medium]
Will this trigger a lockdep warning? We are acquiring priv->priv_dev_ctx->fops_lock while already holding dev_ctx->fops_lock. Because both mutexes belong to struct se_if_device_ctx and are initialized at the same time, they share the same lockdep lock class. Might this cause a "possible recursive locking detected" splat?
[Severity: High]
This is a pre-existing issue, but I noticed that this locking only protects the registration side. In se_if_fops_close(), the receiver is deregistered while only holding the per-file dev_ctx->fops_lock:
drivers/firmware/imx/se_ctrl.c:se_if_fops_close() {
scoped_cond_guard(mutex_intr, return -EBUSY, &dev_ctx->fops_lock) {
if (priv->cmd_receiver_clbk_hdl.dev_ctx == dev_ctx) {
priv->cmd_receiver_clbk_hdl.dev_ctx = NULL;
kfree(priv->cmd_receiver_clbk_hdl.rx_msg);
priv->cmd_receiver_clbk_hdl.rx_msg = NULL;
}
...
}Because se_if_fops_close() does not acquire priv->priv_dev_ctx->fops_lock, could a concurrent ioctl() and close() on different file descriptors race, leading to a use-after-free if close() frees the newly allocated rx_msg?
Quoted 15 lines
drivers/firmware/imx/se_ctrl.c +7
-7if (priv->cmd_receiver_clbk_hdl.dev_ctx) { - priv->cmd_receiver_clbk_hdl.rx_msg = -kzalloc (MAX_NVM_MSG_LEN , -GFP_KERNEL ); -if (!priv->cmd_receiver_clbk_hdl.rx_msg) { - err = -ENOMEM ; -break ; - } + err = -EBUSY ; + goto out_enable_cmd_rcv; + } + priv->cmd_receiver_clbk_hdl.rx_msg = +kzalloc (MAX_NVM_MSG_LEN , +GFP_KERNEL ); +if (!priv->cmd_receiver_clbk_hdl.rx_msg) {
drivers/firmware/imx/se_ctrl.c static long se_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) · line 938
Quoted 10 lines
drivers/firmware/imx/se_ctrl.c +3
-2+ err = -ENOMEM ; + goto out_enable_cmd_rcv; } priv->cmd_receiver_clbk_hdl.rx_msg_sz =MAX_NVM_MSG_LEN ; priv->cmd_receiver_clbk_hdl.dev_ctx = dev_ctx; err =0 ; - }else { - err = -EBUSY ; +out_enable_cmd_rcv: }
[Severity: Low]
Does this label cause a build breakage? The label out_enable_cmd_rcv: is placed immediately before the closing brace of the scoped_guard compound statement. In C (prior to C23), a label must precede a statement and cannot be attached directly to a closing brace.
[ ... ]
While looking at this code, I also noticed a few other pre-existing issues in the surrounding functions:
[Severity: High]
This is a pre-existing issue, but could the lock usage in se_if_fops_close() lead to a use-after-free and memory leaks?
drivers/firmware/imx/se_ctrl.c:se_if_fops_close() {
scoped_cond_guard(mutex_intr, return -EBUSY, &dev_ctx->fops_lock) {
...
kfree(dev_ctx);
}
return 0;
}When the scope ends, the implicit cleanup function calls mutex_unlock() on dev_ctx->fops_lock, but dev_ctx has already been freed. Will this cause memory corruption on every close?
Additionally, se_if_fops_close() is the VFS .release handler. It uses an interruptible lock acquisition, which can fail and return -EBUSY if the task has a pending signal. Since the VFS layer ignores the return value of .release and destroys the file regardless, will failing to acquire this lock permanently leak the dev_ctx memory and leave dangling pointers in priv->dev_ctx_list?
[Severity: Critical]
This is a pre-existing issue, but I noticed a potential null pointer dereference and a buffer overflow in the hardware mailbox receive callback:
drivers/firmware/imx/ele_common.c:se_if_rx_callback() {
...
if (header->tag == priv->if_defs->cmd_tag) {
se_clbk_hdl = &priv->cmd_receiver_clbk_hdl;
dev_dbg(dev, "Selecting cmd receiver:%s for mesg header:0x%x.",
se_clbk_hdl->dev_ctx->devname, *(u32 *)header);If no receiver is registered, se_clbk_hdl->dev_ctx and se_clbk_hdl->rx_msg will be NULL. Will this cause a kernel panic when devname is dereferenced?
Later in the same block:
if (rx_msg_sz > MAX_NVM_MSG_LEN) {
dev_err(dev,
"%s: CMD-RCVER NVM: hdr(0x%x) with different sz(%d != %d).\n",
se_clbk_hdl->dev_ctx->devname, *(u32 *)header,
rx_msg_sz, se_clbk_hdl->rx_msg_sz);
se_clbk_hdl->rx_msg_sz = MAX_NVM_MSG_LEN;
}
se_clbk_hdl->rx_msg_sz = rx_msg_sz;
...
}
...
memcpy(se_clbk_hdl->rx_msg, msg, se_clbk_hdl->rx_msg_sz);Because there is no else block after the size check, the bounded value MAX_NVM_MSG_LEN is immediately overwritten with the original out-of-bounds rx_msg_sz. Will this cause a severe heap buffer overflow when memcpy() is called using the unbounded size?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Pankaj,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20260527]
url: https://github.com/intel-lab-lkp/linux/commits/Pankaj-Gupta/firmware-imx-se_ctrl-serialize-command-receiver-registration/20260528-172942 base: next-20260527 patch link: https://lore.kernel.org/r/20260528091634.3331090-1-pankaj.gupta%40nxp.com patch subject: [PATCH -next] firmware: imx: se_ctrl: serialize command receiver registration config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260529/[email protected]/config) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260529/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/firmware/imx/se_ctrl.c:934:4: warning: label at end of compound statement is a C2x extension [-Wc2x-extensions]
934 | }
| ^1 warning generated.
vim +934 drivers/firmware/imx/se_ctrl.c
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 905
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 906 /* IOCTL entry point of a character device */
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 907 static long se_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 908 {
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 909 struct se_if_device_ctx *dev_ctx = fp->private_data;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 910 struct se_if_priv *priv = dev_ctx->priv;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 911 void __user *uarg = (void __user *)arg;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 912 long err;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 913
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 914 /* Prevent race during change of device context */
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 915 scoped_cond_guard(mutex_intr, return -EBUSY, &dev_ctx->fops_lock) {
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 916 switch (cmd) {
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 917 case SE_IOCTL_ENABLE_CMD_RCV:
8aff20bcff52903 Pankaj Gupta 2026-05-28 918 scoped_guard(mutex, &priv->priv_dev_ctx->fops_lock) {
8aff20bcff52903 Pankaj Gupta 2026-05-28 919 if (priv->cmd_receiver_clbk_hdl.dev_ctx) {
8aff20bcff52903 Pankaj Gupta 2026-05-28 920 err = -EBUSY;
8aff20bcff52903 Pankaj Gupta 2026-05-28 921 goto out_enable_cmd_rcv;
8aff20bcff52903 Pankaj Gupta 2026-05-28 922 }
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 923 priv->cmd_receiver_clbk_hdl.rx_msg =
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 924 kzalloc(MAX_NVM_MSG_LEN,
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 925 GFP_KERNEL);
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 926 if (!priv->cmd_receiver_clbk_hdl.rx_msg) {
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 927 err = -ENOMEM;
8aff20bcff52903 Pankaj Gupta 2026-05-28 928 goto out_enable_cmd_rcv;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 929 }
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 930 priv->cmd_receiver_clbk_hdl.rx_msg_sz = MAX_NVM_MSG_LEN;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 931 priv->cmd_receiver_clbk_hdl.dev_ctx = dev_ctx;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 932 err = 0;
8aff20bcff52903 Pankaj Gupta 2026-05-28 933 out_enable_cmd_rcv:
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 @934 }
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 935 break;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 936 case SE_IOCTL_GET_MU_INFO:
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 937 err = se_ioctl_get_mu_info(dev_ctx, uarg);
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 938 break;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 939 case SE_IOCTL_SETUP_IOBUF:
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 940 err = se_ioctl_setup_iobuf_handler(dev_ctx, uarg);
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 941 break;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 942 case SE_IOCTL_GET_SOC_INFO:
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 943 err = se_ioctl_get_se_soc_info_handler(dev_ctx, uarg);
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 944 break;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 945 case SE_IOCTL_CMD_SEND_RCV_RSP:
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 946 err = se_ioctl_cmd_snd_rcv_rsp_handler(dev_ctx, uarg);
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 947 break;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 948 default:
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 949 err = -EINVAL;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 950 dev_dbg(priv->dev, "%s: IOCTL %.8x not supported.",
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 951 dev_ctx->devname, cmd);
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 952 }
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 953 }
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 954
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 955 return err;
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 956 }
3ae9dcce8400f0a Pankaj Gupta 2026-01-22 957 --
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Pankaj,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20260527]
url: https://github.com/intel-lab-lkp/linux/commits/Pankaj-Gupta/firmware-imx-se_ctrl-serialize-command-receiver-registration/20260528-172942 base: next-20260527 patch link: https://lore.kernel.org/r/20260528091634.3331090-1-pankaj.gupta%40nxp.com patch subject: [PATCH -next] firmware: imx: se_ctrl: serialize command receiver registration config: s390-randconfig-r121-20260529 (https://download.01.org/0day-ci/archive/20260529/[email protected]/config) compiler: s390-linux-gcc (GCC) 8.5.0 sparse: v0.6.5-rc1 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260529/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/firmware/imx/se_ctrl.c: In function 'se_ioctl':
>> drivers/firmware/imx/se_ctrl.c:933:1: error: label at end of compound statement
out_enable_cmd_rcv:
^~~~~~~~~~~~~~~~~~Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for MFD_STMFX Depends on [n]: HAS_IOMEM [=y] && I2C [=y] && OF [=n] Selected by [m]:
- PINCTRL_STMFX [=m] && PINCTRL [=y] && I2C [=y] && HAS_IOMEM [=y]
vim +933 drivers/firmware/imx/se_ctrl.c
905
906 /* IOCTL entry point of a character device */
907 static long se_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
908 {
909 struct se_if_device_ctx *dev_ctx = fp->private_data;
910 struct se_if_priv *priv = dev_ctx->priv;
911 void __user *uarg = (void __user *)arg;
912 long err;
913
914 /* Prevent race during change of device context */
915 scoped_cond_guard(mutex_intr, return -EBUSY, &dev_ctx->fops_lock) {
916 switch (cmd) {
917 case SE_IOCTL_ENABLE_CMD_RCV:
918 scoped_guard(mutex, &priv->priv_dev_ctx->fops_lock) {
919 if (priv->cmd_receiver_clbk_hdl.dev_ctx) {
920 err = -EBUSY;
921 goto out_enable_cmd_rcv;
922 }
923 priv->cmd_receiver_clbk_hdl.rx_msg =
924 kzalloc(MAX_NVM_MSG_LEN,
925 GFP_KERNEL);
926 if (!priv->cmd_receiver_clbk_hdl.rx_msg) {
927 err = -ENOMEM;
928 goto out_enable_cmd_rcv;
929 }
930 priv->cmd_receiver_clbk_hdl.rx_msg_sz = MAX_NVM_MSG_LEN;
931 priv->cmd_receiver_clbk_hdl.dev_ctx = dev_ctx;
932 err = 0;
> 933 out_enable_cmd_rcv:
934 }
935 break;
936 case SE_IOCTL_GET_MU_INFO:
937 err = se_ioctl_get_mu_info(dev_ctx, uarg);
938 break;
939 case SE_IOCTL_SETUP_IOBUF:
940 err = se_ioctl_setup_iobuf_handler(dev_ctx, uarg);
941 break;
942 case SE_IOCTL_GET_SOC_INFO:
943 err = se_ioctl_get_se_soc_info_handler(dev_ctx, uarg);
944 break;
945 case SE_IOCTL_CMD_SEND_RCV_RSP:
946 err = se_ioctl_cmd_snd_rcv_rsp_handler(dev_ctx, uarg);
947 break;
948 default:
949 err = -EINVAL;
950 dev_dbg(priv->dev, "%s: IOCTL %.8x not supported.",
951 dev_ctx->devname, cmd);
952 }
953 }
954
955 return err;
956 }
957
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Pankaj,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20260527]
url: https://github.com/intel-lab-lkp/linux/commits/Pankaj-Gupta/firmware-imx-se_ctrl-serialize-command-receiver-registration/20260528-172942 base: next-20260527 patch link: https://lore.kernel.org/r/20260528091634.3331090-1-pankaj.gupta%40nxp.com patch subject: [PATCH -next] firmware: imx: se_ctrl: serialize command receiver registration config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20260529/[email protected]/config) compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260529/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/firmware/imx/se_ctrl.c:673:16: warning: result of comparison of constant 18446744073709551608 with expression of type '__u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
673 | if (io.length > SIZE_MAX - 7) {
| ~~~~~~~~~ ^ ~~~~~~~~~~~~
>> drivers/firmware/imx/se_ctrl.c:934:4: warning: label at end of compound statement is a C23 extension [-Wc23-extensions]
934 | }
| ^2 warnings generated.
vim +934 drivers/firmware/imx/se_ctrl.c
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 905
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 906 /* IOCTL entry point of a character device */
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 907 static long se_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 908 {
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 909 struct se_if_device_ctx *dev_ctx = fp->private_data;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 910 struct se_if_priv *priv = dev_ctx->priv;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 911 void __user *uarg = (void __user *)arg;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 912 long err;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 913
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 914 /* Prevent race during change of device context */
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 915 scoped_cond_guard(mutex_intr, return -EBUSY, &dev_ctx->fops_lock) {
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 916 switch (cmd) {
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 917 case SE_IOCTL_ENABLE_CMD_RCV:
8aff20bcff5290 Pankaj Gupta 2026-05-28 918 scoped_guard(mutex, &priv->priv_dev_ctx->fops_lock) {
8aff20bcff5290 Pankaj Gupta 2026-05-28 919 if (priv->cmd_receiver_clbk_hdl.dev_ctx) {
8aff20bcff5290 Pankaj Gupta 2026-05-28 920 err = -EBUSY;
8aff20bcff5290 Pankaj Gupta 2026-05-28 921 goto out_enable_cmd_rcv;
8aff20bcff5290 Pankaj Gupta 2026-05-28 922 }
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 923 priv->cmd_receiver_clbk_hdl.rx_msg =
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 924 kzalloc(MAX_NVM_MSG_LEN,
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 925 GFP_KERNEL);
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 926 if (!priv->cmd_receiver_clbk_hdl.rx_msg) {
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 927 err = -ENOMEM;
8aff20bcff5290 Pankaj Gupta 2026-05-28 928 goto out_enable_cmd_rcv;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 929 }
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 930 priv->cmd_receiver_clbk_hdl.rx_msg_sz = MAX_NVM_MSG_LEN;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 931 priv->cmd_receiver_clbk_hdl.dev_ctx = dev_ctx;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 932 err = 0;
8aff20bcff5290 Pankaj Gupta 2026-05-28 933 out_enable_cmd_rcv:
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 @934 }
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 935 break;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 936 case SE_IOCTL_GET_MU_INFO:
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 937 err = se_ioctl_get_mu_info(dev_ctx, uarg);
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 938 break;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 939 case SE_IOCTL_SETUP_IOBUF:
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 940 err = se_ioctl_setup_iobuf_handler(dev_ctx, uarg);
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 941 break;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 942 case SE_IOCTL_GET_SOC_INFO:
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 943 err = se_ioctl_get_se_soc_info_handler(dev_ctx, uarg);
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 944 break;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 945 case SE_IOCTL_CMD_SEND_RCV_RSP:
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 946 err = se_ioctl_cmd_snd_rcv_rsp_handler(dev_ctx, uarg);
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 947 break;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 948 default:
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 949 err = -EINVAL;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 950 dev_dbg(priv->dev, "%s: IOCTL %.8x not supported.",
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 951 dev_ctx->devname, cmd);
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 952 }
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 953 }
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 954
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 955 return err;
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 956 }
3ae9dcce8400f0 Pankaj Gupta 2026-01-22 957 --
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki