diff options
author | Aurora pro automerger <aurora-pro-automerger@google.com> | 2022-08-09 03:58:01 +0000 |
---|---|---|
committer | John Scheible <johnscheible@google.com> | 2022-08-10 17:39:37 +0000 |
commit | 261baf5aa92fe1fb8a0a30d7e971117ed5b36de9 (patch) | |
tree | bee6c35ce8f9a700109886588d00a8519d894903 /gxp-debugfs.c | |
parent | 51345064a78c4fbee30e5c331a41c0dfab852fa0 (diff) | |
download | gs201-261baf5aa92fe1fb8a0a30d7e971117ed5b36de9.tar.gz |
[Copybara Auto Merge]
gxp: release TPU file after VD stop
Bug: 241085004
gxp: increase the ref to TPU FD on TPU buffer map
Bug: 241085004 (repeat)
gxp: Fail to start a VD if initial mapping fails
Bug: 241090227
gxp: Only (un)map telem if enabled on vd start/stop
Bug: 241090227 (repeat)
gxp: Cancel last worker when power req queue is full
Bug: 240533763
gxp: Disallow /d/gxp/firmware_run if VDs are running
Bug: 240764261
gxp: Cleanup FW data on VD creation failure
Bug: 240999290
gxp: Review feedback from 7/21 release
Bug: 240315433
gxp: Map telemetry buffs before writing descriptor
Bug: 239640408
gxp: Re-enable telemetry mapping changes
GitOrigin-RevId: c8adc76aa961c881ae2c41d71ec045308939e233
Change-Id: I17eb0436551f00fcf8ba41b24713002b947ab08f
Diffstat (limited to 'gxp-debugfs.c')
-rw-r--r-- | gxp-debugfs.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gxp-debugfs.c b/gxp-debugfs.c index a04a3f2..e1b199b 100644 --- a/gxp-debugfs.c +++ b/gxp-debugfs.c @@ -77,6 +77,7 @@ static int gxp_firmware_run_set(void *data, u64 val) struct gxp_dev *gxp = (struct gxp_dev *) data; struct gxp_client *client; int ret = 0; + uint core; ret = gxp_firmware_request_if_needed(gxp); if (ret) { @@ -94,6 +95,22 @@ static int gxp_firmware_run_set(void *data, u64 val) } /* + * Since this debugfs node destroys, then creates new fw_data, + * and runs firmware on every DSP core, it cannot be run if + * any of the cores already has a VD running on it. + */ + down_write(&gxp->vd_semaphore); + for (core = 0; core < GXP_NUM_CORES; core++) { + if (gxp->core_to_vd[core]) { + dev_err(gxp->dev, + "Unable to run firmware with debugfs while other clients are running\n"); + ret = -EBUSY; + up_write(&gxp->vd_semaphore); + goto out; + } + } + + /* * Cleanup any bad state or corruption the device might've * caused */ @@ -125,7 +142,6 @@ static int gxp_firmware_run_set(void *data, u64 val) AUR_MEM_UNDEFINED, AUR_MEM_UNDEFINED); - down_write(&gxp->vd_semaphore); ret = gxp_vd_start(gxp->debugfs_client->vd); up_write(&gxp->vd_semaphore); if (ret) { |