summaryrefslogtreecommitdiff
path: root/gxp-firmware.c
diff options
context:
space:
mode:
authorIlamparithi Mahendran <ilamparithim@google.com>2022-04-04 07:04:43 +0000
committerIlamparithi Mahendran <ilamparithim@google.com>2022-04-04 07:19:27 +0000
commit14814a3c18c7057fe4bea3f0f41bcd7b4af5bda4 (patch)
treeb5612c1a101ea547f2e8c6cf48062672c97450ec /gxp-firmware.c
parenta739c7f7e74e637cf882fa9ee73dee0aeb4374ee (diff)
downloadgs201-14814a3c18c7057fe4bea3f0f41bcd7b4af5bda4.tar.gz
Merge branch 'gs201-release' to android13-gs-pixel-5.10
* gs201-release: gxp: remove redundant aurora_base global var Bug: 176984045 gxp: remove obsolete TODO of wakelock Bug: 201600514 gxp: correct frequency values for the memory rail Bug: 227334108 gxp: Enforce required wakelocks on OOD IOCTLs gxp: Cleanup and rearrange the IOCTLs ordering gxp: Split version info into its own IOCTL gxp: Fix a race condition in response processing Bug: 226982987 gxp: Fix non-aggressor flag behavior bugs Bug: 226682644 gxp: Require BLOCK wakelock to read global counter Bug: 225402208 gxp: Clean-up pending commands on mailbox close Bug: 194060459, 184572070 gxp: Add missing break in gxp_ioctl() Bug: 226501806 gxp: fix the READY state support in mailbox ioctl Bug: b/226281679 gxp: set non-aggressor bit with non-aggressor vote Bug: 221320387 gxp: support NON_AGGRESSOR flag in power IOCTLs Bug: 221320387 Signed-off-by: Ilamparithi Mahendran <ilamparithim@google.com> Change-Id: I397bf1e41305d2c3b10ad4073d4ba2d81da99de9
Diffstat (limited to 'gxp-firmware.c')
-rw-r--r--gxp-firmware.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/gxp-firmware.c b/gxp-firmware.c
index a9a7e5a..2af783e 100644
--- a/gxp-firmware.c
+++ b/gxp-firmware.c
@@ -40,7 +40,6 @@
#define FW_IMAGE_TYPE_OFFSET (0x400)
static const struct firmware *fw[GXP_NUM_CORES];
-static void __iomem *aurora_base;
static char *fw_elf[] = {Q7_ELF_FILE0, Q7_ELF_FILE1, Q7_ELF_FILE2,
Q7_ELF_FILE3};
@@ -319,8 +318,8 @@ static int gxp_firmware_handshake(struct gxp_dev *gxp, uint core)
/* Wait for core to come up */
dev_notice(gxp->dev, "Waiting for core %u to power up...\n",
core);
- core_psm_base = ((u8 *)aurora_base) + LPM_BLOCK
- + CORE_PSM_BASE(core);
+ core_psm_base =
+ ((u8 *)gxp->regs.vaddr) + LPM_BLOCK + CORE_PSM_BASE(core);
ctr = 1000;
while (ctr) {
addr = core_psm_base + PSM_STATUS_OFFSET;
@@ -420,8 +419,6 @@ int gxp_fw_init(struct gxp_dev *gxp)
struct resource r;
int ret;
- aurora_base = gxp->regs.vaddr;
-
/* Power on BLK_AUR to read the revision and processor ID registers */
gxp_pm_blk_on(gxp);
@@ -551,6 +548,9 @@ out_firmware_unload:
void gxp_firmware_stop(struct gxp_dev *gxp, uint core)
{
+ struct gxp_async_response *cur, *nxt;
+ unsigned long flags;
+
if (!(gxp->firmware_running & BIT(core)))
dev_err(gxp->dev, "Firmware is not running on core %u\n", core);
@@ -565,6 +565,21 @@ void gxp_firmware_stop(struct gxp_dev *gxp, uint core)
gxp->mailbox_mgr->mailboxes[core]);
dev_notice(gxp->dev, "Mailbox %u released\n", core);
+ /*
+ * TODO(b/226211187) response queues should be owned by VDs
+ * This step should not be necessary until a VD is destroyed once the
+ * queues are owned directly by the VD and not shared by all users of
+ * a physical core.
+ */
+ /* Flush and free any abandoned responses left in the queue */
+ spin_lock_irqsave(&gxp->mailbox_resps_lock, flags);
+ list_for_each_entry_safe(cur, nxt, &gxp->mailbox_resp_queues[core],
+ list_entry) {
+ list_del(&cur->list_entry);
+ kfree(cur);
+ }
+ spin_unlock_irqrestore(&gxp->mailbox_resps_lock, flags);
+
gxp_pm_core_off(gxp, core);
gxp_firmware_unload(gxp, core);
}