Received: by 10.213.65.68 with SMTP id h4csp1397161imn; Mon, 19 Mar 2018 03:04:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELtohIGw1np6eXxtdvGiv/C9XMPnIvI9E2Rj6r8aUf2qMIzeKnFEheb4L9CP6Lau8lbcum/M X-Received: by 10.98.12.140 with SMTP id 12mr3551905pfm.123.1521453886762; Mon, 19 Mar 2018 03:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521453886; cv=none; d=google.com; s=arc-20160816; b=xdpYCR9lHaXPJp3KNicsNF3UKBTkcNGo1co70lZ8OhLWIC41mqkoRFpQECXEfJ5ViQ QlmJ9Y8FR4glkJPM4UNx0tc5IGFuAF0gmUxM1pAKjXqV5cvRvq/T/kYJz3iefN8y7sA0 N9JTVPEFgae5bl3M3CT/KrErtIGdLKjLp3W1uVKDCe+bZ2hHht7Tb8kafMj/TqkUMV4S x0Z3q0DCwbm54LXSEa4GaWIDABJj5BTnQBZgSYWDFdEIfo+4aQ2nW5CrqRJT0IMsPoL+ yfaV/5uggJgBNbRa5h9sKhvKzegTfqEb0PjA2JQ2rgBy2t+gWKDkTjTARHM27yeR4RLK 16pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3DAnXf8TVYhgLFjbbFxv+3RGlwVsM7IUlg1O/S8TZMU=; b=A/uRoFqMschS3ARiiCYA2/WB+Wf6+FPlj6QSbNdAyjZPYEJkDO9bFWm23v49mqwN/5 8zFvhYYbKEU9e/jjKH1LKwXjwJN0bwWfwdyA8TgfCbkGAdAbn3Ry9YsA0mAlclY+zFE0 L9Xzjlta0TrLdUWMiS0ovHkka+yUNwtMOwjGY9K2NXHHtf9+UuWIPcDPowpWwGh4r2O9 vfvhrJn2lAu5gAIEsu5HnseydQQey/5BdVgUHAcn/xhcz2T8Y9KoOXa2cvzBt/d8beIL 8cc1xWr22rfmOtIVTq7jqxx9PVtduXG9Gx6phkUgbp3Q6d57F8EtgaT5x9iMd6tkkQIK sprA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be9-v6si8055984plb.201.2018.03.19.03.04.32; Mon, 19 Mar 2018 03:04:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755392AbeCSKCE (ORCPT + 99 others); Mon, 19 Mar 2018 06:02:04 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:53851 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751747AbeCSKCD (ORCPT ); Mon, 19 Mar 2018 06:02:03 -0400 Received: from 79.184.254.228.ipv4.supernova.orange.pl (79.184.254.228) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id cd40945f2d5ebe8e; Mon, 19 Mar 2018 11:02:01 +0100 From: "Rafael J. Wysocki" To: "Lee, Chun-Yi" Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, "Lee, Chun-Yi" , Michal Hocko , Len Brown Subject: Re: [PATCH] ACPI / scan: Send the change uevent with offine environmental data Date: Mon, 19 Mar 2018 11:02:32 +0100 Message-ID: <12390857.1FYhrZHzGj@aspire.rjw.lan> In-Reply-To: <20180302063508.15818-1-jlee@suse.com> References: <20180302063508.15818-1-jlee@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, March 2, 2018 7:35:08 AM CET Lee, Chun-Yi wrote: > In current design of ACPI container offline, Kernel emits > KOBJ_CHANGE uevent to user space to indidate that the ejection of > the container was triggered by platform. (caa73ea15 patch) > > A pure KOBJ_CHANGE uevent is not enough for user space to identify > the purpose. For example, a "udevadm trigger" command can also > be used to emit change event to all udev rules. A udev rule can not > identify that the event is from kernel for offline or from udevadm > for other purpose. Then the offline action in udev rule may also be > triggered by udevadm tool. > > So, similar to the change uevent of dock, kernel sends the > KOBJ_CHANGE uevent with a offline environmental data to indicate > purpose. It's useful by udev rule for using ENV{EVENT} filter. > > Cc: Michal Hocko > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Signed-off-by: "Lee, Chun-Yi" > --- > drivers/acpi/scan.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c > index 8e63d93..f6dca9b 100644 > --- a/drivers/acpi/scan.c > +++ b/drivers/acpi/scan.c > @@ -116,6 +116,7 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent) > { > struct acpi_device_physical_node *pn; > bool offline = true; > + static const char *envp[] = { "EVENT=offline", NULL }; > > /* > * acpi_container_offline() calls this for all of the container's > @@ -126,7 +127,7 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent) > list_for_each_entry(pn, &adev->physical_node_list, node) > if (device_supports_offline(pn->dev) && !pn->dev->offline) { > if (uevent) > - kobject_uevent(&pn->dev->kobj, KOBJ_CHANGE); > + kobject_uevent_env(&pn->dev->kobj, KOBJ_CHANGE, envp); > > offline = false; > break; > This causes build issues when applied, please fix. Thanks!