mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
mei: more prints with client prefix
Use client-aware print macro instead of usual device print in more places to expand debug-ability. The client-aware print macro prefixes the usual device print with current connection endpoints. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Link: https://lore.kernel.org/r/20250717141112.1696482-3-alexander.usyskin@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3fd97f2292
commit
631ae0c010
3 changed files with 34 additions and 37 deletions
|
@ -510,7 +510,7 @@ int mei_hbm_cl_notify_req(struct mei_device *dev,
|
||||||
|
|
||||||
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
|
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_err(dev->dev, "notify request failed: ret = %d\n", ret);
|
cl_err(dev, cl, "notify request failed: ret = %d\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -626,7 +626,7 @@ int mei_hbm_cl_dma_map_req(struct mei_device *dev, struct mei_cl *cl)
|
||||||
|
|
||||||
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
|
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_err(dev->dev, "dma map request failed: ret = %d\n", ret);
|
cl_err(dev, cl, "dma map request failed: ret = %d\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -654,7 +654,7 @@ int mei_hbm_cl_dma_unmap_req(struct mei_device *dev, struct mei_cl *cl)
|
||||||
|
|
||||||
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
|
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_err(dev->dev, "dma unmap request failed: ret = %d\n", ret);
|
cl_err(dev, cl, "dma unmap request failed: ret = %d\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -679,10 +679,10 @@ static void mei_hbm_cl_dma_map_res(struct mei_device *dev,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (res->status) {
|
if (res->status) {
|
||||||
dev_err(dev->dev, "cl dma map failed %d\n", res->status);
|
cl_err(dev, cl, "cl dma map failed %d\n", res->status);
|
||||||
cl->status = -EFAULT;
|
cl->status = -EFAULT;
|
||||||
} else {
|
} else {
|
||||||
dev_dbg(dev->dev, "cl dma map succeeded\n");
|
cl_dbg(dev, cl, "cl dma map succeeded\n");
|
||||||
cl->dma_mapped = 1;
|
cl->dma_mapped = 1;
|
||||||
cl->status = 0;
|
cl->status = 0;
|
||||||
}
|
}
|
||||||
|
@ -709,10 +709,10 @@ static void mei_hbm_cl_dma_unmap_res(struct mei_device *dev,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (res->status) {
|
if (res->status) {
|
||||||
dev_err(dev->dev, "cl dma unmap failed %d\n", res->status);
|
cl_err(dev, cl, "cl dma unmap failed %d\n", res->status);
|
||||||
cl->status = -EFAULT;
|
cl->status = -EFAULT;
|
||||||
} else {
|
} else {
|
||||||
dev_dbg(dev->dev, "cl dma unmap succeeded\n");
|
cl_dbg(dev, cl, "cl dma unmap succeeded\n");
|
||||||
cl->dma_mapped = 0;
|
cl->dma_mapped = 0;
|
||||||
cl->status = 0;
|
cl->status = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ void mei_irq_compl_handler(struct mei_device *dev, struct list_head *cmpl_list)
|
||||||
cl = cb->cl;
|
cl = cb->cl;
|
||||||
list_del_init(&cb->list);
|
list_del_init(&cb->list);
|
||||||
|
|
||||||
dev_dbg(dev->dev, "completing call back.\n");
|
cl_dbg(dev, cl, "completing call back.\n");
|
||||||
mei_cl_complete(cl, cb);
|
mei_cl_complete(cl, cb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,7 @@ copy_buffer:
|
||||||
length = min_t(size_t, length, cb->buf_idx - *offset);
|
length = min_t(size_t, length, cb->buf_idx - *offset);
|
||||||
|
|
||||||
if (copy_to_user(ubuf, cb->buf.data + *offset, length)) {
|
if (copy_to_user(ubuf, cb->buf.data + *offset, length)) {
|
||||||
dev_dbg(dev->dev, "failed to copy data to userland\n");
|
cl_dbg(dev, cl, "failed to copy data to userland\n");
|
||||||
rets = -EFAULT;
|
rets = -EFAULT;
|
||||||
goto free;
|
goto free;
|
||||||
}
|
}
|
||||||
|
@ -379,7 +379,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
|
||||||
|
|
||||||
rets = copy_from_user(cb->buf.data, ubuf, length);
|
rets = copy_from_user(cb->buf.data, ubuf, length);
|
||||||
if (rets) {
|
if (rets) {
|
||||||
dev_dbg(dev->dev, "failed to copy data from userland\n");
|
cl_dbg(dev, cl, "failed to copy data from userland\n");
|
||||||
rets = -EFAULT;
|
rets = -EFAULT;
|
||||||
mei_io_cb_free(cb);
|
mei_io_cb_free(cb);
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -421,7 +421,7 @@ static int mei_ioctl_connect_client(struct file *file,
|
||||||
/* find ME client we're trying to connect to */
|
/* find ME client we're trying to connect to */
|
||||||
me_cl = mei_me_cl_by_uuid(dev, in_client_uuid);
|
me_cl = mei_me_cl_by_uuid(dev, in_client_uuid);
|
||||||
if (!me_cl) {
|
if (!me_cl) {
|
||||||
dev_dbg(dev->dev, "Cannot connect to FW Client UUID = %pUl\n",
|
cl_dbg(dev, cl, "Cannot connect to FW Client UUID = %pUl\n",
|
||||||
in_client_uuid);
|
in_client_uuid);
|
||||||
rets = -ENOTTY;
|
rets = -ENOTTY;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -431,24 +431,21 @@ static int mei_ioctl_connect_client(struct file *file,
|
||||||
bool forbidden = dev->override_fixed_address ?
|
bool forbidden = dev->override_fixed_address ?
|
||||||
!dev->allow_fixed_address : !dev->hbm_f_fa_supported;
|
!dev->allow_fixed_address : !dev->hbm_f_fa_supported;
|
||||||
if (forbidden) {
|
if (forbidden) {
|
||||||
dev_dbg(dev->dev, "Connection forbidden to FW Client UUID = %pUl\n",
|
cl_dbg(dev, cl, "Connection forbidden to FW Client UUID = %pUl\n",
|
||||||
in_client_uuid);
|
in_client_uuid);
|
||||||
rets = -ENOTTY;
|
rets = -ENOTTY;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_dbg(dev->dev, "Connect to FW Client ID = %d\n",
|
cl_dbg(dev, cl, "Connect to FW Client ID = %d\n", me_cl->client_id);
|
||||||
me_cl->client_id);
|
cl_dbg(dev, cl, "FW Client - Protocol Version = %d\n", me_cl->props.protocol_version);
|
||||||
dev_dbg(dev->dev, "FW Client - Protocol Version = %d\n",
|
cl_dbg(dev, cl, "FW Client - Max Msg Len = %d\n", me_cl->props.max_msg_length);
|
||||||
me_cl->props.protocol_version);
|
|
||||||
dev_dbg(dev->dev, "FW Client - Max Msg Len = %d\n",
|
|
||||||
me_cl->props.max_msg_length);
|
|
||||||
|
|
||||||
/* prepare the output buffer */
|
/* prepare the output buffer */
|
||||||
client->max_msg_length = me_cl->props.max_msg_length;
|
client->max_msg_length = me_cl->props.max_msg_length;
|
||||||
client->protocol_version = me_cl->props.protocol_version;
|
client->protocol_version = me_cl->props.protocol_version;
|
||||||
dev_dbg(dev->dev, "Can connect?\n");
|
cl_dbg(dev, cl, "Can connect?\n");
|
||||||
|
|
||||||
rets = mei_cl_connect(cl, me_cl, file);
|
rets = mei_cl_connect(cl, me_cl, file);
|
||||||
|
|
||||||
|
@ -515,19 +512,19 @@ static int mei_ioctl_connect_vtag(struct file *file,
|
||||||
cl = file->private_data;
|
cl = file->private_data;
|
||||||
dev = cl->dev;
|
dev = cl->dev;
|
||||||
|
|
||||||
dev_dbg(dev->dev, "FW Client %pUl vtag %d\n", in_client_uuid, vtag);
|
cl_dbg(dev, cl, "FW Client %pUl vtag %d\n", in_client_uuid, vtag);
|
||||||
|
|
||||||
switch (cl->state) {
|
switch (cl->state) {
|
||||||
case MEI_FILE_DISCONNECTED:
|
case MEI_FILE_DISCONNECTED:
|
||||||
if (mei_cl_vtag_by_fp(cl, file) != vtag) {
|
if (mei_cl_vtag_by_fp(cl, file) != vtag) {
|
||||||
dev_err(dev->dev, "reconnect with different vtag\n");
|
cl_err(dev, cl, "reconnect with different vtag\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MEI_FILE_INITIALIZING:
|
case MEI_FILE_INITIALIZING:
|
||||||
/* malicious connect from another thread may push vtag */
|
/* malicious connect from another thread may push vtag */
|
||||||
if (!IS_ERR(mei_cl_fp_by_vtag(cl, vtag))) {
|
if (!IS_ERR(mei_cl_fp_by_vtag(cl, vtag))) {
|
||||||
dev_err(dev->dev, "vtag already filled\n");
|
cl_err(dev, cl, "vtag already filled\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -546,7 +543,7 @@ static int mei_ioctl_connect_vtag(struct file *file,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* replace cl with acquired one */
|
/* replace cl with acquired one */
|
||||||
dev_dbg(dev->dev, "replacing with existing cl\n");
|
cl_dbg(dev, cl, "replacing with existing cl\n");
|
||||||
mei_cl_unlink(cl);
|
mei_cl_unlink(cl);
|
||||||
kfree(cl);
|
kfree(cl);
|
||||||
file->private_data = pos;
|
file->private_data = pos;
|
||||||
|
@ -656,7 +653,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||||
|
|
||||||
dev = cl->dev;
|
dev = cl->dev;
|
||||||
|
|
||||||
dev_dbg(dev->dev, "IOCTL cmd = 0x%x", cmd);
|
cl_dbg(dev, cl, "IOCTL cmd = 0x%x", cmd);
|
||||||
|
|
||||||
mutex_lock(&dev->device_lock);
|
mutex_lock(&dev->device_lock);
|
||||||
if (dev->dev_state != MEI_DEV_ENABLED) {
|
if (dev->dev_state != MEI_DEV_ENABLED) {
|
||||||
|
@ -666,9 +663,9 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case IOCTL_MEI_CONNECT_CLIENT:
|
case IOCTL_MEI_CONNECT_CLIENT:
|
||||||
dev_dbg(dev->dev, ": IOCTL_MEI_CONNECT_CLIENT.\n");
|
cl_dbg(dev, cl, "IOCTL_MEI_CONNECT_CLIENT\n");
|
||||||
if (copy_from_user(&conn, (char __user *)data, sizeof(conn))) {
|
if (copy_from_user(&conn, (char __user *)data, sizeof(conn))) {
|
||||||
dev_dbg(dev->dev, "failed to copy data from userland\n");
|
cl_dbg(dev, cl, "failed to copy data from userland\n");
|
||||||
rets = -EFAULT;
|
rets = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -689,7 +686,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||||
|
|
||||||
/* if all is ok, copying the data back to user. */
|
/* if all is ok, copying the data back to user. */
|
||||||
if (copy_to_user((char __user *)data, &conn, sizeof(conn))) {
|
if (copy_to_user((char __user *)data, &conn, sizeof(conn))) {
|
||||||
dev_dbg(dev->dev, "failed to copy data to userland\n");
|
cl_dbg(dev, cl, "failed to copy data to userland\n");
|
||||||
rets = -EFAULT;
|
rets = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -697,10 +694,10 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IOCTL_MEI_CONNECT_CLIENT_VTAG:
|
case IOCTL_MEI_CONNECT_CLIENT_VTAG:
|
||||||
dev_dbg(dev->dev, "IOCTL_MEI_CONNECT_CLIENT_VTAG\n");
|
cl_dbg(dev, cl, "IOCTL_MEI_CONNECT_CLIENT_VTAG\n");
|
||||||
if (copy_from_user(&conn_vtag, (char __user *)data,
|
if (copy_from_user(&conn_vtag, (char __user *)data,
|
||||||
sizeof(conn_vtag))) {
|
sizeof(conn_vtag))) {
|
||||||
dev_dbg(dev->dev, "failed to copy data from userland\n");
|
cl_dbg(dev, cl, "failed to copy data from userland\n");
|
||||||
rets = -EFAULT;
|
rets = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -711,13 +708,13 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||||
|
|
||||||
rets = mei_vt_support_check(dev, cl_uuid);
|
rets = mei_vt_support_check(dev, cl_uuid);
|
||||||
if (rets == -EOPNOTSUPP)
|
if (rets == -EOPNOTSUPP)
|
||||||
dev_dbg(dev->dev, "FW Client %pUl does not support vtags\n",
|
cl_dbg(dev, cl, "FW Client %pUl does not support vtags\n",
|
||||||
cl_uuid);
|
cl_uuid);
|
||||||
if (rets)
|
if (rets)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!vtag) {
|
if (!vtag) {
|
||||||
dev_dbg(dev->dev, "vtag can't be zero\n");
|
cl_dbg(dev, cl, "vtag can't be zero\n");
|
||||||
rets = -EINVAL;
|
rets = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -729,7 +726,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||||
/* if all is ok, copying the data back to user. */
|
/* if all is ok, copying the data back to user. */
|
||||||
if (copy_to_user((char __user *)data, &conn_vtag,
|
if (copy_to_user((char __user *)data, &conn_vtag,
|
||||||
sizeof(conn_vtag))) {
|
sizeof(conn_vtag))) {
|
||||||
dev_dbg(dev->dev, "failed to copy data to userland\n");
|
cl_dbg(dev, cl, "failed to copy data to userland\n");
|
||||||
rets = -EFAULT;
|
rets = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -737,10 +734,10 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IOCTL_MEI_NOTIFY_SET:
|
case IOCTL_MEI_NOTIFY_SET:
|
||||||
dev_dbg(dev->dev, ": IOCTL_MEI_NOTIFY_SET.\n");
|
cl_dbg(dev, cl, "IOCTL_MEI_NOTIFY_SET\n");
|
||||||
if (copy_from_user(¬ify_req,
|
if (copy_from_user(¬ify_req,
|
||||||
(char __user *)data, sizeof(notify_req))) {
|
(char __user *)data, sizeof(notify_req))) {
|
||||||
dev_dbg(dev->dev, "failed to copy data from userland\n");
|
cl_dbg(dev, cl, "failed to copy data from userland\n");
|
||||||
rets = -EFAULT;
|
rets = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -748,15 +745,15 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IOCTL_MEI_NOTIFY_GET:
|
case IOCTL_MEI_NOTIFY_GET:
|
||||||
dev_dbg(dev->dev, ": IOCTL_MEI_NOTIFY_GET.\n");
|
cl_dbg(dev, cl, "IOCTL_MEI_NOTIFY_GET\n");
|
||||||
rets = mei_ioctl_client_notify_get(file, ¬ify_get);
|
rets = mei_ioctl_client_notify_get(file, ¬ify_get);
|
||||||
if (rets)
|
if (rets)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
dev_dbg(dev->dev, "copy connect data to user\n");
|
cl_dbg(dev, cl, "copy connect data to user\n");
|
||||||
if (copy_to_user((char __user *)data,
|
if (copy_to_user((char __user *)data,
|
||||||
¬ify_get, sizeof(notify_get))) {
|
¬ify_get, sizeof(notify_get))) {
|
||||||
dev_dbg(dev->dev, "failed to copy data to userland\n");
|
cl_dbg(dev, cl, "failed to copy data to userland\n");
|
||||||
rets = -EFAULT;
|
rets = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue