Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2886291lqo; Tue, 14 May 2024 12:15:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWY/XdKd9MtB8XGpx2px0zcj/uxLctW1iXrOWd1bFOyvlHbfpYd40WYzPehbDQtwwf1waUWuLQcHwHP9pgGgUWdtj066nJl/1nK0of82Q== X-Google-Smtp-Source: AGHT+IGDSFFZYGJdzYNkciJd4RLHql0WtCMVKbLkjl/ecKrBVI8DjhRPKWekTltT4+VNKIB74Mya X-Received: by 2002:a05:6a20:2447:b0:1aa:5ca9:c565 with SMTP id adf61e73a8af0-1afde0a8dc5mr15897848637.8.1715714141258; Tue, 14 May 2024 12:15:41 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412a4dd67si11535902a12.661.2024.05.14.12.15.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 12:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179095-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=zyaSaTxF; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-179095-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179095-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D5C7F283848 for ; Tue, 14 May 2024 19:15:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD14E181312; Tue, 14 May 2024 19:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="zyaSaTxF" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2072.outbound.protection.outlook.com [40.107.223.72]) (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 1DC1C180A9A; Tue, 14 May 2024 19:15:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.72 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715714133; cv=fail; b=nlRSGTMipGavt2glY2NO8WSN6b+DBaN+Trkof+fBXTdfeorn0oy7ORzw8+hIOWvYIxD1sOVzw7rD4+/1uud1TiWpvXGzdIrKsdKVqomDr2LhL+Cifjio2gqxeMHOk54AnTN0ZqJUjl0gk0r9cYHpHVrmdMqZp5RknvdjDrY3tNQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715714133; c=relaxed/simple; bh=WUdOzAzB2vviTxLJInHWcv05T78yzIUEyMk4QPlGE40=; h=Message-ID:Date:From:Subject:To:Cc:References:In-Reply-To: Content-Type:MIME-Version; b=CxIaS3WMZP2ORD5+vH46A1Zgw31hDxLBrxYsgZIdpXtBkSC66/saCz0zKBb8VvesY5xhyT9C5XAJkL2yaTCZDeK7+g1S0rlhBLzP6ufuxzNZc4x+n7ZfFnQ+VQJGSxFqhRye7QgHe1akDoFt40JIeWxBjY1pkO6meHli5M0+Gk0= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=zyaSaTxF; arc=fail smtp.client-ip=40.107.223.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c3aMzY98+OVZzfcgav1lw6vmsXMBo7WYB1CBAGjnkQ2k0qofoQmZtQjqCLBx9W1VTFhJrc8J6FFCLia2rMR0702U3ATXa2pbEEkCe7EuSSl8LjWdZNCW8p693FC3JpF8RJLQNmcokKFtkjFj1+KL7gwNCnxKqpvpQiFJust06HYWL4uUiCWX4GkPNePJ8gJE8jIh80KS/l7AuNQ5HAACnq3sGPQEWddvvdgWl7c9VGfH5xKvZAu/BUMSnmvdCN3oiz6y0Rc/p8pyCH1h9OSzvvnIk2kOQnk9ENkC1sWOOsqrgP1xQ9OPGDH1ziDrQ38G/oVxnL7pA7+JZWDFGRUHDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GRUWybpvRPOh43U6T5h4pk5A+1qOE9YhE43DQTodQQw=; b=RiacPEApNNZz0k2/FvSIsnIehJYB8MmcNyw5tXodT00vMIMiQa2ZeAapQ/pT20Hz0SKmDfvqeIXIOeJi84wICDUN2DqhGGZkWXB5+YHKxaNg7Qp2ghun8dNqrdc4BOoL+pyq6M2wKvBqwLgj46vo93ZpCAgdyRt3SRuFswjkPsQnsTSRMwJydSZ0QQVqEuYIUdyULAPDUHu/EsbhG5KhDoCzbrsCNYAzeXoGOsBtjSUaudb3Wtl1bXVs1vCszeEl82F4pEEg/6GIw/6tcDTwii1Y08aQpcUZJUzChqRPw3A7yfAj+aOjcsqCwNkOG2oqeAAe0/fYTMf4tyFogFzaiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GRUWybpvRPOh43U6T5h4pk5A+1qOE9YhE43DQTodQQw=; b=zyaSaTxFz30Y2IHan4yubHaJzBS5zQNKI83RH45jd6NvnHbhz6qzBde9G/GFd8QGzbreglhgpivOKGFAPstY2gQBp/QdbNKfghrflcRsrzPMbi1zxLaT6o6TM+EKESH/OAVqywiIZhemo2ADkrkrJW9smV/QQrWYqfPwGrZb220= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5286.namprd12.prod.outlook.com (2603:10b6:208:31d::6) by MW4PR12MB7262.namprd12.prod.outlook.com (2603:10b6:303:228::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Tue, 14 May 2024 19:15:28 +0000 Received: from BL1PR12MB5286.namprd12.prod.outlook.com ([fe80::295:5055:c88b:cddd]) by BL1PR12MB5286.namprd12.prod.outlook.com ([fe80::295:5055:c88b:cddd%5]) with mapi id 15.20.7587.025; Tue, 14 May 2024 19:15:27 +0000 Message-ID: <8cf0d519-ae6c-4ed0-899e-899f67479052@amd.com> Date: Wed, 15 May 2024 00:45:19 +0530 User-Agent: Mozilla Thunderbird From: "Chatradhi, Naveen Krishna" Subject: Re: [PATCH 2/2] sbrmi: Add support for APML protocols To: Guenter Roeck , Naveen Krishna Chatradhi , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Akshay Gupta , arnd@arndb.de, lee@kernel.org, gregkh@linuxfoundation.org References: <20240502220554.2768611-1-nchatrad@amd.com> <20240502220554.2768611-2-nchatrad@amd.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0148.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:c8::10) To BL1PR12MB5286.namprd12.prod.outlook.com (2603:10b6:208:31d::6) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5286:EE_|MW4PR12MB7262:EE_ X-MS-Office365-Filtering-Correlation-Id: 04b9883e-3937-4e60-2688-08dc744a36ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?SnExMHpxUUZxcFdrYm5aOTUxZU1tZUFnYUJMYnBwdnlIbzk5ZExkT0QvVnFr?= =?utf-8?B?K05BMmttN1dQODNGdHNERGNRL1hod2tqbWpBSzRoMFBvNHZuYjllLzE3OXBp?= =?utf-8?B?N2pKOHM3dEkweUE3NjhFRWRjQXExS2dDRUpKY0c3Q2UrSjl0UVRCWU1PeDhi?= =?utf-8?B?dkVvZ3hJaE9WQnMxT3FpakxHeGQwMWwybUZEQnpHRnY1YVBJSyt6UFV4Y08y?= =?utf-8?B?KzRMVEREdE4yZWY3MXBONXE5YVJJd1NFdnNNQXUzSnQvanNqc2pWaktad2dY?= =?utf-8?B?ZXk3VGFjcm1nRXp6TmNaYU4rVnVtbUR1aW1LOTErZ3h4NzNuYWU1aWRrcW5Q?= =?utf-8?B?OFZzOUhIQXVwSjQvM1kwNTJ2U2l1RG1hM3V2MUtVbXplcGJCRlVxYzBYMldG?= =?utf-8?B?d1JCbUUzY1FmdkZUVFJIVDNhaFVrdk4vQWlQdCtKckJPM0xtV2tKNkVBTUww?= =?utf-8?B?N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8?B?eHhBeGNGc05wOFdRVGVZbW1JRncyWjVUY3FQS3VMWUtXTy92bTVnTkhobWpn?= =?utf-8?B?WmlEUVNPcGxBK1d1ZU9mYXA1bHJVdWw2Wk1mR1l3WG5XS0tFaTNmU2RmM2hQ?= =?utf-8?B?MTZ5dzFkVlo4WEl2QUhuTzBjVlBWU1ZaRVZCQ3hOQjMzdlFEZk1yLytUUmVx?= =?utf-8?B?YWRkcVhWdWduN3JqNDVoR05Ec05NNjJ0OTBHdGpFQ0NzZFprYVNRSHExbVIw?= =?utf-8?Q?JTclhNyB2Hj89S7fQiKaBR0oWsXgFfYuEEScoztHAMpY=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5286.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S3dkK2tUZUZOUE5FK25lWDJjNkdvM2NNZ0RoRHBXaE9kcStYSFJ6cndWZHlo?= =?utf-8?B?bW91SmxiOVBKUit6a3hVRzc1QVhiZ21jSVc2WWc0MDdrVUJqaXZWZERhWGs1?= =?utf-8?B?SWswZTRVb3VWZ3hCNm40SzdKQU02UlFZQUUvYmVxNmFjQlJRMDI4S1RyR0JR?= =?utf-8?B?MGR5bmhhNVpWT2hMeXEvVzlOd2JDK2IyNzlWRVlJRUxoaVVLbHFUZGR0bHpZ?= =?utf-8?B?dStIQzVOOU9pb2I0QkxmbkxjaHNxWkROQ3pWTDV5V1BYL04wTVpWNHhaWkdv?= =?utf-8?B?aWoyYVEzZVhkN1pDMkk0WlpodTVFMHhSNjEzZ2FYOCs3WXJjQ2JiYW1sNXhO?= =?utf-8?B?SmIyMUVscEhxa3RyaFlmb0pINTUzY2JIUi9BcTRrTG4rRXBqdVhsUkVpVjdn?=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dc744a36ce X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5286.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2024 19:15:27.8670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pBA6YFxOqJV4GUwaToD1pAcQAZnN5/iW3RzNb4yFLUdcBnKT5v9WPLXbNaCpQVFtFsZRE1Wlw2rgtVdsDrHkSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7262 + @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. 3. Define an ioctl for user-space to access other system management functionality.    a. The open-sourced https://github.com/amd/esmi_oob_library will continue to provide user space programmable API Regards, naveenk > > Guenter >