thermal: adding check if the thermal firmware is running
PATCH 1/1 thermal: adding check if the thermal firmware is running
In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone.
After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet.
For more legibiliti i change the tt.c for return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more.
I would like to thanks for Rafael Wysocki <[email protected]> for your suggestions in mu first patch that results in this another patch.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +8 -2
@@ -620,8 +620,14 @@ static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device,mutex_lock (&mvm->mutex); -if (!iwl_mvm_firmware_running (mvm) || - mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { +const int res =iwl_mvm_firmware_running (mvm); + +if (!res) { + ret = -EAGAIN ; + goto out; + } + +if (mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { ret = -ENODATA ; goto out; }
Signature · 1 line
2.45.1
Quoted 12 lines · Guilherme Giacomo Simoes
In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone.
After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet.
For more legibiliti i change the
tt.cfor return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more.
Quoted 5 lines
I would like to thanks for Rafael Wysocki <[email protected]> for your suggestions in mu first patch that results in this another patch.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
Please read the wiki link below how to submit wireless patches. For example, the title is wrong and you haven't signed the patch.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 12 lines · Kalle Valo
Quoted 12 lines
In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone.
After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet.
For more legibiliti i change the
tt.cfor return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more.
Quoted 8 lines
Quoted 5 lines
I would like to thanks for Rafael Wysocki <[email protected]> for your suggestions in mu first patch that results in this another patch.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)Please read the wiki link below how to submit wireless patches. For example, the title is wrong and you haven't signed the patch.
Okay, thank you for your explanation Mr. Valo
I will fix the patch and resend this.
Em sex., 17 de mai. de 2024 às 11:53, Kalle Valo <[email protected]> escreveu:
Quoted 28 lines
Quoted 12 lines · Guilherme Giacomo Simoes
In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone.
After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet.
For more legibiliti i change the
tt.cfor return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more.Quoted 5 lines
I would like to thanks for Rafael Wysocki <[email protected]> for your suggestions in mu first patch that results in this another patch.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)Please read the wiki link below how to submit wireless patches. For example, the title is wrong and you haven't signed the patch.
--
https://patchwork.kernel.org/project/linux-wireless/list/https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 21 lines · Kalle Valo
Quoted 12 lines · Guilherme Giacomo Simoes
In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone.
After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet.
For more legibiliti i change the
tt.cfor return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more.Quoted 5 lines
I would like to thanks for Rafael Wysocki <[email protected]> for your suggestions in mu first patch that results in this another patch.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 7 lines
Please read the wiki link below how to submit wireless patches. For example, the title is wrong and you haven't signed the patch.
--
https://patchwork.kernel.org/project/linux-wireless/list/https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Thank you for your explanation Mr. Valo.
I will fix the patch and resend.
Quoted 25 lines · Guilherme Giacomo Simoes
In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone.
After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet.
For more legibiliti i change the
tt.cfor return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more.I would like to thanks for Rafael Wysocki <[email protected]> for your suggestions in mu first patch that results in this another patch.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/net/wireless/intel/iwlwifi/mvm/tt.c +0
-0@@ -620,8 +620,14 @@ static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device,mutex_lock (&mvm->mutex);
drivers/net/wireless/intel/iwlwifi/mvm/tt.c static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device, · line 629
Quoted 10 lines
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +7
-2-if (!iwl_mvm_firmware_running (mvm) || - mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { +const int res =iwl_mvm_firmware_running (mvm); + +if (!res) { + ret = -EAGAIN ; + goto out; + } +
You could skip using the res variable and move the mutex lock here and simplify the above a bit. Ex:
int temp;
- mutex_lock(&mvm->mutex);
+ if (!iwl_mvm_firmware_running(mvm))
+ return -EAGAIN;
- if (!iwl_mvm_firmware_running(mvm) ||
- mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) { + mutex_lock(&mvm->mutex);
+ if (mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) { ret = -ENODATA;
goto out;
}
Quoted 4 lines
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +1
-0+if (mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { ret = -ENODATA ; goto out; }
Em sex., 17 de mai. de 2024 às 13:57, Jonathan Bither <[email protected]> escreveu:
Quoted 56 lines · Guilherme Giacomo Simoes
Quoted 25 lines
In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone.
After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet.
For more legibiliti i change the
tt.cfor return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more.I would like to thanks for Rafael Wysocki <[email protected]> for your suggestions in mu first patch that results in this another patch.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/net/wireless/intel/iwlwifi/mvm/tt.c +0
-0@@ -620,8 +620,14 @@ static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device,mutex_lock (&mvm->mutex);drivers/net/wireless/intel/iwlwifi/mvm/tt.c static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device, · line 629
Quoted 10 lines
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +7
-2-if (!iwl_mvm_firmware_running (mvm) || - mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { +const int res =iwl_mvm_firmware_running (mvm); + +if (!res) { + ret = -EAGAIN ; + goto out; + } +You could skip using the res variable and move the mutex lock here and simplify the above a bit. Ex:
int temp;drivers/net/wireless/intel/iwlwifi/mvm/tt.c +4
-3-mutex_lock (&mvm->mutex); +if (!iwl_mvm_firmware_running (mvm)) +return -EAGAIN ; -if (!iwl_mvm_firmware_running (mvm) || - mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { +mutex_lock (&mvm->mutex); +if (mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { ret = -ENODATA ; goto out; }
Quoted 4 lines
drivers/net/wireless/intel/iwlwifi/mvm/tt.c static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device, · line 633
Quoted 4 lines
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +1
-0+if (mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { ret = -ENODATA ; goto out; }
Hey Jonathan, Thank you for your suggestion.
I sended a v2 patch of this patch
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
If you want, you can send this suggestion in this patch v2.
Thanks.
Quoted 60 lines · Guilherme Giácomo Simões
Em sex., 17 de mai. de 2024 às 13:57, Jonathan Bither <[email protected]> escreveu:
Quoted 54 lines · Guilherme Giacomo Simoes
Quoted 25 lines
In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone.
After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet.
For more legibiliti i change the
tt.cfor return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more.I would like to thanks for Rafael Wysocki <[email protected]> for your suggestions in mu first patch that results in this another patch.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/net/wireless/intel/iwlwifi/mvm/tt.c +0
-0@@ -620,8 +620,14 @@ static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device,mutex_lock (&mvm->mutex);drivers/net/wireless/intel/iwlwifi/mvm/tt.c static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device, · line 629
Quoted 10 lines
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +7
-2-if (!iwl_mvm_firmware_running (mvm) || - mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { +const int res =iwl_mvm_firmware_running (mvm); + +if (!res) { + ret = -EAGAIN ; + goto out; + } +You could skip using the res variable and move the mutex lock here and simplify the above a bit. Ex:
int temp;drivers/net/wireless/intel/iwlwifi/mvm/tt.c +4
-3-mutex_lock (&mvm->mutex); +if (!iwl_mvm_firmware_running (mvm)) +return -EAGAIN ; -if (!iwl_mvm_firmware_running (mvm) || - mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { +mutex_lock (&mvm->mutex); +if (mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { ret = -ENODATA ; goto out; }Quoted 4 lines
drivers/net/wireless/intel/iwlwifi/mvm/tt.c static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device, · line 633
Quoted 4 lines
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +1
-0+if (mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) { ret = -ENODATA ; goto out; }
Quoted 5 lines
Hey Jonathan, Thank you for your suggestion.
I sended a v2 patch of this patch
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/If you want, you can send this suggestion in this patch v2.
Hey Guilherme, no worries.
Quoted 2 lines
Thanks.