Explorar el Código

qcacld-3.0: Add code to handle hang event data via ICNSS_UEVENT_HANG_DATA

Add code to handle hang event data via ICNSS_UEVENT_HANG_DATA
uevent.

Change-Id: Ic423b47177922bbb6634d2ad143f93cd1961dda7
CRs-Fixed: 2665604
Mohammed Siddiq hace 5 años
padre
commit
0865e3866f
Se han modificado 2 ficheros con 19 adiciones y 9 borrados
  1. 4 1
      core/pld/inc/pld_common.h
  2. 15 8
      core/pld/src/pld_snoc.c

+ 4 - 1
core/pld/inc/pld_common.h

@@ -144,6 +144,7 @@ enum pld_uevent {
 	PLD_FW_DOWN,
 	PLD_FW_CRASHED,
 	PLD_FW_RECOVERY_START,
+	PLD_FW_HANG_EVENT,
 };
 
 /**
@@ -156,9 +157,11 @@ struct pld_uevent_data {
 	union {
 		struct {
 			bool crashed;
+		} fw_down;
+		struct {
 			void *hang_event_data;
 			u16 hang_event_data_len;
-		} fw_down;
+		} hang_data;
 	};
 };
 

+ 15 - 8
core/pld/src/pld_snoc.c

@@ -241,18 +241,18 @@ static int pld_snoc_resume_noirq(struct device *dev)
 }
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
-static int pld_update_hang_evt_data(struct icnss_uevent_fw_down_data *evt_data,
+static int pld_update_hang_evt_data(struct icnss_uevent_hang_data *evt_data,
 				    struct pld_uevent_data *data)
 {
 	if (!evt_data || !data)
 		return -EINVAL;
 
-	data->fw_down.hang_event_data = evt_data->hang_event_data;
-	data->fw_down.hang_event_data_len = evt_data->hang_event_data_len;
+	data->hang_data.hang_event_data = evt_data->hang_event_data;
+	data->hang_data.hang_event_data_len = evt_data->hang_event_data_len;
 	return 0;
 }
 #else
-static int pld_update_hang_evt_data(struct icnss_uevent_fw_down_data *evt_data,
+static int pld_update_hang_evt_data(struct icnss_uevent_hang_data *evt_data,
 				    struct pld_uevent_data *data)
 {
 	return 0;
@@ -263,7 +263,8 @@ static int pld_snoc_uevent(struct device *dev,
 			   struct icnss_uevent_data *uevent)
 {
 	struct pld_context *pld_context;
-	struct icnss_uevent_fw_down_data *uevent_data = NULL;
+	struct icnss_uevent_fw_down_data *fw_down_data = NULL;
+	struct icnss_uevent_hang_data *hang_data = NULL;
 	struct pld_uevent_data data = {0};
 
 	pld_context = pld_get_global_context();
@@ -283,10 +284,16 @@ static int pld_snoc_uevent(struct device *dev,
 	case ICNSS_UEVENT_FW_DOWN:
 		if (!uevent->data)
 			return -EINVAL;
-		uevent_data = (struct icnss_uevent_fw_down_data *)uevent->data;
+		fw_down_data = (struct icnss_uevent_fw_down_data *)uevent->data;
 		data.uevent = PLD_FW_DOWN;
-		data.fw_down.crashed = uevent_data->crashed;
-		pld_update_hang_evt_data(uevent_data, &data);
+		data.fw_down.crashed = fw_down_data->crashed;
+		break;
+	case ICNSS_UEVENT_HANG_DATA:
+		if (!uevent->data)
+			return -EINVAL;
+		hang_data = (struct icnss_uevent_hang_data *)uevent->data;
+		data.uevent = PLD_FW_HANG_EVENT;
+		pld_update_hang_evt_data(hang_data, &data);
 		break;
 	default:
 		goto out;