[Skiboot] [PATCH RFC 1/2] FSP: Introduce refcount variable in fsp_msg structure

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Thu Mar 12 22:25:35 AEDT 2015


Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/fsp/fsp.c  |    2 ++
 include/fsp.h |    3 +++
 2 files changed, 5 insertions(+)

diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index 2be79c7..215fd30 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -246,6 +246,8 @@ struct fsp_msg *fsp_allocmsg(bool alloc_response)
 
 void __fsp_freemsg(struct fsp_msg *msg)
 {
+	if (msg->refcount)
+		return;
 	free(msg);
 }
 
diff --git a/include/fsp.h b/include/fsp.h
index b796bfb..11469b3 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -598,6 +598,9 @@ struct fsp_msg {
 	/* Response will be filed by driver when response received */
 	struct fsp_msg		*resp;
 
+	/* Holds number of pending references */
+	int			refcount;
+
 	/* Internal queuing */
 	struct list_node	link;
 };



More information about the Skiboot mailing list