From patchwork Thu Nov 7 06:02:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 842134 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) (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 99C8B1DD0CD; Thu, 7 Nov 2024 06:03:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730959436; cv=fail; b=CjzorEdpzb5e8JG/Ayctd8S1lzoG/BP+UA6jUbYE16lvMeH5rOs8TQMT5Q4c5CppUTOOJlgXXtTgX97ujkWPA1Kk8ftjIIxFbl0naqxnHVGqOq8tGMdXnEhqmBnJCE3wTuT/jpLN8g2zY84d06aJVnwLTnvwr8aKQNDWzjzT1qo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730959436; c=relaxed/simple; bh=ygdLyhxsL1E6CrOOFkf3Wil/fb1df9UANwK8eafvuvY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Et5QoEMX5xj5Cu2essp4MKAlx5GzjE/Am6L7q5vCxshzRSZgjuxpOsaa4XPQqiGA4FBDGYFn584Pd2sCnI9SuuTZ1oJIzQuPC/cMKNpwcx/OgXETATMiLMev4DPwSZ6HX3sOImOSsrv7Tw5S32XzWxolRKX2uuazid7+eoVQhD4= 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=DTzrAPBZ; arc=fail smtp.client-ip=40.107.223.76 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="DTzrAPBZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KXL1gWWOVhTnceKCf+EzUDom2145JrWiXq3dabjVFi0zdREDhXk0qrSzrXWXF/qYGKni3Ggh+Zupt9RVuEjAspLFVxLpxD0xy0iCy4vX49cG0nW9qOTe016ElC7hhB8HWjG8xerfoqeFwV4UAqL9USsOEEtT684ur3qI3ngoOrXN9rNy/an4oFaB6pp87Aq6TcsxLMu/DjN7fBMlsVt3XGwsCUiZ/2VjjF78udnA9o5iNi/gqVbdX+G9IXtvVr5HR+nwK4cQfuL+RTVB1ebpJ5Zibee0qoIvsF1I1Tg2zkiM2hkHlwoljSQwam9qDsI8lVGcXH1FK3sYOl1AoNRTIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=pnoVOYlNJzRgfMoBu5KuIPp1sDfmHYMmm89hNzr+CpM=; b=fe8f55Ib2pPr6wKONaaujDp2k/clK7UU/44krhJdBoaIheZa2MJ0KvARjjLHDfMxuc7AG3R52KY/twfpz1cXD+z4nS2U6K81NYM/ay1kHVMIiCOz1xaFVgpx+K/F/vNhS6PVjbyTq3MoiEMMLKJSK3hp2mmfdvIJxRbsrWdnkqA+oGlBCs4lpbU4ItvLqb212VIV8PTdcnaSqtvEmufjNcFertWupXlXzNBKiFFfGjXtxtpa0mmxDJRa/uZu1Bn/8z7ULwlLV92zRGEfbXNaco0Psevbbz2dnCVbt73F8a/aRQbQV/qqYpj3PZ0SrUtXoV2aCWSl9HdJv0TTJQ24eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=pnoVOYlNJzRgfMoBu5KuIPp1sDfmHYMmm89hNzr+CpM=; b=DTzrAPBZ+ULPzxDBxZsYnbrXJ4qgNW/VTuQm/mVhI1PShL+grkFwce1Zuy0sDrYkCKvF2ozvza20MYOFsUUXXuAcotQnSGTJo2LGDC+tZiaDnNckqI5nd9YKw18BjYIAABf9nOY94CRWHTcCAfvWKJ7tVfH+yWVZbOOnuEDtqOw= Received: from CH5P221CA0011.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1f2::21) by MW3PR12MB4428.namprd12.prod.outlook.com (2603:10b6:303:57::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 06:03:49 +0000 Received: from CH2PEPF00000143.namprd02.prod.outlook.com (2603:10b6:610:1f2:cafe::4f) by CH5P221CA0011.outlook.office365.com (2603:10b6:610:1f2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19 via Frontend Transport; Thu, 7 Nov 2024 06:03:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CH2PEPF00000143.mail.protection.outlook.com (10.167.244.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 06:03:49 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 7 Nov 2024 00:03:46 -0600 From: Mario Limonciello To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= CC: "Rafael J . Wysocki" , Len Brown , Maximilian Luz , Lee Chun-Yi , "Shyam Sundar S K" , Corentin Chary , "Luke D . Jones" , Ike Panhc , Henrique de Moraes Holschuh , "Alexis Belmonte" , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Ai Chao , Gergo Koteles , open list , "open list:ACPI" , "open list:MICROSOFT SURFACE PLATFORM PROFILE DRIVER" , "open list:THINKPAD ACPI EXTRAS DRIVER" , Mark Pearson , Matthew Schwartz , Mario Limonciello Subject: [PATCH v5 13/20] ACPI: platform_profile: Notify change events on register and unregister Date: Thu, 7 Nov 2024 00:02:47 -0600 Message-ID: <20241107060254.17615-14-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107060254.17615-1-mario.limonciello@amd.com> References: <20241107060254.17615-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000143:EE_|MW3PR12MB4428:EE_ X-MS-Office365-Filtering-Correlation-Id: 5fbc2ddb-161e-441b-2df4-08dcfef1f2b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|7416014|376014|82310400026; X-Microsoft-Antispam-Message-Info: +sp6/TA46r8xwq6cFouHZxXimImlWxYlIUWC7WFkVcKa9F5y13h1/kUVg1suI/cQ3m9KsYS/4VnjRh8MrBgcpXMNjW/ZQvL3BVd4CSPP/suzvA8WgP4DjNtSCYtk43lg3L7K5vL3PPDEj7kuDpYvnvvyhrxIK9rFFhblmQKLEokAIjEn9Dl8w3GcfmDvxwEJiuV9osWL88yLllzoAjlBl1oKmaVmqCZ+AGdiFo2nfnLZ8PrXich3Yv+kVS9e0Jwph9Pdndu05xgKAg+HFq5WOWPuQ18y4lXQ4+UZFQhmFCinkap4AhM3gCtZ+jpB0VBfW5UQEBAfoaP2k35LnjDwHPb0oqUOuKpp7rt+7KcwvAOPVQSv0iIKh/urvphL8H1xVX6oaT44Efr2rahcBQmkHTgsCv34791RLXeKpdQXblKKq7kwiy5Sk0cWyube9cloKXBYZciJMP38pZ/SAmjC5MAJGuKVBJAyau9mMQMDp5s1JJwcnEIsq7nyJemQOpVZa8x1Ha4J1PR4wHUNFIJ2g7Ahr88DqonUEzxioP7tiwBJLEctfaBf3YbBHuE4VgCH057otCSuhVSAd+HpZrUdyAPMfY2DX4nzK4VrxntDSx0bYMcecIGQ6CRdHk+dpuX3z9SDBtI28p2X9xRaoIdEmb7y9TDkQ09nC/FKhBjDyiXowmzKJX/dUCVsQdAwcZpbkGPghioLDkVLUJe5k3j8RfKPN5nfIY5hm17Ka7mpb3CbzP5NDu/SR5wlqqSriML1XkuE+95NqLB15o0stDTjghpWDak+tIWI152Nf0esPivRvPV3pMe58hTWUO26ZXMky7aK1m8+n41IH3/7bZb41aPHdTbchP9VbcxdZMzGXtnVau8KbikLrwq31bIHEP2A3oCMgIoHcjMzPJTNnS9rV41Hn02VCiAm0AYbkp7TuYl74v4ofjwm4MqGi+7CZHAHAIlxp//3Ahm0y0lQMmV8QOIR1He3JOzJsvr6+PllSo8ctF/a1dSLNI/6Ecx3fbH3eCxa/pCfd8zw7uruv8/PZ4glJcU7Pb0BRuUlRuL/kiEBkIHfk7zgQNx3kjQiYl7m9XnlZkZwUpETRSBMUuQiSLbEI9KxsuvRkXX165LEibF7yfpQbCk5Ch1v9hwBTcEwfpaaXVzB6WaQo1ssZ0xEoFEAXUEuhMRiHUa5UBPhEKTW0meo6B8JmxkOPS2wU7J+2A5ES54sMt5Bd7jxaYyM6OvMS+blqEdZlnVzJksms0PBhY4cpO5Z47dEINTMEfd1lQMZB5zVbNYLZecSVVWuetvzGT8CDgrDKgohxHJzzPghx997HqE5IRnyur95vVzUdKZieYqE8LLMJ9mFENffYhZnhC40K8NQpyClgGjgWjZuHbl0rQGozMpIzhKrpQwlvVH5cSm0DPXte2/IPt6Jmw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(7416014)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 06:03:49.0360 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fbc2ddb-161e-441b-2df4-08dcfef1f2b4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF00000143.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4428 As multiple platform profile handlers may come and go, send a notification to userspace each time that a platform profile handler is registered or unregistered. Tested-by: Mark Pearson Tested-by: Matthew Schwartz Reviewed-by: Mark Pearson Signed-off-by: Mario Limonciello --- drivers/acpi/platform_profile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c index 35e0e8f666072..510e1435d3980 100644 --- a/drivers/acpi/platform_profile.c +++ b/drivers/acpi/platform_profile.c @@ -399,6 +399,8 @@ int platform_profile_register(struct platform_profile_handler *pprof) } dev_set_drvdata(pprof->class_dev, pprof); + sysfs_notify(acpi_kobj, NULL, "platform_profile"); + cur_profile = pprof; return 0; @@ -421,6 +423,8 @@ int platform_profile_remove(struct platform_profile_handler *pprof) device_unregister(pprof->class_dev); ida_free(&platform_profile_ida, id); + sysfs_notify(acpi_kobj, NULL, "platform_profile"); + cur_profile = NULL; return 0; }