linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5.4] iwlwifi: mvm: fix build w/o CONFIG_THERMAL
@ 2019-09-18 13:49 Luca Coelho
  2019-09-18 13:50 ` Luca Coelho
  2019-09-19 18:58 ` Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Luca Coelho @ 2019-09-18 13:49 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

Without CONFIG_THERMAL, the driver fails to link as it calls
iwl_mvm_send_temp_report_ths_cmd() unconditionally. Fix this
by making that function available, but do almost nothing but
send the empty firmware command to enable CT-kill reporting.

While at it, also fix that function itself to not error out
when the thermal zone hasn't been initialized, but instead
just send the empty firmware command in this case as well.

Fixes: 242d9c8b9a93 ("iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 32a708301cfc..f0c539b37ea7 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -555,16 +555,19 @@ static int compare_temps(const void *a, const void *b)
 	return ((s16)le16_to_cpu(*(__le16 *)a) -
 		(s16)le16_to_cpu(*(__le16 *)b));
 }
+#endif
 
 int iwl_mvm_send_temp_report_ths_cmd(struct iwl_mvm *mvm)
 {
 	struct temp_report_ths_cmd cmd = {0};
-	int ret, i, j, idx = 0;
+	int ret;
+#ifdef CONFIG_THERMAL
+	int i, j, idx = 0;
 
 	lockdep_assert_held(&mvm->mutex);
 
 	if (!mvm->tz_device.tzone)
-		return -EINVAL;
+		goto send;
 
 	/* The driver holds array of temperature trips that are unsorted
 	 * and uncompressed, the FW should get it compressed and sorted
@@ -597,6 +600,7 @@ int iwl_mvm_send_temp_report_ths_cmd(struct iwl_mvm *mvm)
 	}
 
 send:
+#endif
 	ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP,
 						TEMP_REPORTING_THRESHOLDS_CMD),
 				   0, sizeof(cmd), &cmd);
@@ -607,6 +611,7 @@ int iwl_mvm_send_temp_report_ths_cmd(struct iwl_mvm *mvm)
 	return ret;
 }
 
+#ifdef CONFIG_THERMAL
 static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device,
 				  int *temperature)
 {
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v5.4] iwlwifi: mvm: fix build w/o CONFIG_THERMAL
  2019-09-18 13:49 [PATCH v5.4] iwlwifi: mvm: fix build w/o CONFIG_THERMAL Luca Coelho
@ 2019-09-18 13:50 ` Luca Coelho
  2019-09-19  9:52   ` Kalle Valo
  2019-09-19 18:58 ` Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Luca Coelho @ 2019-09-18 13:50 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, Mao Wenan

On Wed, 2019-09-18 at 16:49 +0300, Luca Coelho wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Without CONFIG_THERMAL, the driver fails to link as it calls
> iwl_mvm_send_temp_report_ths_cmd() unconditionally. Fix this
> by making that function available, but do almost nothing but
> send the empty firmware command to enable CT-kill reporting.
> 
> While at it, also fix that function itself to not error out
> when the thermal zone hasn't been initialized, but instead
> just send the empty firmware command in this case as well.
> 
> Fixes: 242d9c8b9a93 ("iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---

Kalle, please take this patch to fix the THERMAL thing instead.  I'll
assign it to you in patchwork (and mark the other one as superseded).

Thanks!

--
Cheers,
Luca.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v5.4] iwlwifi: mvm: fix build w/o CONFIG_THERMAL
  2019-09-18 13:50 ` Luca Coelho
@ 2019-09-19  9:52   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-09-19  9:52 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless, Mao Wenan

Luca Coelho <luca@coelho.fi> writes:

> On Wed, 2019-09-18 at 16:49 +0300, Luca Coelho wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>> 
>> Without CONFIG_THERMAL, the driver fails to link as it calls
>> iwl_mvm_send_temp_report_ths_cmd() unconditionally. Fix this
>> by making that function available, but do almost nothing but
>> send the empty firmware command to enable CT-kill reporting.
>> 
>> While at it, also fix that function itself to not error out
>> when the thermal zone hasn't been initialized, but instead
>> just send the empty firmware command in this case as well.
>> 
>> Fixes: 242d9c8b9a93 ("iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL")
>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
>> ---
>
> Kalle, please take this patch to fix the THERMAL thing instead.  I'll
> assign it to you in patchwork (and mark the other one as superseded).

Ok, I'll queue this to v5.4.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v5.4] iwlwifi: mvm: fix build w/o CONFIG_THERMAL
  2019-09-18 13:49 [PATCH v5.4] iwlwifi: mvm: fix build w/o CONFIG_THERMAL Luca Coelho
  2019-09-18 13:50 ` Luca Coelho
@ 2019-09-19 18:58 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-09-19 18:58 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless

Luca Coelho <luca@coelho.fi> wrote:

> From: Johannes Berg <johannes.berg@intel.com>
> 
> Without CONFIG_THERMAL, the driver fails to link as it calls
> iwl_mvm_send_temp_report_ths_cmd() unconditionally. Fix this
> by making that function available, but do almost nothing but
> send the empty firmware command to enable CT-kill reporting.
> 
> While at it, also fix that function itself to not error out
> when the thermal zone hasn't been initialized, but instead
> just send the empty firmware command in this case as well.
> 
> Fixes: 242d9c8b9a93 ("iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

Patch applied to wireless-drivers.git, thanks.

2d88b2cf2f00 iwlwifi: mvm: fix build w/o CONFIG_THERMAL

-- 
https://patchwork.kernel.org/patch/11150431/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-19 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-18 13:49 [PATCH v5.4] iwlwifi: mvm: fix build w/o CONFIG_THERMAL Luca Coelho
2019-09-18 13:50 ` Luca Coelho
2019-09-19  9:52   ` Kalle Valo
2019-09-19 18:58 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).