Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp531824lqr; Wed, 5 Jun 2024 13:03:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUNfkacxst/c8Y8adcVji9n5DuUa88aB0oDt3jjUS0kLeQoqAGTV8YxbSgO1uEmMR7mEI0Iu+KH7VQ9Y7Vp82/ZoVuEYlGLkpwgRChJiQ== X-Google-Smtp-Source: AGHT+IGNsgpUYqO+x0FlpD85gRYV7p8fMeV2xz1yji8V/rIiyXTyBDnUEzWxb7DyRgoolAr3SvPt X-Received: by 2002:a05:6830:4390:b0:6f9:3e44:bbcd with SMTP id 46e09a7af769-6f943458814mr4394201a34.18.1717617823041; Wed, 05 Jun 2024 13:03:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717617823; cv=pass; d=google.com; s=arc-20160816; b=bhhY6dYAx+WIZkkgRjev4W+XBf9hSl9kiuDPIIrJS53+bsEM/OGw/rk40vZOK/3fcN 5xStBMbSiXWGsgEI/j0tNLPQD6aUQan9dAXFUdxJ98LzDPpBg/93rZIcdtg0e8pIPVeS rtnZ8eup5VWxaXA2EDiihPmPbU3u7P7wHW69LuSjhZa1f7i7B3bb9cuiqJe57Ai3HLoK IqFg5zm427yUw2k153oDL8buSSCsbHqhCbTWSi0ukO7aCfLzy2cRPJDQcSvAAESrX0UY qksvpdTo+ze5BNkOa07GAcmu6UTQzT6ylzoI1NPXVmVg53Wg7OTq0CSb4QSo7sMrptBJ 5h2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=wiejtDwNbnyUyDnMvFBVySvH2LKv57cz2j0YEQtBnXA=; fh=w2vznsAqscep4jKgkePennskZyDzvQ3scdK45erdgf4=; b=WguSKHgI74JgFJAsupXd4yxtcvBem3PzBPnVjj/JVsXPW18Ipl8wXdXgZfTppJNMjX EkgAhrzM8Ibx7w++6eISlumNdHAszAET0nNEs9T41q4PYfB4ldoWO7iQ3c0XzJ48UTq0 OQLdUgQYoz8SnwBofFFhMFFGVKdwwHP71fueWsnq96/Wgn4/plGpwLt5orurrTzLWZqB 410jkkWmLT9abKyl/1hTRjb97taa4AeqdLFny4QJgG99X0oxMvoOOuw9x+E1MGeui6xb pfntx1qlBZGXf6VLWKVHEqpdLmjVCEjN4XZHC0XMJmpT+tt8dQUWNe9eb/K7PPncvR1Z 5noQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="DSwK/Wha"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203144-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203144-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48bbce1d59asi2225700137.183.2024.06.05.13.03.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203144-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="DSwK/Wha"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203144-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203144-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 58B381C22DB0 for ; Wed, 5 Jun 2024 20:03:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C30E8158DC1; Wed, 5 Jun 2024 20:02:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DSwK/Wha" Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BCD215534A; Wed, 5 Jun 2024 20:02:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717617767; cv=none; b=ELTLi4c1ufs52Po1P7S3dHujSjPk/bKB3gkvHOCZX3UsEPLPZ4FEPwTOZkUYVWjwb7RnSf//EhQeVjcN9IE4liG+f2uTbGMjD+cicaYo3GEo21Bt+UePcR0/rBpBdUu/0115NHrEu+LgOpa+iwbN2gRsWqzxCRu9jJLHUq0Ru/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717617767; c=relaxed/simple; bh=MQsO5jA5Q4r/5sp8FObB1XchIEXn3DY4dlGB8caBI7A=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=GjDkg/VDHGTvcqjHv1PoNWLavbYqENYw8si8a630N05TUYRPdcQT28jvpfORoH0brkTQAwNp4haI3jUw4LXJBkIcK5LZ69rRPXafWVluSrF0PTwodT+t6ikhkAQxOoY2xU0LWpqafHNYnXcm/kLKbiCOMvuMyEm0n7JfFF127DQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DSwK/Wha; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-79505987854so11065585a.0; Wed, 05 Jun 2024 13:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717617764; x=1718222564; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wiejtDwNbnyUyDnMvFBVySvH2LKv57cz2j0YEQtBnXA=; b=DSwK/WhaSXnmDL61Ry71XwOnVqshuom2vVq5kCLdgzUxmYWXxhvrka+mJP2Y946Pdo cMa8vUqURMwnq8vubci5AgMbJJIZwmIQg1dk8bjyXKgQ02+MGpO2qAWKDNbcHDONONGk vZin6QihuKbgISy4rCl4oIqrnYgUklR54GX5u74AkSEjgCyCvB5lRYjQObD9QkbGNAOs OAGZdpcDfq8zU4sjJepRywvNDYVNicsvhGTB5OQjjrB0XqgxcntfgZFv+EK95LzqLKzM rR6dm77oqauynHbS+AI9jdMIZ3jX5mnlgxj8M2K2n13tP1sB0NWEc0UatX2EEEJzMbkB vRRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717617764; x=1718222564; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wiejtDwNbnyUyDnMvFBVySvH2LKv57cz2j0YEQtBnXA=; b=U3X+Fg6pBzw/H3FayiBX4KtXxy3L/LcCXuTWgtTlGjkNlxXHmNYzEHjJubwPigyOjE xoydL6+/XZ6SxrywanygFt65tJ6f6WQxn7Yvyd7Z97MvJFY5xRSCBEVQ6Vgq45Np6rRi z0pgUWDasRr6B/oZfjCuw3Nn9KMmQ0LZAfvIOqlf9mH7fLUNlvPJUAy9As+rfIILkTfG sIgVqZqB7/JNyGKeDzdhteUdhGSZm/fIwmozeFPkYpIbVv2QeuEYL0kiUeBU37IPrqhr qXr2EZz0nabWp/DAaX6hVCvF1VDwiQ3F+36Y1CaSsWYq4P+7dwu4gfsOMCGMx8ZA76gK 3dXg== X-Forwarded-Encrypted: i=1; AJvYcCUW2sAtDyFa24/OEEysU4WnlqO5P4NTljqwlstRwCytbOrAWznuptN5yKMSC/Jr7gDCZ1bakLy4auXTptp7/Si5iSRm1tfl3S0akkePuOu99b/na9PTac5+afjnz/Yr5JAVeB67PwSJQsiME00= X-Gm-Message-State: AOJu0Yx1HvsLbKrj5YsGvYMJkJ5o3+gSl69YdOOE7SxZuiGZJjdC/aIg uHa9abV9El6YWWplZn2t11JL48OVQxnGEiyt7zf6xDo+d4DNVtuGlsViOD7XVhseR5JPT32RwqE sLYJfAmH38CDyN2B7qBg51pCe4B0= X-Received: by 2002:a05:620a:3192:b0:795:2302:249 with SMTP id af79cd13be357-79523fb8cb7mr450423085a.60.1717617764335; Wed, 05 Jun 2024 13:02:44 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240605195129.89353-1-trintaeoitogc@gmail.com> <621eb61c-87e1-417f-ad9f-f14d858ec8aa@intel.com> In-Reply-To: <621eb61c-87e1-417f-ad9f-f14d858ec8aa@intel.com> From: =?UTF-8?Q?Guilherme_Gi=C3=A1como_Sim=C3=B5es?= Date: Wed, 5 Jun 2024 17:02:08 -0300 Message-ID: Subject: Re: [PATCH v3] iwlwifi: mvm: adding check if the thermal firmware is running To: "Wysocki, Rafael J" Cc: miriam.rachel.korenblit@intel.com, kvalo@kernel.org, daniel.lezcano@linaro.org, johannes.berg@intel.com, dmantipov@yandex.ru, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Wysocki, Rafael J write: > > On 6/5/2024 9:51 PM, 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 , > > Kalle Valo and Johannes Berg > > for your suggestions in my previous patch. > > > > Signed-off-by: Guilherme Giacomo Simoes > > --- > > 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..9aa9e3be39b8 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) { > > + int res = iwl_mvm_firmware_running(mvm); > > Why do you need the res variable at all? You can just call the function > directly in the if () statement. > > > > + > > + if (!res) { > > + ret = -EAGAIN; > > + goto out; > > + } > > + > > + if (mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) { > > ret = -ENODATA; > > goto out; > > } Yes, this makes sense, I only declare the "res" variable because seeing some files in the linux kernel, I see this standard practice. But I really don't need this variable. I will send a new patch v4 without this variable. Thank you for your suggestion on my code.