Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5038639 authored by Kai Liu's avatar Kai Liu Committed by snandini
Browse files

qcacmn: Enhance hang info feature

Add bus related info in hif layer in order to get bus status
when hang issue happened.

Change-Id: If922e0892e0f65de778b9696bbc56fc63c25c169
CRs-Fixed: 2801350
parent 66e8913b
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -1470,4 +1470,23 @@ void hif_log_ce_info(struct hif_softc *scn, uint8_t *data,
{
}
#endif

#ifdef HIF_BUS_LOG_INFO
/**
 * hif_log_bus_info() - API to log bus related info
 * @scn: hif handle
 * @data: hang event data buffer
 * @offset: offset at which data needs to be written
 *
 * Return:  None
 */
void hif_log_bus_info(struct hif_softc *scn, uint8_t *data,
		      unsigned int *offset);
#else
static inline
void hif_log_bus_info(struct hif_softc *scn, uint8_t *data,
		      unsigned int *offset)
{
}
#endif
#endif /* _HIF_H_ */
+3 −0
Original line number Diff line number Diff line
@@ -4245,6 +4245,9 @@ void hif_log_ce_info(struct hif_softc *scn, uint8_t *data,
	size = sizeof(info) -
		(CE_COUNT_MAX - info.ce_count) * sizeof(struct ce_index);

	if (*offset + size > QDF_WLAN_HANG_FW_OFFSET)
		return;

	QDF_HANG_EVT_SET_HDR(&info.tlv_header, HANG_EVT_TAG_CE_INFO,
			     size - QDF_HANG_EVENT_TLV_HDR_SIZE);

+3 −1
Original line number Diff line number Diff line
@@ -529,7 +529,7 @@ static void hif_cpuhp_unregister(struct hif_softc *scn)
}
#endif /* ifdef HIF_CPU_PERF_AFFINE_MASK */

#ifdef HIF_CE_LOG_INFO
#if defined(HIF_CE_LOG_INFO) || defined(HIF_BUS_LOG_INFO)
/**
 * hif_recovery_notifier_cb - Recovery notifier callback to log
 *  hang event data
@@ -556,6 +556,8 @@ int hif_recovery_notifier_cb(struct notifier_block *block, unsigned long state,
	if (!hif_handle)
		return -EINVAL;

	hif_log_bus_info(hif_handle, notif_data->hang_data,
			 &notif_data->offset);
	hif_log_ce_info(hif_handle, notif_data->hang_data,
			&notif_data->offset);

+28 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@

#include "pci_api.h"
#include "ahb_api.h"
#include "qdf_hang_event_notifier.h"

/* Maximum ms timeout for host to wake up target */
#define PCIE_WAKE_TIMEOUT 1000
@@ -2698,6 +2699,33 @@ static int __hif_check_link_status(struct hif_softc *scn)
	return -EACCES;
}

#ifdef HIF_BUS_LOG_INFO
void hif_log_bus_info(struct hif_softc *scn, uint8_t *data,
		      unsigned int *offset)
{
	struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
	struct hang_event_bus_info info = {0};
	size_t size;

	if (!sc) {
		hif_err("HIF Bus Context is Invalid");
		return;
	}

	pfrm_read_config_word(sc->pdev, PCI_DEVICE_ID, &info.dev_id);

	size = sizeof(info);
	QDF_HANG_EVT_SET_HDR(&info.tlv_header, HANG_EVT_TAG_BUS_INFO,
			     size - QDF_HANG_EVENT_TLV_HDR_SIZE);

	if (*offset + size > QDF_WLAN_HANG_FW_OFFSET)
		return;

	qdf_mem_copy(data + *offset, &info, size);
	*offset = *offset + size;
}
#endif

/**
 * hif_pci_bus_resume(): prepare hif for resume
 *
+5 −0
Original line number Diff line number Diff line
@@ -56,6 +56,11 @@ struct hif_tasklet_entry {
	void *hif_handler; /* struct hif_pci_softc */
};

struct hang_event_bus_info {
	uint16_t tlv_header;
	uint16_t dev_id;
} qdf_packed;

/**
 * enum hif_pm_runtime_state - Driver States for Runtime Power Management
 * HIF_PM_RUNTIME_STATE_NONE: runtime pm is off
Loading