Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1461605rwa; Sun, 21 Aug 2022 08:56:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR6C69xHFEXVyKvQ4JqWKpPFFwDcQ8vaEAQ9qKpZ0TH1g/2VN9q9vn4vUQdFa+LWd6TQj3BD X-Received: by 2002:a17:907:1c18:b0:731:a6c:8a with SMTP id nc24-20020a1709071c1800b007310a6c008amr10593498ejc.459.1661097377886; Sun, 21 Aug 2022 08:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661097377; cv=none; d=google.com; s=arc-20160816; b=PRyX/isO2uFfbWX5QIlM4Kz9yGo2cZ47DOKRonfgEOQGg3Zwbtm4Sx7T/9NZiVROCf mlaYUtVCCnxon2ZdylY8VSAW6PNoF5lGA+IlRccGgEYpwS81KhL5yGL4zmQnIBKPQswG GYZlGIyHxGIpuFRegQOhVQi/yfgySUZ9jTwuUyStNB+ozAS08r/JMD2s6p+vrL8+gZIa 54mca3DT1knhahryJH13izA4h2Ioky7BijMVhGDPml2OlPHynkLxQ17NvWU6KCbjP5hz K+Ykr+q2EX/4duNIq63N9sTvttKOLyq7Z/uh1sAd/qBDDIb2+VV7dumkPIiyXHy60nrr O1dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1/VNypo1RyNk5toa+mkfzX7vRe3rX11jXNCtsoiwnas=; b=TmZF4Oq4DZ5wwlXKOxe9uD9N3BBxFOlynPz0Zff7dyJ5jaHuuL+XQ1RLh9pNuOUq3G fkKnA8ze7Ddz9XsTlccb7ZftPjsQBJoMaR8SRqoZ2j4uBghE1ZDd1olg6lK5tT+jD1yD 9sxNeYDldbjiBZmSjc3q+bLN38GTHXrwplFPKscgLtQusot+w9q9wVmBaGuxYOXWE5TY nxfAKP8P20awi74zXFclfLiZFK3J7DBmvzjrsNG1gR6zOespgGtZk3MqucwgicvLLKTo e/9ugRr1dKoX3HkSr5PxjADdz7L6rj5RIWvVBs1KaQEVFhxKY/cFYo9Qu1WWwXJfGqya 4t9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jh78gCvt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn18-20020a17090794d200b0073d795a38d2si1669643ejc.79.2022.08.21.08.55.50; Sun, 21 Aug 2022 08:56:17 -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=@kernel.org header.s=k20201202 header.b=jh78gCvt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231522AbiHUPlv (ORCPT + 99 others); Sun, 21 Aug 2022 11:41:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiHUPlu (ORCPT ); Sun, 21 Aug 2022 11:41:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2C161CB14; Sun, 21 Aug 2022 08:41:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4B86B60F04; Sun, 21 Aug 2022 15:41:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87BB5C433C1; Sun, 21 Aug 2022 15:41:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661096508; bh=93PclUVO1BVNqwydjTRtUJajm+fIYY5f8aL+MFhY4to=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jh78gCvtJcinyu+SuOhYYnq7P2u5/x1paSdyeGjHH2ZBSlWcGH4mrsMeq+AvwLBdr Spwf/5jc0sO/95NeOtLsgM/ViQyXMsUwmNkRHx2GYEL/kjCDMCnz+FrmaHvd0yjdEJ z7pcD/oG8QMkTrPUtYjjeclTUP6+taedShSJAo/s6I2hnV5IcEjdsJKCQv9wfUJy3o hCm/QA2Q9enMNny1zRD0hWjH00zKsRtf/DHEQQj95wiVn59AhV1RmNz2o0M+9Lp8bq Ir1bU/7ssG7d9xd9R3SZ9wljjiz+jbZJXWn67Pxj9fPEPaFyGydb1IsA6n+HqmGHf2 edMwEO20sqHFw== Received: by pali.im (Postfix) id 9CA3B828; Sun, 21 Aug 2022 17:41:45 +0200 (CEST) Date: Sun, 21 Aug 2022 17:41:45 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Armin Wolf Cc: jdelvare@suse.com, linux@roeck-us.net, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] hwmon: (dell-smm) Fail probing when cooling device registration fails Message-ID: <20220821154145.v7da76besv2qzqhj@pali> References: <20220821151713.11198-1-W_Armin@gmx.de> <20220821151713.11198-2-W_Armin@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220821151713.11198-2-W_Armin@gmx.de> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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. > 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-hwmon.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 device *dev) > > data->fan[i] = true; > > - /* the cooling device is not critical, ignore failures */ > if (IS_REACHABLE(CONFIG_THERMAL)) { > err = 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] = devm_kmalloc_array(dev, data->i8k_fan_max + 1, > -- > 2.30.2 >