From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F76EC4320E for ; Tue, 24 Aug 2021 21:12:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE9F56128A for ; Tue, 24 Aug 2021 21:12:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234978AbhHXVNS (ORCPT ); Tue, 24 Aug 2021 17:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234442AbhHXVNO (ORCPT ); Tue, 24 Aug 2021 17:13:14 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 735D5C0613C1 for ; Tue, 24 Aug 2021 14:12:30 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id l7-20020a0568302b0700b0051c0181deebso18062402otv.12 for ; Tue, 24 Aug 2021 14:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=VvJ41OUQjcIqP2/V4RRgvKQKaUvc+Q8/8VHMdF1do8Q=; b=a0llSe0VINrc71feDG/BpuGjlsKvKo1iN5416uQ31/w+N0ksxUtZ2meejEL/ITGZ/d bJ3OvkrKH+YluSXZMocEAT8uHOzSCUb+SdTwx5+9DPC7LsEsKDFETFXq5jnAc36l2T6Y vfciSWjKmqrl9mr7EVpRx7xmCEzgFsXnO6QcM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=VvJ41OUQjcIqP2/V4RRgvKQKaUvc+Q8/8VHMdF1do8Q=; b=iRSbCicjJw+/uZmgtJi+ZnmbWhC3XnHZR7YcZcPOAKrIEtifsNem3pSHvw/S5BTmdp K7XcuGwZvevWo39puSlYFCYw9ESXMbaunHWI2S0wm1hSbtpaTvVjJQ3yCXZzmxBM4SaK SKySi6P+/qfySbPqK2n/SZSi/GJEPs1d+9o6FDISmZjJm5iGqHx5E1a60LVhkDpevggK YhJ2Z9LHM0q5ZOeVOeLcMAE1NFkxAh08kv0E3l7Q41mTYNUvL9CTdW2iO9hAR5lcxqxg EwUoNTfKeKdDVEp3glEua/Z62a8Bg3m0vzfu0Vu2nC7Q0Ca0nMGx5KdfkjPdLo5sC4aH 1yiQ== X-Gm-Message-State: AOAM533lyyV+Hd/AJ0N5wCRzOs9YPhEQPuSmJbinFevpANo3Doug3zm3 mo+P5ySFv55K7YW7Et8jgd/3VS3RIP472TadO74plK4H99o= X-Google-Smtp-Source: ABdhPJx08FQcEL2UXtCAGxTVtKc6L4YcEdQ26f3P0zd41icoXQklXAOtrjA3tbBpHCVb7lXrokHsBMM4SWrlwn2irUI= X-Received: by 2002:a05:6808:181a:: with SMTP id bh26mr4480953oib.166.1629839549674; Tue, 24 Aug 2021 14:12:29 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 24 Aug 2021 14:12:29 -0700 MIME-Version: 1.0 In-Reply-To: References: <20210823134726.1.I1dd23ddf77e5b3568625d80d6827653af071ce19@changeid> From: Stephen Boyd User-Agent: alot/0.9.1 Date: Tue, 24 Aug 2021 14:12:29 -0700 Message-ID: Subject: Re: [PATCH] thermal: qcom: spmi-adc-tm5: Don't abort probing if a sensor is not used To: Matthias Kaehlcke Cc: Amit Kucheria , Andy Gross , Bjorn Andersson , Daniel Lezcano , Dmitry Baryshkov , Thara Gopinath , Zhang Rui , linux-pm@vger.kernel.org, Douglas Anderson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Matthias Kaehlcke (2021-08-24 11:37:42) > On Mon, Aug 23, 2021 at 06:50:04PM -0500, Stephen Boyd wrote: > > Quoting Matthias Kaehlcke (2021-08-23 13:47:30) > > > adc_tm5_register_tzd() registers the thermal zone sensors for all > > > channels of the thermal monitor. If the registration of one channel > > > fails the function skips the processing of the remaining channels > > > and returns an error, which results in _probe() being aborted. > > > > > > One of the reasons the registration could fail is that none of the > > > thermal zones is using the channel/sensor, which hardly is a critical > > > error (if it is an error at all). If this case is detected emit a > > > warning and continue with processing the remaining channels. > > > > > > Fixes: ca66dca5eda6 ("thermal: qcom: add support for adc-tm5 PMIC thermal monitor") > > > Signed-off-by: Matthias Kaehlcke > > > --- > > > > Reported-by: Stephen Boyd > > Reviewed-by: Stephen Boyd > > Thanks for the review! > > > Should we also disable the 'charger-thermistor@0' node in > > sc7180-trogdor.dtsi on lazor boards, instead of the thermal zone, or in > > addition to the thermal zone? It isn't used so there's not much value in > > exposing it. > > I wouldn't do it instead of disabling the thermal zone, a TZ without a > sensor doesn't seem very useful. > > IIUC the thermistor nodes would need to be deleted, not disabled. > Currently the nodes don't have labels, so either the labels would need > to be added, or the deletion would have to look something like this: > > &pm6150_adc { > /delete-node/ charger-thermistor@4f; > }; > > &pm6150_adc_tm { > /delete-node/ charger-thermistor@0; > }; > > If the change is done for Lazor it should also be done for PomPom and > CoachZ. > > I don't see a strong need to delete the ADC nodes with the clutter it > adds, but I'm open to it if you prefer :) The driver will be present in system memory when it is never used. I was mostly noticing that adc_tm5_get_dt_data() calls of_get_available_child_count() and bails probe if there aren't any child nodes. In this case, the only child node is charger-thermistor, so probe for this driver would fail if the thermistor was removed. So at that point, I wonder if we should disable the thermal zone node (already done) and then also the adc node (sadly called adc-tm). This way we don't eat up kernel memory to describe a device that isn't used and a driver that wastes time probing and then fails to probe anyway.