From: Jonathan Bither <jonbither@gmail.com>
To: "Guilherme Giácomo Simões" <trintaeoitogc@gmail.com>
Cc: miriam.rachel.korenblit@intel.com, kvalo@kernel.org,
rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org,
johannes.berg@intel.com, dmantipov@yandex.ru,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: adding check if the thermal firmware is running
Date: Fri, 17 May 2024 13:43:09 -0400 [thread overview]
Message-ID: <aa9abbd9-32c7-1f4d-34e8-a07956e775a5@gmail.com> (raw)
In-Reply-To: <CAM_Rzfb8f4ki4UB2+9EtnpJL8oMY6x0q=HmDm92mdbhLQafFOQ@mail.gmail.com>
On 5/17/24 13:25, Guilherme Giácomo Simões wrote:
> Em sex., 17 de mai. de 2024 às 13:57, Jonathan Bither
> <jonbither@gmail.com> escreveu:
>>
>> On 5/17/24 10:16, Guilherme Giacomo Simoes wrote:
>>> 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 <refael.j.wysocki@intel.com> 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(-)
>>>
>>> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
>>> index 8083c4b2ab6b..68ab9966330c 100644
>>> --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
>>> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
>>> @@ -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;
>>> + }
>>> +
>> 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;
>> }
>>
>>> + 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/20240517171311.3705-1-trintaeoitogc@gmail.com/
>
> If you want, you can send this suggestion in this patch v2.
Hey Guilherme, no worries.
>
> Thanks.
next prev parent reply other threads:[~2024-05-17 17:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 14:16 Guilherme Giacomo Simoes
2024-05-17 14:53 ` Kalle Valo
2024-05-17 16:35 ` Guilherme Giácomo Simões
2024-05-17 16:37 ` Guilherme Giácomo Simões
2024-05-17 16:57 ` Jonathan Bither
2024-05-17 17:25 ` Guilherme Giácomo Simões
2024-05-17 17:43 ` Jonathan Bither [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-05-16 20:05 [PATCH] [thermal] " Guilherme Giacomo Simoes
2024-05-17 10:20 ` Wysocki, Rafael J
2024-05-17 14:17 ` Guilherme Giácomo Simões
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa9abbd9-32c7-1f4d-34e8-a07956e775a5@gmail.com \
--to=jonbither@gmail.com \
--cc=daniel.lezcano@linaro.org \
--cc=dmantipov@yandex.ru \
--cc=johannes.berg@intel.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=trintaeoitogc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®