Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1604219rwa; Sun, 21 Aug 2022 12:13:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR5GfHi3T0c/SBIZwsW2CYfgkFEvJWbfgn0I1dgaLn+XecarvnEOdB4F7E2Mx92cI6BxBcjh X-Received: by 2002:a17:90b:4b8b:b0:1fb:2e2c:c88d with SMTP id lr11-20020a17090b4b8b00b001fb2e2cc88dmr1911683pjb.86.1661109220953; Sun, 21 Aug 2022 12:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661109220; cv=none; d=google.com; s=arc-20160816; b=amziVzVQUdlzQaOs211QNQVM4VSCAKVhR+nm10vifWlE3tjwtz1gJLDmi9N9rLsYA0 tSr/fjCufKVO5nipEYDKG27KCAGT9bZk4ghgKJBA6DMiQbxFxoD+ySaPz6s9VKKf/rE/ PoRPvhtfzrcO6A6CjDm3JbKTNIoyBIZ3ROvJr7sQEf++tg9OQWebPgPwR+hPVp2uj4nQ uEUhOshXd0n5X9aa7Cn+9OQejD5p2fr9NmuBwmBuunn5owXFQWenwRqWASCygLqjANfI LijNpnK3PFdazKQBUAF69oOmpWfqPlUyuOeq1VkZ9Rfvoscwxpj1I+6qnX09jQ9gj/1H K1Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=+Ctx+jhAwU3XJgjJB1WPXpgZ7f3WfjOvLdaH5vKamrw=; b=TSGHUoEfBt//KzIg8BM3sqQkpYAdam/5n+YrJACO/VR9T8CjkmL5p8GD0Q8Kq69zlj i5L5VhqtSgN7GK9POCbi4HBcP5RhoydtHxVgvVAvvKqdy63oEhRPkOIbHJajy7Wb8YR/ VXUlt7H+wGY+NipHckiM/L+UkbBptTkMT8v73ObS4HL2zP6jR6DLJZJebqS9bRyMGXb5 Kz/Z24lJW8v6QYDPJclZcR2QKFKJIaDdTXh+2ZNugFXzTwp5zKPPmwJkUE/FpRlZdUWW LAo9Y6Npdk54NRQ7xUxTKG1uMhWDXeiReS1MmfxwNDIDPdkter6+Pz0C6up07YMRKzoC YNDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=K7VktiH7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm4-20020a656e84000000b0041d16f4f04fsi10016593pgb.515.2022.08.21.12.13.23; Sun, 21 Aug 2022 12:13:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=K7VktiH7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230464AbiHUTLs (ORCPT + 99 others); Sun, 21 Aug 2022 15:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbiHUTLr (ORCPT ); Sun, 21 Aug 2022 15:11:47 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E86C1B7AE; Sun, 21 Aug 2022 12:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661109085; bh=xXlJFzE/RmrPZcunWw32jAe55Yko3tEOJOCDepAu6zY=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=K7VktiH7PTnbFQznNi4rXe0FqZWDvQcOuX/7VMezvHmQroLbpJgpH3rxeEugkVF0v 224P3vpqLMG4XtoOPFd0cgdSmJcwNakvNnDulhkeXI32MGFV1B3FkdI+pGGCRzHawM Bh5+B8GdJtF6N0ajdDynbloqSw+1iHIPJ8XLatpE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.21] ([141.30.226.119]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mk0JW-1p9wkX25do-00kQ7D; Sun, 21 Aug 2022 21:11:25 +0200 Subject: Re: [PATCH 1/3] hwmon: (dell-smm) Fail probing when cooling device registration fails To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: jdelvare@suse.com, linux@roeck-us.net, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220821151713.11198-1-W_Armin@gmx.de> <20220821151713.11198-2-W_Armin@gmx.de> <20220821154145.v7da76besv2qzqhj@pali> From: Armin Wolf Message-ID: Date: Sun, 21 Aug 2022 21:11:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20220821154145.v7da76besv2qzqhj@pali> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:kre3G2oBS9gCz9PF7rhKOEbMD4ubfZgE5R36d9SIbsk2jwAhVzF gLSShiiM6eIetS3CVSUoI+tsNlhcYYmAauD0gx4fPLhlZs50CbnfpaSDM899YS0bebkRPGe 1uYgoaW2jiDFxwo3zdqpO7j+9ZiSyNABYBP2NKHSwlaVUoNtHoKXOr4O/wCxweMHD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wCTZbwAw3aonL/dF9jVXjzvRINWtf9ZNC6zzV3JFGvl ZbBEJKCGU12uljNhOlAOBgMFp/Qe/Elgq0RBG1r6jJiZ8CRH/aAO1T6B6HnHdD8rU04xLfypF 8Mm0rVOS6KwflBU4ToOc1P8R808BORnh1NkWEbhWAhKSs9eEe9y+dk4pg== X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 21.08.22 um 17:41 schrieb Pali Roh=C3=A1r: > On Sunday 21 August 2022 17:17:11 Armin Wolf wrote: >> Previously, it was thought that failing to register a cooling device >> would not be critical, so the probing was not aborted in such a case. >> This however would lead to userspace being unable to rely on those >> cooling devices, since they might not represent all fans being present. >> Fix that by failing probing when cooling device registration fails. > This patch does not fix address this issue fully. CONFIG_THERMAL can be > disabled during compile time and then cooling device would not be > registered too. I though of the cooling device feature as being optional "as a whole". So when CONFIG_THERMAL is disabled during compile time, the driver does not create any cooling devices. If however CONFIG_THERMAL was enabled during compile time, the driver should fail probing if it cannot register all cooling devices. Armin Wolf >> Tested on a Dell Inspiron 3505. >> >> Fixes: e0d3f7cb2606 ("hwmon: (dell-smm) Add cooling device support") >> Signed-off-by: Armin Wolf >> --- >> drivers/hwmon/dell-smm-hwmon.c | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hw= mon.c >> index 7f8d95dd2717..1dab7591576a 100644 >> --- a/drivers/hwmon/dell-smm-hwmon.c >> +++ b/drivers/hwmon/dell-smm-hwmon.c >> @@ -1013,12 +1013,10 @@ static int __init dell_smm_init_hwmon(struct de= vice *dev) >> >> data->fan[i] =3D true; >> >> - /* the cooling device is not critical, ignore failures */ >> if (IS_REACHABLE(CONFIG_THERMAL)) { >> err =3D dell_smm_init_cdev(dev, i); >> if (err < 0) >> - dev_warn(dev, "Failed to register cooling device for fan %u\n", >> - i + 1); >> + return err; >> } >> >> data->fan_nominal_speed[i] =3D devm_kmalloc_array(dev, data->i8k_fa= n_max + 1, >> -- >> 2.30.2 >>