Skip to content

Commit 26ecd37

Browse files
committed
Merge branch '5.5/fixes' into 5.5/master
* 5.5/fixes: iwlwifi: don't send GEO_TX_POWER_LIMIT if no wgds table
2 parents ffbdc20 + d69e75f commit 26ecd37

3 files changed

Lines changed: 24 additions & 13 deletions

File tree

drivers/net/wireless/intel/iwlwifi/fw/acpi.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* GPL LICENSE SUMMARY
77
*
88
* Copyright(c) 2017 Intel Deutschland GmbH
9-
* Copyright (C) 2019 Intel Corporation
9+
* Copyright (C) 2019 - 2020 Intel Corporation
1010
*
1111
* This program is free software; you can redistribute it and/or modify
1212
* it under the terms of version 2 of the GNU General Public License as
@@ -27,7 +27,7 @@
2727
* BSD LICENSE
2828
*
2929
* Copyright(c) 2017 Intel Deutschland GmbH
30-
* Copyright (C) 2019 Intel Corporation
30+
* Copyright (C) 2019 - 2020 Intel Corporation
3131
* All rights reserved.
3232
*
3333
* Redistribution and use in source and binary forms, with or without
@@ -491,21 +491,21 @@ int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt,
491491
}
492492
IWL_EXPORT_SYMBOL(iwl_validate_sar_geo_profile);
493493

494-
void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
495-
struct iwl_per_chain_offset_group *table)
494+
int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
495+
struct iwl_per_chain_offset_group *table)
496496
{
497497
int ret, i, j;
498498

499499
if (!iwl_sar_geo_support(fwrt))
500-
return;
500+
return -EOPNOTSUPP;
501501

502502
ret = iwl_sar_get_wgds_table(fwrt);
503503
if (ret < 0) {
504504
IWL_DEBUG_RADIO(fwrt,
505505
"Geo SAR BIOS table invalid or unavailable. (%d)\n",
506506
ret);
507507
/* we don't fail if the table is not available */
508-
return;
508+
return -ENOENT;
509509
}
510510

511511
BUILD_BUG_ON(ACPI_NUM_GEO_PROFILES * ACPI_WGDS_NUM_BANDS *
@@ -530,5 +530,7 @@ void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
530530
i, j, value[1], value[2], value[0]);
531531
}
532532
}
533+
534+
return 0;
533535
}
534536
IWL_EXPORT_SYMBOL(iwl_sar_geo_init);

drivers/net/wireless/intel/iwlwifi/fw/acpi.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* GPL LICENSE SUMMARY
77
*
88
* Copyright(c) 2017 Intel Deutschland GmbH
9-
* Copyright(c) 2018 - 2019 Intel Corporation
9+
* Copyright(c) 2018 - 2020 Intel Corporation
1010
*
1111
* This program is free software; you can redistribute it and/or modify
1212
* it under the terms of version 2 of the GNU General Public License as
@@ -27,7 +27,7 @@
2727
* BSD LICENSE
2828
*
2929
* Copyright(c) 2017 Intel Deutschland GmbH
30-
* Copyright(c) 2018 - 2019 Intel Corporation
30+
* Copyright(c) 2018 - 2020 Intel Corporation
3131
* All rights reserved.
3232
*
3333
* Redistribution and use in source and binary forms, with or without
@@ -171,8 +171,9 @@ bool iwl_sar_geo_support(struct iwl_fw_runtime *fwrt);
171171
int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt,
172172
struct iwl_host_cmd *cmd);
173173

174-
void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
175-
struct iwl_per_chain_offset_group *table);
174+
int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
175+
struct iwl_per_chain_offset_group *table);
176+
176177
#else /* CONFIG_ACPI */
177178

178179
static inline void *iwl_acpi_get_object(struct device *dev, acpi_string method)
@@ -243,9 +244,10 @@ static inline int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt,
243244
return -ENOENT;
244245
}
245246

246-
static inline void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
247-
struct iwl_per_chain_offset_group *table)
247+
static inline int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
248+
struct iwl_per_chain_offset_group *table)
248249
{
250+
return -ENOENT;
249251
}
250252

251253
#endif /* CONFIG_ACPI */

drivers/net/wireless/intel/iwlwifi/mvm/fw.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,17 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
749749
u16 cmd_wide_id = WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT);
750750
union geo_tx_power_profiles_cmd cmd;
751751
u16 len;
752+
int ret;
752753

753754
cmd.geo_cmd.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES);
754755

755-
iwl_sar_geo_init(&mvm->fwrt, cmd.geo_cmd.table);
756+
ret = iwl_sar_geo_init(&mvm->fwrt, cmd.geo_cmd.table);
757+
/*
758+
* It is a valid scenario to not support SAR, or miss wgds table,
759+
* but in that case there is no need to send the command.
760+
*/
761+
if (ret)
762+
return 0;
756763

757764
cmd.geo_cmd.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
758765

0 commit comments

Comments
 (0)