Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp200730pxb; Fri, 9 Apr 2021 23:41:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdar7EZAweeFA1yXyTE2YsMlGYMstAv0xbOj6Q58JjSBfDvDJ6ikCW1Hktt+CWYR3aumNX X-Received: by 2002:a17:906:1182:: with SMTP id n2mr19354871eja.234.1618036876104; Fri, 09 Apr 2021 23:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618036876; cv=none; d=google.com; s=arc-20160816; b=RvuWL6m+lM01BVHuGCjPdAJg0gx8OH64oPGeMAKzns23KXdeAgutBNjctijTW8aj8g jD2gdtjt8I8MvvR5EvviRoYomXs8pGPg7uSFFlI5Qmb6fhi6lAavfCdXSfqscX2nXVi5 vrHJH0NJdNjLFxSE5XYHx6jbfHZvj6czHOU3bsT61YabOEnRQylY6ezlsgyBfQp0BWAa U5+sSRNVTGLyHnQz5Fplmzfc3hwF6OvIwrRKwNHeXFwzglMp8O7VBa4VeEejZYtGxdZZ pSCPcgkJdy+ESUUbTAYtZW/KQ0IarjASKVUX3gRhL6RcLGtpz7vb4fiwAJZkLVX7DSwX eQew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:sender:dkim-signature; bh=igOZ6Kp3VA1wEOJ+TW8ALtZwZ+6wILNO7aMHAoDA9TU=; b=EAoHiWzdLDGadKBnvbbNzHGloXCQG1DMTc3m/t7mrcr0Px6rnPd5Q9PZrMMqtebx6D 6hN9C3skwomD3uBgO/gMHztzN95paKkQG3Gvo+9I4QBMe5aGfDZKCHAguoEKusI3iS38 8wX/ACM+jVz1QrotFTuZOAGfrqk3w4vdACdCacp2WdZGTgDjwlOESD6GUM+LEExxCsBz FrxKkDVspO+3bcduk7v1Zmq1Ip9AQZxwL8O2QUSDI1MVC0iEyvLMdy6E9lQN0HoE3kio DKgw2R5MRKmjnPLVegANSq+QzWFnge+vtxeRtPW8WOIrDlFaWyHnHgIATqO8XgrY24AF z8og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XOjemfYL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si3849020eda.74.2021.04.09.23.40.53; Fri, 09 Apr 2021 23:41:16 -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=XOjemfYL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233606AbhDJGkT (ORCPT + 99 others); Sat, 10 Apr 2021 02:40:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbhDJGkR (ORCPT ); Sat, 10 Apr 2021 02:40:17 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A596CC061762; Fri, 9 Apr 2021 23:40:03 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id l12-20020a9d6a8c0000b0290238e0f9f0d8so7831832otq.8; Fri, 09 Apr 2021 23:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=igOZ6Kp3VA1wEOJ+TW8ALtZwZ+6wILNO7aMHAoDA9TU=; b=XOjemfYLhCB7IGRAG+El8JH/YRBMj9FEB78leEdGodz6pG4bNVZbAbjh4XHo2QPSmd /KiKjp0HacslNh0WqxQF+lORT2vogNLRiBgs44NqtBdS0bNuPFX6EB8rQp+pjUNfCnpL 9TK2BQb21WymN6LdtaA7gK7SBIJFrSRp3z6OgOIYg9FlRhfkjCFyZI7d7JB5Zti/o+8T rrDOePqL3GF5rbTyeNbrSj6B5rHubOLADoQQCjOaOQNTU7XttHdJ4MAa/bldfR0NEc1B gIazW1xr9u74flzP1Y98d5hc39FrGorRkM0Yd+ToFbIFLFrN57JpzPI/0K5QDz0yveIg GN8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=igOZ6Kp3VA1wEOJ+TW8ALtZwZ+6wILNO7aMHAoDA9TU=; b=YNByL2pfzPbek/BMULQC9Fxxul5ZHf/MF+PlEcpcJRG0ePkQ2C0o/OwBTSU3fJ5GmK 5/XagL6mvZGEuZ8bWqvwwqjcWINuIm84/nPqWaXMxSyD+M1BcR3ceVUv7QJ1yt6DDtUW gNyBhIcCBbUn6Gv22qVWSmNCacjMxcKC0LrFM5Ch4CX/loOIgialLjbDL4SWbFJRVxGK Obd6MYZs9sWhKkvwJ/eZK5gSeBZFg5onEzBCpsMf0HHchcODtf7jbDr5Dwia88Fsu1// 9gjpT30UeHJoWIfYI9ZiPdWA5AgJHnlP9V1JOGf0rRCAl16EJ4M9qkZV+sU3S3UJHzvj 2Fqw== X-Gm-Message-State: AOAM532Cuy4wwq7T4bVI84yrACQD6gNhhKxnQu+Wp/nEpOBas5B4/RW8 XTm6BKig2Gr3D8tv1KXfz0E= X-Received: by 2002:a9d:6013:: with SMTP id h19mr15309639otj.72.1618036802508; Fri, 09 Apr 2021 23:40:02 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d1sm945371oop.0.2021.04.09.23.40.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Apr 2021 23:40:02 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH v2] platform/x86: add Gigabyte WMI temperature driver To: Hans de Goede , =?UTF-8?Q?Thomas_Wei=c3=9fschuh?= Cc: platform-driver-x86@vger.kernel.org, Mark Gross , linux-kernel@vger.kernel.org, =?UTF-8?Q?Barnab=c3=a1s_P=c5=91cze?= , Matthew Garrett References: <20210405204810.339763-1-linux@weissschuh.net> <20210408150821.GA205657@roeck-us.net> <245fe6eb-b188-ee50-bf75-8a16fe8f5d67@redhat.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBv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8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: Date: Fri, 9 Apr 2021 23:40:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <245fe6eb-b188-ee50-bf75-8a16fe8f5d67@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/8/21 9:07 AM, Hans de Goede wrote: > Hi Guenter, > > On 4/8/21 5:08 PM, Guenter Roeck wrote: >> On Mon, Apr 05, 2021 at 10:48:10PM +0200, Thomas Weißschuh wrote: >>> Changes since v1: >>> * Incorporate feedback from Barnabás Pőcze >>> * Use a WMI driver instead of a platform driver >>> * Let the kernel manage the driver lifecycle >>> * Fix errno/ACPI error confusion >>> * Fix resource cleanup >>> * Document reason for integer casting >>> >>> Thank you Barnabás for your review, it is much appreciated. >>> >>> -- >8 -- >>> >>> Tested with a X570 I Aorus Pro Wifi. >>> The mainboard contains an ITE IT8688E chip for management. >>> This chips is also handled by drivers/hwmon/i87.c but as it is also used >>> by the firmware itself it needs an ACPI driver. >>> >>> Unfortunately not all sensor registers are handled by the firmware and even >>> less are exposed via WMI. >>> >>> Signed-off-by: Thomas Weißschuh >>> --- >>> drivers/platform/x86/Kconfig | 11 +++ >>> drivers/platform/x86/Makefile | 1 + >>> drivers/platform/x86/gigabyte-wmi.c | 138 ++++++++++++++++++++++++++++ >> >> Originally drivers/platform was supposed to be used for platform specific >> code. Not that I have control over it, but I really dislike that more and >> more hwmon drivers end up there. >> >> At least hwmon is in good company - I see drivers for various other subsystems >> there as well. I just wonder if that is such a good idea. That entire directory >> is bypassing subsystem maintainer reviews. > > In case you are not aware I've recent(ish) taken over the drivers/platform/x86 > maintainership from Andy Shevchenko. > > Yes it is a bit of an odd grab-bag it mostly deals with vendor specific > ACPI / WMI interfaces which often more or less require using a single > driver while offering multiple functionalities. These firmware interfaces > do not really lend themselves to demultiplexing through something like > MFD. These are mostly found on laptops where they deal with some or all of: > > - Hotkeys for brightness adjust / wlan-on/off toggle, touchpad on/off toggle, etc. > (input subsystem stuff) > - Mic. / Speaker mute LEDS (and other special LEDs) found on some laptops > (LED subsystem stuff) > - Enabling/disabling radios > (rfkill stuff) > - Controlling the DPTF performance profile > (ACPI stuff) > - Various sensors, some hwmon, some IIO > - Backlight control (drm/kms subsys) > - Enabling/disabling of LCD-builtin privacy filters (requires KMS/DRM subsys integration, pending) > - Fan control (hwmon subsys) > > And often all of this in a single driver. This is all "stuff" for which > there are no standard APIs shared between vendors, so it is a free for > all and often it is all stuffed behind a single WMI or ACPI object, > because that is how the vendor's drivers under Windows work. > > It certainly is not my intention to bypass review by other subsystem > maintainers and when there are significant questions I do try to always > get other subsys maintainers involved. See e.g. this thread, but also the > "[PATCH 1/3] thinkpad_acpi: add support for force_discharge" thread > where I asked for input from sre for the power-supply aspects of that. > > The WMI code was reworked a while back to make WMI be a bus and have > individual WMI objects be devices on that bus. version 2 of this > driver has been reworked to use this. Since this new driver is just a hwmon > driver and as this is for a desktop I expect it will stay that way, > I'm fine with moving this one over to drivers/hwmon if that has your > preference. > I thought about it, but I don't think it makes much sense since all other WMI drivers are in drivers/platform. > As for other cases then this driver, if you want to make sure you are at > least Cc-ed on all hwmon related changes I'm fine with adding you as a > reviewer to the pdx86 MAINTAINERS entry. > I think I have a better idea: I'll add a regex pattern into the MAINTAINERS entry for hardware monitoring drivers. This way we should get copied whenever anyone adds a hardware monitoring driver into the tree. Thanks, Guenter