summaryrefslogtreecommitdiff
path: root/gxp-firmware.c
diff options
context:
space:
mode:
authorAurora pro automerger <aurora-pro-automerger@google.com>2022-08-09 03:58:01 +0000
committerJohn Scheible <johnscheible@google.com>2022-08-10 17:39:37 +0000
commit261baf5aa92fe1fb8a0a30d7e971117ed5b36de9 (patch)
treebee6c35ce8f9a700109886588d00a8519d894903 /gxp-firmware.c
parent51345064a78c4fbee30e5c331a41c0dfab852fa0 (diff)
downloadgs201-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-firmware.c')
-rw-r--r--gxp-firmware.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gxp-firmware.c b/gxp-firmware.c
index d9e6cc6..eb31f23 100644
--- a/gxp-firmware.c
+++ b/gxp-firmware.c
@@ -372,7 +372,7 @@ static int gxp_firmware_handshake(struct gxp_dev *gxp, uint core)
}
dev_notice(gxp->dev, "Core %u is alive!\n", core);
-#ifndef CONFIG_GXP_GEM5
+#if !IS_ENABLED(CONFIG_GXP_GEM5)
/*
* FW reads the INT_MASK0 register (written by the driver) to
* validate TOP access. The value read is echoed back by the FW to
@@ -396,7 +396,7 @@ static int gxp_firmware_handshake(struct gxp_dev *gxp, uint core)
return -EIO;
}
dev_notice(gxp->dev, "TOP access from core %u successful!\n", core);
-#endif // !CONFIG_GXP_GEM5
+#endif
/* Stop bus performance monitors */
gxp_bpm_stop(gxp, core);
@@ -709,7 +709,7 @@ static void gxp_firmware_wakeup_cores(struct gxp_dev *gxp, uint core_list)
for (core = 0; core < GXP_NUM_CORES; core++) {
if (!(core_list & BIT(core)))
continue;
-#ifndef CONFIG_GXP_GEM5
+#if !IS_ENABLED(CONFIG_GXP_GEM5)
gxp_doorbell_enable_for_core(gxp, CORE_WAKEUP_DOORBELL(core),
core);
#endif
@@ -721,7 +721,7 @@ static int gxp_firmware_finish_startup(struct gxp_dev *gxp,
struct gxp_virtual_device *vd,
uint virt_core, uint core)
{
- int ret = 0;
+ int ret;
struct work_struct *work;
ret = gxp_firmware_handshake(gxp, core);
@@ -792,12 +792,14 @@ int gxp_firmware_run(struct gxp_dev *gxp, struct gxp_virtual_device *vd,
int ret;
uint core, virt_core;
uint failed_cores = 0;
+ int failed_ret;
for (core = 0; core < GXP_NUM_CORES; core++) {
if (core_list & BIT(core)) {
ret = gxp_firmware_setup(gxp, core);
if (ret) {
failed_cores |= BIT(core);
+ failed_ret = ret;
dev_err(gxp->dev, "Failed to run firmware on core %u\n",
core);
}
@@ -816,9 +818,9 @@ int gxp_firmware_run(struct gxp_dev *gxp, struct gxp_virtual_device *vd,
}
}
}
- goto out;
+ return failed_ret;
}
-#ifdef CONFIG_GXP_GEM5
+#if IS_ENABLED(CONFIG_GXP_GEM5)
/*
* GEM5 starts firmware after LPM is programmed, so we need to call
* gxp_doorbell_enable_for_core here to set GXP_REG_COMMON_INT_MASK_0
@@ -850,18 +852,20 @@ int gxp_firmware_run(struct gxp_dev *gxp, struct gxp_virtual_device *vd,
}
if (failed_cores != 0) {
+ virt_core = 0;
for (core = 0; core < GXP_NUM_CORES; core++) {
if (core_list & BIT(core)) {
if (!(failed_cores & BIT(core))) {
gxp_firmware_stop_core(gxp, vd,
virt_core, core);
}
+ virt_core++;
}
}
}
/* Check if we need to set clock mux to low state as requested */
gxp_pm_resume_clkmux(gxp);
-out:
+
return ret;
}