Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Alexander Usyskin and committed by
Greg Kroah-Hartman
631ae0c0 3fd97f22

+34 -37
+7 -7
drivers/misc/mei/hbm.c
··· 510 510 511 511 ret = mei_hbm_write_message(dev, &mei_hdr, &req); 512 512 if (ret) 513 - dev_err(dev->dev, "notify request failed: ret = %d\n", ret); 513 + cl_err(dev, cl, "notify request failed: ret = %d\n", ret); 514 514 515 515 return ret; 516 516 } ··· 626 626 627 627 ret = mei_hbm_write_message(dev, &mei_hdr, &req); 628 628 if (ret) 629 - dev_err(dev->dev, "dma map request failed: ret = %d\n", ret); 629 + cl_err(dev, cl, "dma map request failed: ret = %d\n", ret); 630 630 631 631 return ret; 632 632 } ··· 654 654 655 655 ret = mei_hbm_write_message(dev, &mei_hdr, &req); 656 656 if (ret) 657 - dev_err(dev->dev, "dma unmap request failed: ret = %d\n", ret); 657 + cl_err(dev, cl, "dma unmap request failed: ret = %d\n", ret); 658 658 659 659 return ret; 660 660 } ··· 679 679 return; 680 680 681 681 if (res->status) { 682 - dev_err(dev->dev, "cl dma map failed %d\n", res->status); 682 + cl_err(dev, cl, "cl dma map failed %d\n", res->status); 683 683 cl->status = -EFAULT; 684 684 } else { 685 - dev_dbg(dev->dev, "cl dma map succeeded\n"); 685 + cl_dbg(dev, cl, "cl dma map succeeded\n"); 686 686 cl->dma_mapped = 1; 687 687 cl->status = 0; 688 688 } ··· 709 709 return; 710 710 711 711 if (res->status) { 712 - dev_err(dev->dev, "cl dma unmap failed %d\n", res->status); 712 + cl_err(dev, cl, "cl dma unmap failed %d\n", res->status); 713 713 cl->status = -EFAULT; 714 714 } else { 715 - dev_dbg(dev->dev, "cl dma unmap succeeded\n"); 715 + cl_dbg(dev, cl, "cl dma unmap succeeded\n"); 716 716 cl->dma_mapped = 0; 717 717 cl->status = 0; 718 718 }
+1 -1
drivers/misc/mei/interrupt.c
··· 35 35 cl = cb->cl; 36 36 list_del_init(&cb->list); 37 37 38 - dev_dbg(dev->dev, "completing call back.\n"); 38 + cl_dbg(dev, cl, "completing call back.\n"); 39 39 mei_cl_complete(cl, cb); 40 40 } 41 41 }
+26 -29
drivers/misc/mei/main.c
··· 256 256 length = min_t(size_t, length, cb->buf_idx - *offset); 257 257 258 258 if (copy_to_user(ubuf, cb->buf.data + *offset, length)) { 259 - dev_dbg(dev->dev, "failed to copy data to userland\n"); 259 + cl_dbg(dev, cl, "failed to copy data to userland\n"); 260 260 rets = -EFAULT; 261 261 goto free; 262 262 } ··· 379 379 380 380 rets = copy_from_user(cb->buf.data, ubuf, length); 381 381 if (rets) { 382 - dev_dbg(dev->dev, "failed to copy data from userland\n"); 382 + cl_dbg(dev, cl, "failed to copy data from userland\n"); 383 383 rets = -EFAULT; 384 384 mei_io_cb_free(cb); 385 385 goto out; ··· 421 421 /* find ME client we're trying to connect to */ 422 422 me_cl = mei_me_cl_by_uuid(dev, in_client_uuid); 423 423 if (!me_cl) { 424 - dev_dbg(dev->dev, "Cannot connect to FW Client UUID = %pUl\n", 424 + cl_dbg(dev, cl, "Cannot connect to FW Client UUID = %pUl\n", 425 425 in_client_uuid); 426 426 rets = -ENOTTY; 427 427 goto end; ··· 431 431 bool forbidden = dev->override_fixed_address ? 432 432 !dev->allow_fixed_address : !dev->hbm_f_fa_supported; 433 433 if (forbidden) { 434 - dev_dbg(dev->dev, "Connection forbidden to FW Client UUID = %pUl\n", 434 + cl_dbg(dev, cl, "Connection forbidden to FW Client UUID = %pUl\n", 435 435 in_client_uuid); 436 436 rets = -ENOTTY; 437 437 goto end; 438 438 } 439 439 } 440 440 441 - dev_dbg(dev->dev, "Connect to FW Client ID = %d\n", 442 - me_cl->client_id); 443 - dev_dbg(dev->dev, "FW Client - Protocol Version = %d\n", 444 - me_cl->props.protocol_version); 445 - dev_dbg(dev->dev, "FW Client - Max Msg Len = %d\n", 446 - me_cl->props.max_msg_length); 441 + cl_dbg(dev, cl, "Connect to FW Client ID = %d\n", me_cl->client_id); 442 + cl_dbg(dev, cl, "FW Client - Protocol Version = %d\n", me_cl->props.protocol_version); 443 + cl_dbg(dev, cl, "FW Client - Max Msg Len = %d\n", me_cl->props.max_msg_length); 447 444 448 445 /* prepare the output buffer */ 449 446 client->max_msg_length = me_cl->props.max_msg_length; 450 447 client->protocol_version = me_cl->props.protocol_version; 451 - dev_dbg(dev->dev, "Can connect?\n"); 448 + cl_dbg(dev, cl, "Can connect?\n"); 452 449 453 450 rets = mei_cl_connect(cl, me_cl, file); 454 451 ··· 512 515 cl = file->private_data; 513 516 dev = cl->dev; 514 517 515 - dev_dbg(dev->dev, "FW Client %pUl vtag %d\n", in_client_uuid, vtag); 518 + cl_dbg(dev, cl, "FW Client %pUl vtag %d\n", in_client_uuid, vtag); 516 519 517 520 switch (cl->state) { 518 521 case MEI_FILE_DISCONNECTED: 519 522 if (mei_cl_vtag_by_fp(cl, file) != vtag) { 520 - dev_err(dev->dev, "reconnect with different vtag\n"); 523 + cl_err(dev, cl, "reconnect with different vtag\n"); 521 524 return -EINVAL; 522 525 } 523 526 break; 524 527 case MEI_FILE_INITIALIZING: 525 528 /* malicious connect from another thread may push vtag */ 526 529 if (!IS_ERR(mei_cl_fp_by_vtag(cl, vtag))) { 527 - dev_err(dev->dev, "vtag already filled\n"); 530 + cl_err(dev, cl, "vtag already filled\n"); 528 531 return -EINVAL; 529 532 } 530 533 ··· 543 546 continue; 544 547 545 548 /* replace cl with acquired one */ 546 - dev_dbg(dev->dev, "replacing with existing cl\n"); 549 + cl_dbg(dev, cl, "replacing with existing cl\n"); 547 550 mei_cl_unlink(cl); 548 551 kfree(cl); 549 552 file->private_data = pos; ··· 653 656 654 657 dev = cl->dev; 655 658 656 - dev_dbg(dev->dev, "IOCTL cmd = 0x%x", cmd); 659 + cl_dbg(dev, cl, "IOCTL cmd = 0x%x", cmd); 657 660 658 661 mutex_lock(&dev->device_lock); 659 662 if (dev->dev_state != MEI_DEV_ENABLED) { ··· 663 666 664 667 switch (cmd) { 665 668 case IOCTL_MEI_CONNECT_CLIENT: 666 - dev_dbg(dev->dev, ": IOCTL_MEI_CONNECT_CLIENT.\n"); 669 + cl_dbg(dev, cl, "IOCTL_MEI_CONNECT_CLIENT\n"); 667 670 if (copy_from_user(&conn, (char __user *)data, sizeof(conn))) { 668 - dev_dbg(dev->dev, "failed to copy data from userland\n"); 671 + cl_dbg(dev, cl, "failed to copy data from userland\n"); 669 672 rets = -EFAULT; 670 673 goto out; 671 674 } ··· 686 689 687 690 /* if all is ok, copying the data back to user. */ 688 691 if (copy_to_user((char __user *)data, &conn, sizeof(conn))) { 689 - dev_dbg(dev->dev, "failed to copy data to userland\n"); 692 + cl_dbg(dev, cl, "failed to copy data to userland\n"); 690 693 rets = -EFAULT; 691 694 goto out; 692 695 } ··· 694 697 break; 695 698 696 699 case IOCTL_MEI_CONNECT_CLIENT_VTAG: 697 - dev_dbg(dev->dev, "IOCTL_MEI_CONNECT_CLIENT_VTAG\n"); 700 + cl_dbg(dev, cl, "IOCTL_MEI_CONNECT_CLIENT_VTAG\n"); 698 701 if (copy_from_user(&conn_vtag, (char __user *)data, 699 702 sizeof(conn_vtag))) { 700 - dev_dbg(dev->dev, "failed to copy data from userland\n"); 703 + cl_dbg(dev, cl, "failed to copy data from userland\n"); 701 704 rets = -EFAULT; 702 705 goto out; 703 706 } ··· 708 711 709 712 rets = mei_vt_support_check(dev, cl_uuid); 710 713 if (rets == -EOPNOTSUPP) 711 - dev_dbg(dev->dev, "FW Client %pUl does not support vtags\n", 714 + cl_dbg(dev, cl, "FW Client %pUl does not support vtags\n", 712 715 cl_uuid); 713 716 if (rets) 714 717 goto out; 715 718 716 719 if (!vtag) { 717 - dev_dbg(dev->dev, "vtag can't be zero\n"); 720 + cl_dbg(dev, cl, "vtag can't be zero\n"); 718 721 rets = -EINVAL; 719 722 goto out; 720 723 } ··· 726 729 /* if all is ok, copying the data back to user. */ 727 730 if (copy_to_user((char __user *)data, &conn_vtag, 728 731 sizeof(conn_vtag))) { 729 - dev_dbg(dev->dev, "failed to copy data to userland\n"); 732 + cl_dbg(dev, cl, "failed to copy data to userland\n"); 730 733 rets = -EFAULT; 731 734 goto out; 732 735 } ··· 734 737 break; 735 738 736 739 case IOCTL_MEI_NOTIFY_SET: 737 - dev_dbg(dev->dev, ": IOCTL_MEI_NOTIFY_SET.\n"); 740 + cl_dbg(dev, cl, "IOCTL_MEI_NOTIFY_SET\n"); 738 741 if (copy_from_user(&notify_req, 739 742 (char __user *)data, sizeof(notify_req))) { 740 - dev_dbg(dev->dev, "failed to copy data from userland\n"); 743 + cl_dbg(dev, cl, "failed to copy data from userland\n"); 741 744 rets = -EFAULT; 742 745 goto out; 743 746 } ··· 745 748 break; 746 749 747 750 case IOCTL_MEI_NOTIFY_GET: 748 - dev_dbg(dev->dev, ": IOCTL_MEI_NOTIFY_GET.\n"); 751 + cl_dbg(dev, cl, "IOCTL_MEI_NOTIFY_GET\n"); 749 752 rets = mei_ioctl_client_notify_get(file, &notify_get); 750 753 if (rets) 751 754 goto out; 752 755 753 - dev_dbg(dev->dev, "copy connect data to user\n"); 756 + cl_dbg(dev, cl, "copy connect data to user\n"); 754 757 if (copy_to_user((char __user *)data, 755 758 &notify_get, sizeof(notify_get))) { 756 - dev_dbg(dev->dev, "failed to copy data to userland\n"); 759 + cl_dbg(dev, cl, "failed to copy data to userland\n"); 757 760 rets = -EFAULT; 758 761 goto out; 759 762