From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Cline Subject: Re: [PATCH] drm/nouveau: Add fine-grain temperature reporting Date: Wed, 9 Sep 2020 10:07:06 -0400 Message-ID: <20200909140706.GA27322@dev.jcline.org> References: <20200812204952.1921587-1-jcline@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: Karol Herbst Cc: David Airlie , ML nouveau , LKML , ML dri-devel , Ben Skeggs , Daniel Vetter List-Id: nouveau.vger.kernel.org On Wed, Sep 09, 2020 at 10:22:14AM +0200, Karol Herbst wrote: > On Wed, Sep 9, 2020 at 6:06 AM Ben Skeggs wrote: > > > > On Thu, 13 Aug 2020 at 06:50, Jeremy Cline wrote: > > > > > > Commit d32656373857 ("drm/nouveau/therm/gp100: initial implementation of > > > new gp1xx temperature sensor") added support for reading finer-grain > > > temperatures, but continued to report temperatures in 1 degree Celsius > > > increments via nvkm_therm_temp_get(). > > > > > > Rather than altering nvkm_therm_temp_get() to report finer-grain > > > temperatures, which would be inconvenient for other users of the > > > function, a second interface has been added to line up with hwmon's > > > native unit of temperature. > > Hey Jeremy, > > > > Sorry this slipped past me until now. I'm OK with adding support for > > millidegree temperature reporting, but don't think we need to keep > > both interfaces around and would rather see the existing code > > converted to return millidegrees (even on GPUs that don't support it) > > instead of degrees. > > > > Thanks! > > Ben. > > > > just a note as I was trying something like that in the past: we have a > lot of code which fetches the temperature and there are a lot of > places where we would then do a divide by 1000, so having a wrapper > function at least makes sense. If we want to keep the func pointers? > well.. I guess the increased CPU overhead wouldn't be as bad if all > sub classes do this static * 1000 as well either. I just think we > should have both interfaces in subdev/therm.h so we can just keep most > of the current code as is. > Indeed. My initial plan was to change the meaning of temp_get() and adjust all the users, but there's around a dozen of them and based on my understanding of the users none of them cared much about such accuracy. However, I do find having one way to do things appealing, so if there's a strong preference for it, I'm happy to produce a somewhat more invasive patch where all users expect millidegrees. - Jeremy 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 166E1C433E2 for ; Wed, 9 Sep 2020 14:07:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A82E121D7D for ; Wed, 9 Sep 2020 14:07:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fhWsR+p/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A82E121D7D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EA02F6E30C; Wed, 9 Sep 2020 14:07:14 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 163406E30C for ; Wed, 9 Sep 2020 14:07:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599660432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AyBwbPv8eeKvlLBjOakfjoLGMVOfW6zd9C67uN/maIo=; b=fhWsR+p//XfTzQ5VsdU/0+5yACOdj3o+PYVRrDmD+P5zjXNt8p9tVn1XBDsqMizVkpxCeK 8Lr5k2tASEtd7rIl2ZC7RYupxujZPwbvZPssqGmQbLYey1JjgaQRTBb94NeceHFlQkRRms A01dxw84RMpSyNJqkc0/mCZ3waMAUoA= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-tke4mD0jPHmCskQmTA6YLg-1; Wed, 09 Sep 2020 10:07:10 -0400 X-MC-Unique: tke4mD0jPHmCskQmTA6YLg-1 Received: by mail-qv1-f71.google.com with SMTP id f21so1420554qve.9 for ; Wed, 09 Sep 2020 07:07:10 -0700 (PDT) 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:references :mime-version:content-disposition:in-reply-to; bh=AyBwbPv8eeKvlLBjOakfjoLGMVOfW6zd9C67uN/maIo=; b=p81hA9hhq7/XPm41f6OSE69VQLfoCpFnZZEnAyGkAelF15/SuBKIeoThKkRPfA80vM LdQw690heeTVeyQ/f32Kwf8q9AT358JeaXo7nwG/hQFsjL5zEoFPLpB8HpNaLMC/8gL4 6413NS9FgLMu2WGWlq3vwsmNElfWV2luRNTNfUxirVQtCB9ZgYlhnHHJB6DWiSjSKBcz rOZgyHlZESMltY8cqqafTuqqaFayp7LCUkf31YVmN8dBSPctWruQaSJagpkw6oEJroTK e8F9Pl0IfGFl9zK4v7s41KautsEzGIkdC+wtU+eDw5MIn9+V0JNLYd5swbkrFQ3tPxh7 oLLg== X-Gm-Message-State: AOAM531Cq41LusyU9BxUNIg3cuR/FAH7V7k8mhlEi67OAV3rJxcs0q9o 67qyH8n5t5MyYFywu3LYBJfHdasMQ5IeanbF9vWwo0JsN2cW1T4cKaukgIt9qZoD9KqGKbaT5BY 0JxZXmYjw8ijdFZk9Wf0eA6akHELe X-Received: by 2002:ad4:45a6:: with SMTP id y6mr4343658qvu.8.1599660429909; Wed, 09 Sep 2020 07:07:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR62IGHKCUdInJpA3KR7u+Fm1jkeugqEcJXQiLZYHdCq9aP3hWO+P2sN+mj2H1K846ayPcXg== X-Received: by 2002:ad4:45a6:: with SMTP id y6mr4343635qvu.8.1599660429620; Wed, 09 Sep 2020 07:07:09 -0700 (PDT) Received: from dev.jcline.org ([136.56.20.95]) by smtp.gmail.com with ESMTPSA id d76sm2649240qkc.81.2020.09.09.07.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 07:07:08 -0700 (PDT) Date: Wed, 9 Sep 2020 10:07:06 -0400 From: Jeremy Cline To: Karol Herbst Subject: Re: [Nouveau] [PATCH] drm/nouveau: Add fine-grain temperature reporting Message-ID: <20200909140706.GA27322@dev.jcline.org> References: <20200812204952.1921587-1-jcline@redhat.com> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jcline@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ben Skeggs , David Airlie , ML nouveau , LKML , ML dri-devel , Ben Skeggs Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Sep 09, 2020 at 10:22:14AM +0200, Karol Herbst wrote: > On Wed, Sep 9, 2020 at 6:06 AM Ben Skeggs wrote: > > > > On Thu, 13 Aug 2020 at 06:50, Jeremy Cline wrote: > > > > > > Commit d32656373857 ("drm/nouveau/therm/gp100: initial implementation of > > > new gp1xx temperature sensor") added support for reading finer-grain > > > temperatures, but continued to report temperatures in 1 degree Celsius > > > increments via nvkm_therm_temp_get(). > > > > > > Rather than altering nvkm_therm_temp_get() to report finer-grain > > > temperatures, which would be inconvenient for other users of the > > > function, a second interface has been added to line up with hwmon's > > > native unit of temperature. > > Hey Jeremy, > > > > Sorry this slipped past me until now. I'm OK with adding support for > > millidegree temperature reporting, but don't think we need to keep > > both interfaces around and would rather see the existing code > > converted to return millidegrees (even on GPUs that don't support it) > > instead of degrees. > > > > Thanks! > > Ben. > > > > just a note as I was trying something like that in the past: we have a > lot of code which fetches the temperature and there are a lot of > places where we would then do a divide by 1000, so having a wrapper > function at least makes sense. If we want to keep the func pointers? > well.. I guess the increased CPU overhead wouldn't be as bad if all > sub classes do this static * 1000 as well either. I just think we > should have both interfaces in subdev/therm.h so we can just keep most > of the current code as is. > Indeed. My initial plan was to change the meaning of temp_get() and adjust all the users, but there's around a dozen of them and based on my understanding of the users none of them cared much about such accuracy. However, I do find having one way to do things appealing, so if there's a strong preference for it, I'm happy to produce a somewhat more invasive patch where all users expect millidegrees. - Jeremy _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel 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=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 07242C43461 for ; Wed, 9 Sep 2020 17:12:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A398921D80 for ; Wed, 9 Sep 2020 17:12:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="E5m0Beqt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730463AbgIIRMU (ORCPT ); Wed, 9 Sep 2020 13:12:20 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:23443 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730271AbgIIPck (ORCPT ); Wed, 9 Sep 2020 11:32:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599665554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AyBwbPv8eeKvlLBjOakfjoLGMVOfW6zd9C67uN/maIo=; b=E5m0Beqt0fdcIfLbyMWLvoLDtofs39fBFX6A+ZiA6JkAAyotuZjoXUlFYGfOjaANNRl/qt 1mZEOGRMMQNUVZI7L6i0sI8eVLXfqij7dYmWZHXENNY+X7cJ1XHNkD6i/fE2tOGHH2PGhq MhOVFRaa5b3Z5jzxIHVzfhBLU7veJD0= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472-vC-6M-nDO5COXNvFyPWkAA-1; Wed, 09 Sep 2020 10:07:10 -0400 X-MC-Unique: vC-6M-nDO5COXNvFyPWkAA-1 Received: by mail-qt1-f198.google.com with SMTP id j19so1835050qtp.19 for ; Wed, 09 Sep 2020 07:07:10 -0700 (PDT) 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:references :mime-version:content-disposition:in-reply-to; bh=AyBwbPv8eeKvlLBjOakfjoLGMVOfW6zd9C67uN/maIo=; b=EnYioK6QxImtDMU/vAulEqjxq7neD2JYklt57V9papbIIeh/gScgvewRHx/sjae3ya 3Yk1ecv7327XVhwpci2cgJtbWqC8AYwfEfbohpOIAEhBgdYcXL6h8sN4pT2v6Hwzd3rh q1VLsDxwXSCDKvkF3pJfN0lnXth+6FP/gQzjr1rbcLl3Go1Y2ybsPqr6QvyfDaGL/6uv SYEFwZRMwa1LbIHS1daganQbdho+CYNCwWZGryO2zSkuhtW7eAd0c0kiXQ+GjayzR+Uu gSCjyn28F/4MSRDh7msdOWi36+bS6rjuX9G6VR/xB/JgD7Yju9clnXtM+qTtaC0TGayZ /t3Q== X-Gm-Message-State: AOAM531UEC1P+zNauPGpVr56B4noXFR4tYjo9NPzYeuJWqKB5LGPRQn2 +Wlk8cbGoKPNe5GlOw3xjrxy9MGh2wYyUjB3r0xDrBzZUQSva+nTRcuuVO3hIT9n/Xi0lJ4R3tP SGLEQzpZYOOp6lDbCmarFEdBp X-Received: by 2002:ad4:45a6:: with SMTP id y6mr4343661qvu.8.1599660429910; Wed, 09 Sep 2020 07:07:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR62IGHKCUdInJpA3KR7u+Fm1jkeugqEcJXQiLZYHdCq9aP3hWO+P2sN+mj2H1K846ayPcXg== X-Received: by 2002:ad4:45a6:: with SMTP id y6mr4343635qvu.8.1599660429620; Wed, 09 Sep 2020 07:07:09 -0700 (PDT) Received: from dev.jcline.org ([136.56.20.95]) by smtp.gmail.com with ESMTPSA id d76sm2649240qkc.81.2020.09.09.07.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 07:07:08 -0700 (PDT) Date: Wed, 9 Sep 2020 10:07:06 -0400 From: Jeremy Cline To: Karol Herbst Cc: Ben Skeggs , David Airlie , ML nouveau , LKML , ML dri-devel , Ben Skeggs , Daniel Vetter Subject: Re: [Nouveau] [PATCH] drm/nouveau: Add fine-grain temperature reporting Message-ID: <20200909140706.GA27322@dev.jcline.org> References: <20200812204952.1921587-1-jcline@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 10:22:14AM +0200, Karol Herbst wrote: > On Wed, Sep 9, 2020 at 6:06 AM Ben Skeggs wrote: > > > > On Thu, 13 Aug 2020 at 06:50, Jeremy Cline wrote: > > > > > > Commit d32656373857 ("drm/nouveau/therm/gp100: initial implementation of > > > new gp1xx temperature sensor") added support for reading finer-grain > > > temperatures, but continued to report temperatures in 1 degree Celsius > > > increments via nvkm_therm_temp_get(). > > > > > > Rather than altering nvkm_therm_temp_get() to report finer-grain > > > temperatures, which would be inconvenient for other users of the > > > function, a second interface has been added to line up with hwmon's > > > native unit of temperature. > > Hey Jeremy, > > > > Sorry this slipped past me until now. I'm OK with adding support for > > millidegree temperature reporting, but don't think we need to keep > > both interfaces around and would rather see the existing code > > converted to return millidegrees (even on GPUs that don't support it) > > instead of degrees. > > > > Thanks! > > Ben. > > > > just a note as I was trying something like that in the past: we have a > lot of code which fetches the temperature and there are a lot of > places where we would then do a divide by 1000, so having a wrapper > function at least makes sense. If we want to keep the func pointers? > well.. I guess the increased CPU overhead wouldn't be as bad if all > sub classes do this static * 1000 as well either. I just think we > should have both interfaces in subdev/therm.h so we can just keep most > of the current code as is. > Indeed. My initial plan was to change the meaning of temp_get() and adjust all the users, but there's around a dozen of them and based on my understanding of the users none of them cared much about such accuracy. However, I do find having one way to do things appealing, so if there's a strong preference for it, I'm happy to produce a somewhat more invasive patch where all users expect millidegrees. - Jeremy