Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3222057lqo; Wed, 15 May 2024 03:32:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTSNTrEoE4KwXgfUqfdMYSi2AuGOvkgO0O2dVMA0mBl7ivrgZ2/d1wTDnrUGplIIJc9ZA4i6qfUS9K4G947UkHD0WatqT1o3KMtrb6pg== X-Google-Smtp-Source: AGHT+IEwjNCO8kCo2LarnEl4Na3XtDHg+iiD/FKQ5ivbpn4PIng0ge/9sK/kgSK7xvnZ7dXxSFTv X-Received: by 2002:ac8:5e4a:0:b0:43d:89f6:910d with SMTP id d75a77b69052e-43dfdced1cbmr193426471cf.54.1715769177918; Wed, 15 May 2024 03:32:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715769177; cv=pass; d=google.com; s=arc-20160816; b=xZ9KNIvsVLb5YULC0dnzggRrWqTjLt+2nUbWj1hF02PaR+FCvpwiNGNmwwbeDwrgO3 QitLi4OkFC6dqkdmiseNLtRWV9EbBaFkmiK/S/IOOyPg6wFnsDwgNQZURHcL1zGKYQJz njVJeYJ9MtSr9dn3CiDSDQE+oA9wnEZO58cR0rYuSC5j5KjLX4PEHuX3bJse1eWtpg7n T6v1BzklWf2/kJNBKEbhOxhnluPNiM53uY7Tk1IvXYhhggvKgD1CG9COjVPjiz9hwVKf fyfVyEfzedXYG17VojT3dZC79/fI7Zvdn+MgDGR82lqg7xcHDzwPXcAjtXfOpSdjh6ZH cozw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BqXCqI6mfmwJpUV0zOEyYhc7WP19SDjDMVWC5/0dV4E=; fh=04UEiRzXAu3HP4Cp0rmcyC8YeZ0H7IknYXaO8R/ziMM=; b=rM+VM2IKZZSIQUSrt4UPEVjembZCWGfN8/uUeZ9ZoBI6fRLgTb6yZVgmI7DGUcIpNq ZgfsrvJ0LKsqLI3ekYPTRdCUM82j9ZN5a6PANJ1dBxUW2u3NpBcQQO8MwZLhwWZ0sJXI FPJTr6AEBNPMvVNq1QKouFRE2gBgP/Qt2d7NEAnEB5E6n64j1YXmuRvveCV7BiV3jWWA oJyqUW8SSXiSqpcfFmxPcB2990lSUaWybC/nVeYSaaJfBKx103Yit/X2t9gOxvgiOo4O mKwGy1TyZL6DZKjCxVDmnzuJQfghux7DcmGGPVCgAX6G3WACLIa9MfmmCr2yEflVXfDy a4rg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IZngf6Bt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-179764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e00cb4e33si113081241cf.517.2024.05.15.03.32.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 03:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IZngf6Bt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-179764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 440261C22AA7 for ; Wed, 15 May 2024 10:32:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6A765EE67; Wed, 15 May 2024 10:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IZngf6Bt" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFF541F60A; Wed, 15 May 2024 10:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715769143; cv=none; b=mbixqtt916gX7ZtHod4IJ+yyPR5l2DQCiU/+fMvMF0B6Tu6GUN7GqYz5HuGDyfKH83oZ1Qe5WTk72bbfSEf2iZnqy5EgDyj5Zce0Ekd8vzbI5CL0Nz0wxFtDNhH0ap66xvundxw5ag+eqz7uqFoQe5bmeAWT6/iXj+l87CcK1k8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715769143; c=relaxed/simple; bh=CvksV8oPyRrAbbl3lnhzPKbTj7UWISTUgDHLj2QHslY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s80GZkzN0AEuj5C70Lc4a2bniUF9dPFjJW2aNxR9uxKmzU8FUXPdbKQxtd/oHLb3RnAmJ1+zmRvQ7L/Ayh4gB/DwTIBBYysvVcx/32Pr9xvKyciX+rD5ZkD5LynLFTqTkwip6nHCE1NnxuSOqaOqSrke/SESgN2mgtOVsOEkDLk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IZngf6Bt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB446C116B1; Wed, 15 May 2024 10:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715769142; bh=CvksV8oPyRrAbbl3lnhzPKbTj7UWISTUgDHLj2QHslY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IZngf6BtwfOVumLRNhzj4zDdf6JP7oaToc1ml66LC7M+EqXdFbFLRwI0JDfCf44YH rS42jxzI9mAQy0V1Yq++D/kW6pN5iAQCQACoj3kNqssLQPRZ5EqbUVCW9Vz/Cxet1p 5BavErDbxMyeeTzQBirGPAzigEOVj3YrEseKAbr6+efZXXTJw+Z98/n8UEUc1xWT7Y 4a9tPFOSjfZpQyVk8wFy8Ou575nBCw1IZ6I9jIXotCWyYTWDRssqbFU3t0ybDIfLlF THIPxjUiKNTzcYQpM6R90RBO35KDAAyajTfU51c06yMOCDNaxIE5mMNHc7gZGQd5nv N4uWVSk3yVInw== Date: Wed, 15 May 2024 11:32:17 +0100 From: Lee Jones To: Guenter Roeck Cc: "Chatradhi, Naveen Krishna" , Naveen Krishna Chatradhi , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Akshay Gupta , arnd@arndb.de, gregkh@linuxfoundation.org Subject: Re: [PATCH 2/2] sbrmi: Add support for APML protocols Message-ID: <20240515103217.GA6035@google.com> References: <20240502220554.2768611-1-nchatrad@amd.com> <20240502220554.2768611-2-nchatrad@amd.com> <8cf0d519-ae6c-4ed0-899e-899f67479052@amd.com> <488e8eed-e0f0-4055-b43c-5422b6302632@roeck-us.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <488e8eed-e0f0-4055-b43c-5422b6302632@roeck-us.net> On Tue, 14 May 2024, Guenter Roeck wrote: > On 5/14/24 12:15, Chatradhi, Naveen Krishna wrote: > > + @Misc and @MFD maintainers in CC > > > > Hi > > > > On 5/3/2024 3:56 AM, Guenter Roeck wrote: > > > Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. > > > > > > > > > On 5/2/24 15:05, Naveen Krishna Chatradhi wrote: > > > > From: Naveen Krishna Chatradhi > > > > > > > > The present sbrmi module only support reporting power. However, AMD data > > > > center processors support various system management functionality > > > > Out-of-band over Advanced Platform Management Link APML. > > > > > > > > Register a miscdevice, which creates a device /dev/sbrmiX with an IOCTL > > > > interface for the user space to invoke the following protocols. > > > >    - Mailbox read/write (already defined in sbrmi_mailbox_xfer()) > > > >    - CPUID read > > > >    - MCAMSR read > > > > > > > > > > This is not hardware monitoring functionality and would have to reside > > > elsewhere, outside the hwmon subsystem. > > > > I thought as much, please provide your opinion on the following approach. > > > > Background: Present sbrmi under hwmon subsystem is probed as an i2c driver and reports power. > > > > However, APML interface defines few other protocols to support OOB system management functionality. > > > > As adding the core functionality of the APML interface in drivers/hwmon/sbrmi is not the correct approach. > > > > We would like do the following > > > > 1. Move the i2c client probe, misc device registration and rmi_mailbox_xfer() function to a drivers/misc. > > > > 2. Add an MFD device with a cell, which probes the hwmon/sbrmi and continues to report power using the symbols exported by the misc/sbrmi. > > > > afaik mfd API function must not be used outside drivers/mfd. The mfd maintainer > is (or at least used to be) pretty strict on that. The core code of a > multi-function device might better be implemented in drivers/mfd, with > drivers in drivers/misc (for the misc device) and drivers/hwmon/ (for > hwmon functionality). The misc and hwmon drivers could then communicate > with the core using regmap. Yes, please only use the MFD API from drivers/mfd. There are 'offenders' that slipped by me, but in general if you need to create an MFD then it should be located in the MFD subsystem. > drivers/mailbox/ supports mailbox style communication. I don't know if that > would apply to the mailbox functionality implemented here. -- Lee Jones [李琼斯]