Received: by 2002:a05:6512:e85:0:0:0:0 with SMTP id bi5csp3052177lfb; Tue, 28 Jun 2022 05:16:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v+jBsIOMh2hgUVmXz1PBjWGHFIms3S977fO6x1SNQuAyte7aFozQVvYtDIfzVwoNViOTR4 X-Received: by 2002:a63:1544:0:b0:402:de15:b4d2 with SMTP id 4-20020a631544000000b00402de15b4d2mr17337678pgv.128.1656418603037; Tue, 28 Jun 2022 05:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656418603; cv=none; d=google.com; s=arc-20160816; b=dY2aPcEMMp5LR+wv+GqzvZiaMMiXoKoQ+yz1BV0Lv7yBgtpUCaNBnYf+BM7UJjXH1J FQvTHHltcjwaTSPwKEFCC8i7MYh2SWBP6p3Z6Lq1+IUe7xgiTRGQnMvI0G2Ezi8TikZj F3AAS8z2MpcMEYDzqQQ8S824btVLfRk0eM9E99eW52IAzxXBK+JW7LBePRZaPSEv2Nms SjEXO//yDhKN8VAyIWrMygwPbB4Sbi/FFjbHroFgkRl/Zb6pD9Hdvr36TORl5h1n48QC YQxUarvH+pJaINm8bCfENkGbOqprlZbSw/AX7FAhWZoFjrRxxdLi/iwD/kK5o6iGlmZi LDcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=75CneF29MmIsH4Esygxy2yeX0nydgjQyKAWaeFDnwa8=; b=mHrlldSzCtEF8UYlVJN53KNLIfff0X13T/CcGaxSrG4Er6l78RznTQNmhaaGp4e8Rx wl6xx2kIGk/O2XYHEiu/Yzn2rRJ5DfC4yMMxwpGONiTd7K9koZm8BLoFawaJpFaxJfJg 8ZtjAwTBiSb2wsOkjs6WZYeUwJkC0CHneJaPfa2LDlHXW+OZBBpgWWqlTTFDc/xJzLZL wJzMyaeEFLkhCB3ahWu/tEDkN3J+e9vqb/RV0yLYoKfQ4+jboesD8t04oEGlfZdRmZ2s t6f9Rj0S2t2itEH+ZZyJ5azdoNaxFu9/x7uo86OgtmgxeJvYNIs1uZrVo6bdy2342QEc AbMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=RKEY5opD; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a635a43000000b0040a88eddccfsi17290118pgm.441.2022.06.28.05.16.29; Tue, 28 Jun 2022 05:16:43 -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=@collabora.com header.s=mail header.b=RKEY5opD; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345132AbiF1LqV (ORCPT + 99 others); Tue, 28 Jun 2022 07:46:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344512AbiF1LqH (ORCPT ); Tue, 28 Jun 2022 07:46:07 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 657CF340D3; Tue, 28 Jun 2022 04:44:36 -0700 (PDT) Received: from [192.168.2.145] (109-252-118-164.nat.spd-mgts.ru [109.252.118.164]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id CFC37660184F; Tue, 28 Jun 2022 12:44:33 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656416674; bh=Vq5C4bT0TiadIpd2tEqU0JzUXydBEhR40E+ZcKSOCUo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=RKEY5opDUA/HZSdk6HwnKhzBmq6nRVCS3v/NWKqMu1PMIeBdeXeSWbRS4Xn5uUMk1 k/xdYJxpKVUEGLs5pqjQwwATIdGwwAZYKzKrmACKz1LePsPHNyftCwaSj1tZBGF6uq 0eS3Zp8Ck+LQx5u+5fPlF8RoBwLxpl3/z4+POjHgUIJ8GABDDGrOuwCHXtXMcb/axL IdvCkh81M1oPN4HTUGDdeXZuVBNxs33s4pLAE3b7x8TmO2CJRVOsqvgVm1LucQwFCj JqDFHKPaE7R7E9tJRvZamO3oo4wU5QH+0yUjttlJX1njblanMhjZBrrhgqBbYovpx7 LJq1Ml1P1vqyg== Message-ID: Date: Tue, 28 Jun 2022 14:44:31 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 2/3] thermal/drivers/tegra: Remove get_trend function Content-Language: en-US To: Daniel Lezcano , Guenter Roeck Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Zhang Rui , Thierry Reding , Jonathan Hunter , Dmitry Osipenko , "open list:TEGRA ARCHITECTURE SUPPORT" , Hardware Monitoring , rafael@kernel.org References: <20220616202537.303655-1-daniel.lezcano@linaro.org> <20220616202537.303655-2-daniel.lezcano@linaro.org> <7841a809-e180-70d2-df9b-b30b411647ce@linaro.org> From: Dmitry Osipenko In-Reply-To: <7841a809-e180-70d2-df9b-b30b411647ce@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 6/28/22 11:41, Daniel Lezcano wrote: > > Thierry, Dmitry, > > are fine with this patch? Seems should be good. I couldn't test it using recent the linux-next because of a lockup in LM90 driver. There were quite a lot of changes in LM90 recently, adding Guenter. INFO: task kworker/3:1:44 blocked for more than 61 seconds. Not tainted 5.19.0-rc4-next-20220627-00012-g08b697b94b8a #2 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/3:1 state:D stack: 0 pid: 44 ppid: 2 flags:0x00000000 Workqueue: events_freezable_power_ thermal_zone_device_check Backtrace: __schedule from schedule+0x60/0xcc r10:c0fead70 r9:c2854c94 r8:df9a1dac r7:c2814b40 r6:00000002 r5:c1883020 r4:c2814b40 schedule from schedule_preempt_disabled+0x28/0x38 r5:c1883020 r4:c2814b40 schedule_preempt_disabled from __mutex_lock.constprop.0+0x1e0/0x9ac r5:c1883020 r4:c2854c90 __mutex_lock.constprop.0 from __mutex_lock_slowpath+0x1c/0x20 r10:00000000 r9:c1882ae0 r8:c2854c90 r7:c2854c40 r6:00000001 r5:00000001 r4:c2854c90 __mutex_lock_slowpath from mutex_lock+0x60/0x64 mutex_lock from lm90_read+0x40/0x3d4 r5:00000001 r4:c2854e08 lm90_read from hwmon_thermal_get_temp+0x58/0x8c r9:c1882ae0 r8:c2814b40 r7:de6aee00 r6:c1db1660 r5:c0af7940 r4:df9a1eb8 hwmon_thermal_get_temp from of_thermal_get_temp+0x38/0x44 r5:df9a1eb8 r4:c1db1400 of_thermal_get_temp from thermal_zone_get_temp+0x58/0x78 thermal_zone_get_temp from thermal_zone_device_update.part.0+0x4c/0x450 r7:de6aee00 r6:c1db1400 r5:00000000 r4:c1db1400 thermal_zone_device_update.part.0 from thermal_zone_device_check+0x58/0x5c r10:00000000 r9:c1882ae0 r8:c2814b40 r7:de6aee00 r6:c1db1400 r5:c1db1660 r4:00000001 thermal_zone_device_check from process_one_work+0x21c/0x530 r7:de6aee00 r6:de6ab600 r5:c2802c00 r4:c1db167c process_one_work from worker_thread+0x19c/0x5cc r10:00000008 r9:c2814b40 r8:c1703d40 r7:de6ab61c r6:c2802c18 r5:de6ab600 r4:c2802c00 worker_thread from kthread+0x100/0x120 r10:00000000 r9:df895e80 r8:c285e3c0 r7:c2802c00 r6:c014cf84 r5:c285e300 r4:c2814b40 kthread from ret_from_fork+0x14/0x2c Exception stack(0xdf9a1fb0 to 0xdf9a1ff8) > On 16/06/2022 22:25, Daniel Lezcano wrote: >> The get_trend function does already what the generic framework does. >> >> Remove it. >> >> Signed-off-by: Daniel Lezcano >> --- >>   drivers/thermal/tegra/soctherm.c | 32 -------------------------------- >>   1 file changed, 32 deletions(-) >> >> diff --git a/drivers/thermal/tegra/soctherm.c >> b/drivers/thermal/tegra/soctherm.c >> index 210325f92559..825eab526619 100644 >> --- a/drivers/thermal/tegra/soctherm.c >> +++ b/drivers/thermal/tegra/soctherm.c >> @@ -633,37 +633,6 @@ static int tegra_thermctl_set_trip_temp(void >> *data, int trip, int temp) >>       return 0; >>   } >>   -static int tegra_thermctl_get_trend(void *data, int trip, >> -                    enum thermal_trend *trend) >> -{ >> -    struct tegra_thermctl_zone *zone = data; >> -    struct thermal_zone_device *tz = zone->tz; >> -    int trip_temp, temp, last_temp, ret; >> - >> -    if (!tz) >> -        return -EINVAL; >> - >> -    ret = tz->ops->get_trip_temp(zone->tz, trip, &trip_temp); >> -    if (ret) >> -        return ret; >> - >> -    temp = READ_ONCE(tz->temperature); >> -    last_temp = READ_ONCE(tz->last_temperature); >> - >> -    if (temp > trip_temp) { >> -        if (temp >= last_temp) >> -            *trend = THERMAL_TREND_RAISING; >> -        else >> -            *trend = THERMAL_TREND_STABLE; >> -    } else if (temp < trip_temp) { >> -        *trend = THERMAL_TREND_DROPPING; >> -    } else { >> -        *trend = THERMAL_TREND_STABLE; >> -    } >> - >> -    return 0; >> -} >> - >>   static void thermal_irq_enable(struct tegra_thermctl_zone *zn) >>   { >>       u32 r; >> @@ -716,7 +685,6 @@ static int tegra_thermctl_set_trips(void *data, >> int lo, int hi) >>   static const struct thermal_zone_of_device_ops tegra_of_thermal_ops = { >>       .get_temp = tegra_thermctl_get_temp, >>       .set_trip_temp = tegra_thermctl_set_trip_temp, >> -    .get_trend = tegra_thermctl_get_trend, >>       .set_trips = tegra_thermctl_set_trips, >>   }; >>   > >