qcacld-3.0: Reduce SMMU mapping logs
Reduce the number of logs during the SMMU mapping process in cds_smmu_mem_map_setup by refactoring the logic to reduce the number of branches. Change-Id: I1a8b0ece31ab51eaf6f96232b284b61d77c83084 CRs-Fixed: 2291034
This commit is contained in:
@@ -2735,51 +2735,47 @@ void cds_incr_arp_stats_tx_tgt_acked(void)
|
|||||||
#ifdef ENABLE_SMMU_S1_TRANSLATION
|
#ifdef ENABLE_SMMU_S1_TRANSLATION
|
||||||
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
||||||
{
|
{
|
||||||
int attr = 0;
|
struct dma_iommu_mapping *mapping;
|
||||||
bool ipa_smmu_enable = false;
|
bool ipa_smmu_enabled;
|
||||||
struct dma_iommu_mapping *mapping = pld_smmu_get_mapping(osdev->dev);
|
bool wlan_smmu_enabled;
|
||||||
|
|
||||||
osdev->smmu_s1_enabled = false;
|
mapping = pld_smmu_get_mapping(osdev->dev);
|
||||||
|
if (mapping) {
|
||||||
if (ipa_present) {
|
int attr = 0;
|
||||||
ipa_smmu_enable = qdf_get_ipa_smmu_enabled();
|
int errno = iommu_domain_get_attr(mapping->domain,
|
||||||
if (ipa_smmu_enable)
|
DOMAIN_ATTR_S1_BYPASS, &attr);
|
||||||
cds_info("SMMU enabled from IPA side");
|
|
||||||
else
|
|
||||||
cds_info("SMMU not enabled from IPA side");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mapping && ((iommu_domain_get_attr(mapping->domain,
|
|
||||||
DOMAIN_ATTR_S1_BYPASS, &attr) == 0) &&
|
|
||||||
!attr)) {
|
|
||||||
cds_info("SMMU enabled from WLAN side");
|
|
||||||
|
|
||||||
if (ipa_present) {
|
|
||||||
if (ipa_smmu_enable) {
|
|
||||||
cds_info("SMMU enabled from both IPA and WLAN side");
|
|
||||||
osdev->smmu_s1_enabled = true;
|
|
||||||
} else {
|
|
||||||
cds_err("SMMU mismatch: IPA: disable, WLAN: enable");
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
osdev->smmu_s1_enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
wlan_smmu_enabled = !errno && !attr;
|
||||||
} else {
|
} else {
|
||||||
cds_info("No SMMU mapping present or SMMU disabled from WLAN side");
|
cds_info("No SMMU mapping present");
|
||||||
|
wlan_smmu_enabled = false;
|
||||||
if (ipa_present) {
|
|
||||||
if (ipa_smmu_enable) {
|
|
||||||
cds_err("SMMU mismatch: IPA: enable, WLAN: disable");
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
|
||||||
} else {
|
|
||||||
cds_info("SMMU disabled from both IPA and WLAN side");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!wlan_smmu_enabled) {
|
||||||
|
osdev->smmu_s1_enabled = false;
|
||||||
|
goto exit_with_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ipa_present) {
|
||||||
|
osdev->smmu_s1_enabled = true;
|
||||||
|
goto exit_with_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
ipa_smmu_enabled = qdf_get_ipa_smmu_enabled();
|
||||||
|
|
||||||
|
osdev->smmu_s1_enabled = ipa_smmu_enabled && wlan_smmu_enabled;
|
||||||
|
if (ipa_smmu_enabled != wlan_smmu_enabled) {
|
||||||
|
cds_err("SMMU mismatch; IPA:%s, WLAN:%s",
|
||||||
|
ipa_smmu_enabled ? "enabled" : "disabled",
|
||||||
|
wlan_smmu_enabled ? "enabled" : "disabled");
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_with_success:
|
||||||
osdev->iommu_mapping = mapping;
|
osdev->iommu_mapping = mapping;
|
||||||
|
|
||||||
|
cds_info("SMMU S1 %s", osdev->smmu_s1_enabled ? "enabled" : "disabled");
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user