From afe02efb8fd75c49e73af047649dfe80d22fc2fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= <josef.soentgen@genode-labs.com>
Date: Tue, 22 Mar 2022 17:55:08 +0100
Subject: [PATCH] pc_usb_host: implement 'dma_pool_destroy'

Encountered on the Fuji5 where for reasons currently unknown the
first xHCI HC (0:0d.0) could not be initialize due to incomplete
interupt informations. The other HCs appear to work fine (tested
with a USB low-speed mouse).
---
 repos/pc/src/drivers/usb_host/pc/generated_dummies.c | 8 --------
 repos/pc/src/drivers/usb_host/pc/lx_emul.c           | 6 ++++++
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/repos/pc/src/drivers/usb_host/pc/generated_dummies.c b/repos/pc/src/drivers/usb_host/pc/generated_dummies.c
index 3bd20d3289..7655a71d4a 100644
--- a/repos/pc/src/drivers/usb_host/pc/generated_dummies.c
+++ b/repos/pc/src/drivers/usb_host/pc/generated_dummies.c
@@ -166,14 +166,6 @@ int dma_mmap_attrs(struct device * dev,struct vm_area_struct * vma,void * cpu_ad
 }
 
 
-#include <linux/dmapool.h>
-
-void dma_pool_destroy(struct dma_pool * pool)
-{
-	lx_emul_trace_and_stop(__func__);
-}
-
-
 #include <linux/printk.h>
 
 asmlinkage __visible void dump_stack(void)
diff --git a/repos/pc/src/drivers/usb_host/pc/lx_emul.c b/repos/pc/src/drivers/usb_host/pc/lx_emul.c
index ffe09af8fb..21b9949fb9 100644
--- a/repos/pc/src/drivers/usb_host/pc/lx_emul.c
+++ b/repos/pc/src/drivers/usb_host/pc/lx_emul.c
@@ -84,6 +84,12 @@ struct dma_pool * dma_pool_create(const char * name,
 }
 
 
+void dma_pool_destroy(struct dma_pool * pool)
+{
+	kfree(pool);
+}
+
+
 void dma_pool_free(struct dma_pool * pool,void * vaddr,dma_addr_t dma)
 {
 	lx_emul_mem_free(vaddr);