qcacmn: disable EXT grp irqs and drain TXRX during suspend

Any update to the SRNG TP/HP when the device is in low power
state would result in system errors. It is recommended to disable
EXT grp irqs and drain TXRX before sending power save enter command
to the FW. This will ensure that no interrupts are received while
in power save mode and as a result there wont be any HP/TP updates.

Change-Id: Ibf952bbc2c6d13fb3e4ca6b4845bc9cc887fa694
CRs-Fixed: 2883135
このコミットが含まれているのは:
Manikanta Pubbisetty
2021-03-01 13:09:21 +05:30
committed by AnjaneeDevi Kapparapu
コミット 14d38b77fb
11個のファイルの変更217行の追加5行の削除

ファイルの表示

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -413,3 +413,23 @@ bool hif_dummy_log_bus_info(struct hif_softc *scn, uint8_t *data,
{
return false;
}
/**
* hif_dummy_enable_grp_irqs - dummy call
* @scn: hif context
* Return: EOPNOTSUPP
*/
int hif_dummy_enable_grp_irqs(struct hif_softc *scn)
{
return -EOPNOTSUPP;
}
/**
* hif_dummy_disable_grp_irqs - dummy call
* @scn: hif context
* Return: EOPNOTSUPP
*/
int hif_dummy_disable_grp_irqs(struct hif_softc *scn)
{
return -EOPNOTSUPP;
}

ファイルの表示

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -90,3 +90,5 @@ void hif_dummy_config_irq_affinity(struct hif_softc *scn);
int hif_dummy_config_irq_by_ceid(struct hif_softc *scn, int ce_id);
bool hif_dummy_log_bus_info(struct hif_softc *scn, uint8_t *data,
unsigned int *offset);
int hif_dummy_enable_grp_irqs(struct hif_softc *scn);
int hif_dummy_disable_grp_irqs(struct hif_softc *scn);

ファイルの表示

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -240,4 +240,23 @@ bool hif_ipci_needs_bmi(struct hif_softc *scn);
*/
const char *hif_ipci_get_irq_name(int irq_no);
/**
* hif_ipci_enable_grp_irqs(): enable grp IRQs
* @scn: struct hif_softc
*
* This function enables grp irqs
*
* Return: 0 if success, error code if failure
*/
int hif_ipci_enable_grp_irqs(struct hif_softc *scn);
/**
* hif_ipci_disable_grp_irqs(): disable grp IRQs
* @scn: struct hif_softc
*
* This function disables grp irqs
*
* Return: 0 if success, error code if failure
*/
int hif_ipci_disable_grp_irqs(struct hif_softc *scn);
#endif /* _IPCI_API_H_ */

ファイルの表示

@@ -61,6 +61,8 @@ static void hif_initialize_default_ops(struct hif_softc *hif_sc)
bus_ops->hif_config_irq_affinity =
&hif_dummy_config_irq_affinity;
bus_ops->hif_config_irq_by_ceid = &hif_dummy_config_irq_by_ceid;
bus_ops->hif_enable_grp_irqs = &hif_dummy_enable_grp_irqs;
bus_ops->hif_disable_grp_irqs = &hif_dummy_enable_grp_irqs;
}
#define NUM_OPS (sizeof(struct hif_bus_ops) / sizeof(void *))
@@ -625,3 +627,61 @@ bool hif_log_bus_info(struct hif_softc *hif_sc, uint8_t *data,
return false;
}
#endif
int hif_apps_grp_irqs_enable(struct hif_opaque_softc *hif_ctx)
{
struct hif_exec_context *hif_exec;
struct hif_softc *scn;
int i;
QDF_BUG(hif_ctx);
scn = HIF_GET_SOFTC(hif_ctx);
if (!scn)
return -EINVAL;
for (i = 0 ; i < HIF_MAX_GROUP; i++) {
hif_exec = hif_exec_get_ctx(hif_ctx, i);
if (!hif_exec)
continue;
hif_exec->irq_enable(hif_exec);
}
return 0;
}
int hif_apps_grp_irqs_disable(struct hif_opaque_softc *hif_ctx)
{
struct hif_exec_context *hif_exec;
struct hif_softc *scn;
int i;
QDF_BUG(hif_ctx);
scn = HIF_GET_SOFTC(hif_ctx);
if (!scn)
return -EINVAL;
for (i = 0 ; i < HIF_MAX_GROUP; i++) {
hif_exec = hif_exec_get_ctx(hif_ctx, i);
if (!hif_exec)
continue;
hif_exec->irq_disable(hif_exec);
}
return 0;
}
int hif_disable_grp_irqs(struct hif_opaque_softc *scn)
{
struct hif_softc *hif_sc = HIF_GET_SOFTC(scn);
return hif_sc->bus_ops.hif_disable_grp_irqs(hif_sc);
}
int hif_enable_grp_irqs(struct hif_opaque_softc *scn)
{
struct hif_softc *hif_sc = HIF_GET_SOFTC(scn);
return hif_sc->bus_ops.hif_enable_grp_irqs(hif_sc);
}

ファイルの表示

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018, 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2018, 2020-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -94,6 +94,8 @@ struct hif_bus_ops {
int (*hif_config_irq_by_ceid)(struct hif_softc *hif_sc, int ce_id);
bool (*hif_log_bus_info)(struct hif_softc *scn, uint8_t *data,
unsigned int *offset);
int (*hif_enable_grp_irqs)(struct hif_softc *scn);
int (*hif_disable_grp_irqs)(struct hif_softc *scn);
};
#ifdef HIF_SNOC

ファイルの表示

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -81,6 +81,8 @@ QDF_STATUS hif_initialize_ipci_ops(struct hif_softc *hif_sc)
&hif_dummy_config_irq_affinity;
bus_ops->hif_config_irq_by_ceid = &hif_dummy_config_irq_by_ceid;
bus_ops->hif_log_bus_info = &hif_dummy_log_bus_info;
bus_ops->hif_enable_grp_irqs = hif_ipci_enable_grp_irqs;
bus_ops->hif_disable_grp_irqs = hif_ipci_disable_grp_irqs;
return QDF_STATUS_SUCCESS;
}

ファイルの表示

@@ -826,3 +826,13 @@ void hif_allow_link_low_power_states(struct hif_opaque_softc *hif)
{
}
#endif
int hif_ipci_enable_grp_irqs(struct hif_softc *scn)
{
return hif_apps_grp_irqs_enable(GET_HIF_OPAQUE_HDL(scn));
}
int hif_ipci_disable_grp_irqs(struct hif_softc *scn)
{
return hif_apps_grp_irqs_disable(GET_HIF_OPAQUE_HDL(scn));
}