Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp304770rwi; Mon, 31 Oct 2022 01:17:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM59PwflKC4GMHImRxufyAnEcnXGA1qfZeus/7RUZrLQ52GmXc3cg65vHn+PPaW2wh+kR6L9 X-Received: by 2002:a17:90a:540e:b0:210:1e26:9422 with SMTP id z14-20020a17090a540e00b002101e269422mr13187192pjh.100.1667204256069; Mon, 31 Oct 2022 01:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667204256; cv=none; d=google.com; s=arc-20160816; b=ysyL3jxIF0b6mSshjMO4r2qiPugyRQYWVn/cx0E0rnYineFcCdlEhShadTq0+bgCaR kLss520am+iT9aeQj5MJPm0pDvLPe2PC+k/R9TNQTxjMfCH9gJfil/7JJ6Tohv2A7yjE 2xVqJWdczoUNWPy4/BzwTLzp7MK4OxFnMUlAilzJ7f5UWZROvXgwrnqmu7yQeCOcfZ/I v144Di0u/DDmZeoMsJvS1NLMrIon7cCdJNJhhT4tLfwgq0MbTwJMreXbi7aYkV+chx+I HemwIiFPG+qyVIVQdQShstSCMPU2spMPpo3UqgIHSqsm42BLzykd8S9NiwYHoTQfZPzt 8i8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=N1A+zJBwGXUn71hzGurp01r3N7NH1f1YoqdNP91xZvY=; b=U1vwqJyDrS+BrRhszREHhGV57J5AFl2gsctYcNL4MGw+DjQk64vU2wyaBxDREAo6+n k0PZyp0c/2qcMoEMr/slLZ03ZuVZ5IFaTi0RTH8xO5/OnsfDIXPMK9w/hZVX6QWRISDe 10q+m8wOyonSFbYJDVHwH3siPQgDyarOQ6BwT2gLt8SN9x4s0s4ohUROtpHvhdrLwymT MXERpGnT23RjKPhe3Sw/6+laUpNrxqG9QQtU0F5iOBk4DpxoiIKrSjpuAK3uWDEZsuaz jgDwZvrSJDIIL/2hGrKorFwUYvDPR2dP/rB2H5tUMb4ammh+OxbGxij0/OR3Zek67vb7 0J3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r19-20020a63d913000000b00439befcf830si8871016pgg.854.2022.10.31.01.17.23; Mon, 31 Oct 2022 01:17:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbiJaHtn (ORCPT + 99 others); Mon, 31 Oct 2022 03:49:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiJaHtl (ORCPT ); Mon, 31 Oct 2022 03:49:41 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99596764F; Mon, 31 Oct 2022 00:49:40 -0700 (PDT) Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4N14wl1JlLzJnMG; Mon, 31 Oct 2022 15:46:47 +0800 (CST) Received: from [10.174.176.82] (10.174.176.82) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 31 Oct 2022 15:49:38 +0800 Message-ID: Date: Mon, 31 Oct 2022 15:49:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.1 Subject: Re: [PATCH RFC] ACPI: container: Add power domain control methods To: "Rafael J. Wysocki" CC: , , , , , , References: <20221025061437.17571-1-zhangzekun11@huawei.com> From: "zhangzekun (A)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.82] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Rafael J This patch wants to put some generic control logic in container, and these logic can cover a batch of scenarios similar to ours. ACPI power resources interface is not confilct with this patch and can be used inside the container for more complicated scenarios. In our secenaio, we need to control the power of some HBM memory device, each of it will be configured as a PNP0C80, HBM devices in one socket are in the same power domain and need to power on/off together. Every HBM memory device represent a numa node and have no cpu on it. The topology in one socket can be simplifed and represented as         +---------+         |  node0  |         |  CPUs   |         |  DRAM   |         +---------+              |       +------+-------+       |              |  +---------+    +---------+  |  node1  |    |  node2  |  |  no-cpu |    |  no-cpu |  |  HBM    |    |  HBM    |  +---------+    +---------+ To use ACPI power domain management interface, we need to develop a specialized driver to maintain the relationship between socket id and numa nodes to tell the userspace which socket does this numa node belong to. Note that the numa node in the same socket will be power on/off together. Socket id of a memory device can be reported by BIOS via DSDT or other ACPI tables, but we can just skip this step by put all of the devices belongs to the same socket in a container. And, we can call each child devices' "_PXM" function to expose numa nodes of HBM devices to userspace. Besides, To power off the devices we need first to offline these ACPI devices, and then call the ACPI function "_EJ0" to finally remove it. This are also generic logic that can be used to remove ejectable devices. what we really need is a place to support these generic control logic, rather than the interfaces to implement our requirements. Best Regards, Zekun, Zhang 在 2022/10/29 1:07, Rafael J. Wysocki 写道: > On Tue, Oct 25, 2022 at 8:17 AM Zhang Zekun wrote: >> Platform devices which supports power control are often required to be >> power off/on together with the devices in the same power domain. However, >> there isn't a generic driver that support the power control logic of >> these devices. > Not true. > > There is the ACPI power resources interface designed to represent > power domains that is well supported and used in the industry. > > If it doesn't work for you, explain why. >