summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2022-01-23 18:38:54 -0800
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2022-01-23 18:38:54 -0800
commit4214dd23c3df7b020f97f7cc9655c41726080d6b (patch)
tree0d2cefbcfc8a3df3ab7981d96a61aef15e3f2742
parentad7e1c462486ae9e3d1e2d2a7d916bf83051b378 (diff)
parent922dbc46c710a00daeb05bfeae667382de66ff27 (diff)
downloadedgetpu-android-gs-raviole-5.10-s-qpr3-beta-3.tar.gz
SBMerger: 410055097 Change-Id: Id340c0165335247e9565d53e7d54ffe323bc9931 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r--drivers/edgetpu/edgetpu-dmabuf.c2
-rw-r--r--drivers/edgetpu/edgetpu-kci.c19
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/edgetpu/edgetpu-dmabuf.c b/drivers/edgetpu/edgetpu-dmabuf.c
index f98aafe..276da72 100644
--- a/drivers/edgetpu/edgetpu-dmabuf.c
+++ b/drivers/edgetpu/edgetpu-dmabuf.c
@@ -723,7 +723,7 @@ int edgetpu_map_dmabuf(struct edgetpu_device_group *group,
__func__, ret);
goto err_release_map;
}
- arg->device_address = dmap->map.device_address;
+ arg->device_address = tpu_addr;
mutex_unlock(&group->lock);
dma_buf_put(dmabuf);
return 0;
diff --git a/drivers/edgetpu/edgetpu-kci.c b/drivers/edgetpu/edgetpu-kci.c
index bfa356f..9339953 100644
--- a/drivers/edgetpu/edgetpu-kci.c
+++ b/drivers/edgetpu/edgetpu-kci.c
@@ -507,6 +507,8 @@ int edgetpu_kci_init(struct edgetpu_mailbox_manager *mgr,
int edgetpu_kci_reinit(struct edgetpu_kci *kci)
{
struct edgetpu_mailbox *mailbox = kci->mailbox;
+ struct edgetpu_mailbox_manager *mgr;
+ unsigned long flags;
int ret;
if (!mailbox)
@@ -521,6 +523,13 @@ int edgetpu_kci_reinit(struct edgetpu_kci *kci)
QUEUE_SIZE);
if (ret)
return ret;
+
+ mgr = mailbox->etdev->mailbox_manager;
+ /* Restore KCI irq handler */
+ write_lock_irqsave(&mgr->mailboxes_lock, flags);
+ mailbox->handle_irq = edgetpu_kci_handle_irq;
+ write_unlock_irqrestore(&mgr->mailboxes_lock, flags);
+
edgetpu_mailbox_init_doorbells(mailbox);
edgetpu_mailbox_enable(mailbox);
@@ -529,6 +538,16 @@ int edgetpu_kci_reinit(struct edgetpu_kci *kci)
void edgetpu_kci_cancel_work_queues(struct edgetpu_kci *kci)
{
+ struct edgetpu_mailbox_manager *mgr;
+ unsigned long flags;
+
+ if (kci->mailbox) {
+ mgr = kci->mailbox->etdev->mailbox_manager;
+ /* Remove IRQ handler to stop responding to interrupts */
+ write_lock_irqsave(&mgr->mailboxes_lock, flags);
+ kci->mailbox->handle_irq = NULL;
+ write_unlock_irqrestore(&mgr->mailboxes_lock, flags);
+ }
/* Cancel workers that may send KCIs. */
cancel_work_sync(&kci->usage_work);
/* Cancel KCI and reverse KCI workers. */