Received: by 10.213.65.68 with SMTP id h4csp142678imn; Mon, 19 Mar 2018 22:54:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELv3Zj2YsluvJT4CffQ1DtTFLorLSuIwxadKtuKPO7Mx9bgFjWtby3rRsz3ztT07ngFwEtv0 X-Received: by 2002:a17:902:5716:: with SMTP id k22-v6mr15110241pli.229.1521525254938; Mon, 19 Mar 2018 22:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521525254; cv=none; d=google.com; s=arc-20160816; b=tR9WWVub9PM9MCo+VaswooQzbmVn0ZQBNsKQ63l7ShKixHtW3b1a5IMeZgw1VPpJt7 aq05ohYJMIaql/f5BCQbZyTXHY4m5eWQFeCa9O3F9YNQjlwIl7Cpr1OnV59UfZymZK12 7aTiG59WGA/55PT+n4TN4B1xLKr3q3a/jMTfuEK1JM3BTZkU03+LjFHyp2tu8u2CplB5 ejtPjuv4NitdF39oqOru/ErM7XHjfN6XNux9OO7w4FgdhhaN45nN+AKvTjCvpyRt2Shj GM6UxQgz38G/Or4Fnwk+ul99BWnzFfSCbmTLjYuFAacO0GcpTV0G7w0YkGPQh7Qricn4 2NPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Jc4ZfK08gKEdvDuS6dIagXpTCnQQJqvpIATks+UQENg=; b=Q1EpcsRvHEsexca8tRAvHNIelSgwIJMAiKAElYBWt1ER4uwYmSL/WK97Xdn/9LToGx bw4KaYbsWAWPb+GPlWuoH3l7A0aRL4o9pvWhT91EDWx8Dz/J9HPoRhYw9aTQb6KkeDDT iEWUVHtSn2U6zIsIfZ6HAmDMTrBRkGtHmp0XCCh2vMgZt2CE+s//OejaQWvcO31qxPkd 0TRWwRZeKJjLfLIxW3FNtZJAzQf4N7xyqFMD4Jn+kI5mSADs3oPpNdTuKAOaZyCqhQ7f zlNjiwc4nL4fvM7CNtbkOekErBcTajDrqw9uexky2ySFtsVPv8maNNcqbgOC8NjWrAdI wrTg== 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 m10si715728pgs.236.2018.03.19.22.54.00; Mon, 19 Mar 2018 22:54:14 -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 S1751481AbeCTFxH (ORCPT + 99 others); Tue, 20 Mar 2018 01:53:07 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:50053 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbeCTFxG (ORCPT ); Tue, 20 Mar 2018 01:53:06 -0400 Received: from linux-l9pv.suse (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Tue, 20 Mar 2018 06:53:02 +0100 Date: Tue, 20 Mar 2018 13:52:54 +0800 From: joeyli To: "Rafael J. Wysocki" Cc: "Lee, Chun-Yi" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Hocko , Len Brown Subject: Re: [PATCH] ACPI / scan: Send the change uevent with offine environmental data Message-ID: <20180320055254.GJ15088@linux-l9pv.suse> References: <20180302063508.15818-1-jlee@suse.com> <12390857.1FYhrZHzGj@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12390857.1FYhrZHzGj@aspire.rjw.lan> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, On Mon, Mar 19, 2018 at 11:02:32AM +0100, Rafael J. Wysocki wrote: > 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. > I just sent the v2 patch. Thanks for your review! Joey Lee