Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_firmware.c Create Date:2022-07-28 06:28:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:We use a kthread as otherwise the kernel serializes all our sync requests* and we would not be able to mimic batched requests on a sync call. Batched* requests on a sync call can for instance happen on a device driver when

Proto:static ssize_t trigger_batched_requests_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)

Type:ssize_t

Parameter:

TypeParameterName
struct device *dev
struct device_attribute *attr
const char *buf
size_tcount
665  mutex_lock( & test_fw_mutex)
667  These below don't belong her but we'll move them once we create* a struct fw_test_device and stuff the misc_dev under there later. = vzalloc(array3_size() - Calculate size of 3-dimensional array.*@a: dimension one*@b: dimension two*@c: dimension three* Calculates size of 3-dimensional array: @a *@b *@c.* Returns: number of bytes needed to represent the array or SIZE_MAX on* overflow.)
670  If Not These below don't belong her but we'll move them once we create* a struct fw_test_device and stuff the misc_dev under there later. Then
671  rc = -ENOMEM
672  Go to out_unlock
675  pr_info("batched sync firmware loading '%s' %u times\n", name, num_requests)
678  When i < num_requests cycle
679  req = These below don't belong her but we'll move them once we create* a struct fw_test_device and stuff the misc_dev under there later.[i]
680  fw = NULL
681  idx = i
682  name = name
683  dev = dev
684  init_completion( & completion)
685  task = kthread_run - create and wake a thread.*@threadfn: the function to run until signal_pending(current).*@data: data ptr for @threadfn.*@namefmt: printf-style name for the thread.* Description: Convenient wrapper for kthread_create() followed by(test_fw_run_batch_request, req, "%s-%u", KBUILD_MODNAME, idx)
687  If Not task || IS_ERR(task) Then
688  pr_err("Setting up thread %u failed\n", idx)
689  task = NULL
690  rc = -ENOMEM
691  Go to out_bail
695  rc = count
705  out_bail :
706  When i < num_requests cycle
707  req = These below don't belong her but we'll move them once we create* a struct fw_test_device and stuff the misc_dev under there later.[i]
708  If task || sent Then wait_for_completion( & completion)
713  If rc < 0 Then test_result = rc
716  out_unlock :
717  mutex_unlock( & test_fw_mutex)
719  Return rc