From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756106Ab2GaS2q (ORCPT ); Tue, 31 Jul 2012 14:28:46 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:60717 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753444Ab2GaS2m (ORCPT ); Tue, 31 Jul 2012 14:28:42 -0400 MIME-Version: 1.0 In-Reply-To: References: <1343176370-5856-1-git-send-email-ccross@android.com> <20120726035958.GB7235@kroah.com> <20120726165112.GA23857@kroah.com> Date: Tue, 31 Jul 2012 11:28:40 -0700 X-Google-Sender-Auth: A5Kjg00BU3Cy2z1X__ZAP4zSw7o Message-ID: Subject: Re: [PATCH] leds: triggers: send uevent when changing triggers From: Colin Cross To: Bryan Wu Cc: Greg KH , linux-kernel@vger.kernel.org, Henrique de Moraes Holschuh , Richard Purdie , linux-leds@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2012 at 9:04 PM, Bryan Wu wrote: > On Fri, Jul 27, 2012 at 12:51 AM, Greg KH wrote: >> On Thu, Jul 26, 2012 at 01:03:11PM +0800, Bryan Wu wrote: >>> Just one quick patch for my idea: emitting a uevent in sysfs_create_file(). >>> >>> -- >>> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c >>> index 00012e3..04da869 100644 >>> --- a/fs/sysfs/file.c >>> +++ b/fs/sysfs/file.c >>> @@ -570,10 +570,14 @@ int sysfs_add_file(struct sysfs_dirent *dir_sd, >>> const struct attribute *attr, >>> >>> int sysfs_create_file(struct kobject * kobj, const struct attribute * attr) >>> { >>> + int err = 0; >>> + >>> BUG_ON(!kobj || !kobj->sd || !attr); >>> >>> - return sysfs_add_file(kobj->sd, attr, SYSFS_KOBJ_ATTR); >>> + err = sysfs_add_file(kobj->sd, attr, SYSFS_KOBJ_ATTR); >>> + kobject_uevent(kobj, KOBJ_CHANGE); >> >> That's a veritable flood of change events when a new kobject is created, >> right? It also created uevents for a device that has not told userspace >> that it is even present, which could cause massive confusion, don't you >> think? >> > > Indeed, this is unacceptable. I reworked a new patchset and just sent > our for you review. > > Thanks, > -Bryan Given the rejection of the other solutions to this problem, and chance of getting this acked?