Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp213467pxa; Wed, 26 Aug 2020 23:23:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1RFvIxE1XbSWErqGTNi5sjMXH/1TckaufA2nC7SYt6iv+5Nf8/QLc85lpEeDQSqXvJBpJ X-Received: by 2002:a50:88a4:: with SMTP id d33mr18825762edd.43.1598509385475; Wed, 26 Aug 2020 23:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598509385; cv=none; d=google.com; s=arc-20160816; b=DxzJ6pfLZadC60jI6tM+HDx2dcZZboqO+msK1sYT6xLhipBJCTHHf9bqR1oezjpsZt vkCQxF/sA1yVrQIgRmegDIP0fRK3m9BhURqKCrQ2D4FqZ9pMGidaSaAZ/3s9UW01KbBg bz7TWoMDHs/zM/Xi8BPElG2bcpeK9mSGPPocNqiZVAN3VhXs6GW8vplDPz8up6bdktL3 8b6/5XSib92/naedR+97ShHiHCQPYABVmtcMw4PtAS45YgQnsAwH8/ylwLILJ7xRcRLC zoBxEGTicL2HF3rxeWEQ6nprG+gs054M5/GHzL7NeQuFCAHLM8/JIlptAsuM6TXFe0zN SmwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2DyhFZJ3L50RHCjnfyOFFSA1C8Bx+09mqhOcCqewIw0=; b=mE7//uzTW9C+zTjTfP8NhVzq/nLKW4W5uBWldRj7j1DOR+GeXPEbXy9tr6CGytC0a7 BuzRjX+0uUxr/pxYgZpWMZJbg2eQ8o7nYH81k7mNT9XiNXk8q5ucXGw9grWHWtuW1FVy lQxCL6VhD+OYNXtloIAKTweCvStgrD92AXV/BIOttVcP6tJQq9zaSoxBSLYAGh+ZcHHo PYeP+Q42bkUl+w53O0HicxTwCpdKiUUP2OE40dPPaZ0TmnIjMv3e/69pILqA/gyVxkIp hkKr+NKh7S+gMVM41+oNdVbPiNc+QbwUkoDuHJER6MfgyVOVm0rSPdX1NottyRjI/LIk Pnfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gBs5DsGV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m64si885540ede.91.2020.08.26.23.22.41; Wed, 26 Aug 2020 23:23:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gBs5DsGV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726299AbgH0GUC (ORCPT + 99 others); Thu, 27 Aug 2020 02:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbgH0GUB (ORCPT ); Thu, 27 Aug 2020 02:20:01 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0CD3C06125E; Wed, 26 Aug 2020 23:20:01 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id g6so2066370pjl.0; Wed, 26 Aug 2020 23:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2DyhFZJ3L50RHCjnfyOFFSA1C8Bx+09mqhOcCqewIw0=; b=gBs5DsGVImY9h2NdkLBA8VAbLClDmYf5k2JzfxV4NQDIUkz5iE220JF3pbKR+IKQFK XEK8sV8YVio9/4ea8Kfz265u4SGZdsJ+SMCKBEMy9lskCqqCV5DHsDaury2NC+f08Nd6 KCGYFjOFxHXZ+XzAcQyGjZsyDSfjMgL9yt23ODOP3CnLG54e5PXWusKtBta6yR/1vBGK 6Q6fwPpgntt4QCeUPMufE4aTAidoXLekUL8434j9w4xOoz22S5FFaj4cNeFhPPmB3c2E LlUoBJjDV8K/g5JKVrhglMLbhDRwCQzkHBwo6Hx5tEUWyyD0Jitw7a+VGFJSo/I82FK/ cf9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2DyhFZJ3L50RHCjnfyOFFSA1C8Bx+09mqhOcCqewIw0=; b=fvxoBQKFXrH1ZFvUcimaPL2nxJlots+PqgahwtwXR6bJ7eYUtY5yzzinFV9uSuUu2C PZbnf3+ix/XyuSniBafS4enrhthwIDSHGqDzTzsBiz85j3Ktko2zy2fUL99+Gi+nWdDm zywU8jeZk6OtyjlrxFxRTj0ts4/qf3uBtEan+6Uwxreo3pxlI/5/9YiLNIyWm2rZOqdi 3fV2JYTmMdhnZXlmuSyTx/ZndJWbUQMb4OlH24Zjgo5ARdRBKUWMBP8GHi8w0Q6UcMXG N15z4MqeQLx51tcK4qZ3glZAMu6F1ydKIcNcHE/Vi1rPUdSFzmePGuJBP7dB27SQ/dlC yfiA== X-Gm-Message-State: AOAM530AwzRGcefqWiquH5fGYC8fBNdTQf6kc5t/C1h1poM1OV3X3mT8 YTRh9Hsd4dmrZ0NQ2t3NwnA= X-Received: by 2002:a17:90b:fd8:: with SMTP id gd24mr4569589pjb.234.1598509200731; Wed, 26 Aug 2020 23:20:00 -0700 (PDT) Received: from localhost ([124.156.176.71]) by smtp.gmail.com with ESMTPSA id h65sm1269103pfb.210.2020.08.26.23.19.58 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Aug 2020 23:20:00 -0700 (PDT) Date: Thu, 27 Aug 2020 14:20:03 +0800 From: Yue Hu To: Viresh Kumar Cc: rafael.j.wysocki@intel.com, Daniel Lezcano , rui.zhang@intel.com, amit.kucheria@verdurent.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, huyue2@yulong.com, zbestahu@163.com Subject: Re: [PATCH] thermal: sysfs: fall back to vzalloc for cooling device's statistics Message-ID: <20200827142003.000071c1.zbestahu@gmail.com> In-Reply-To: <20200827051401.yryitpgq2gi3nkbh@vireshk-i7> References: <20200818063005.13828-1-zbestahu@gmail.com> <40b69f97-46e5-d62e-0d2f-604dfd4dafa1@linaro.org> <20200826101319.00003048.zbestahu@gmail.com> <20200827120327.00003740.zbestahu@gmail.com> <20200827051401.yryitpgq2gi3nkbh@vireshk-i7> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 Aug 2020 10:44:01 +0530 Viresh Kumar wrote: > On 27-08-20, 12:03, Yue Hu wrote: > > Hi Daniel, > > > > Now, i'm just focus on removing the kernel warning based on current code logic. > > Commit 8ea229511e06 (thermal: Add cooling device's statistics in sysfs) added > > the thermal statistics by viresh and viresh gived the patch an acknowledgement > > in anther mail thread. > > > > Hi viresh, > > > > Could you review the patch again about the question above? > > Yeah, I Acked it but the questions raised by Daniel are very valid and must be > answered. Yes, sure. > > I understand that you only cared about fixing the warning, but maybe we need to > fix the driver and the warning will go away by itself. If you don't want to do > it, then someone who is responsible for the driver should do it. Yes, maybe the patch is not totally correct. maybe the driver has issue. Let's check the driver firstly. > > Was it the acpi_video.c driver that you got the warning from ? I have added > Rafael to the email in case that driver needs getting fixed. > Currenly, drivers/video/backlight does not call thermal_of_cooling_device_register() to register thermal cooling device. The issue happened in msm-4.19 kernel for QCOM/Android platform. Backlight in msm-4.19 kernel will register thermal cooling device as below: +static int bd_cdev_get_max_brightness(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + struct backlight_device *bd = (struct backlight_device *)cdev->devdata; + + *state = bd->props.max_brightness; + + return 0; +} +static struct thermal_cooling_device_ops bd_cdev_ops = { + .get_max_state = bd_cdev_get_max_brightness, +static void backlight_cdev_register(struct device *parent, + struct backlight_device *bd) +{ + if (of_find_property(parent->of_node, "#cooling-cells", NULL)) { + bd->cdev = thermal_of_cooling_device_register(parent->of_node, + (char *)dev_name(&bd->dev), bd, &bd_cdev_ops); And the bd->props.max_brightness is getting from video/backlight/qcom-wled.c. Maybe the driver should not assign 1024 to states/max_brightness. I'm not sure about it. So i consider to change memory allocation methord. That's the origin of the patch. Thank you.