Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757251Ab2HGDeV (ORCPT ); Mon, 6 Aug 2012 23:34:21 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:44542 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757224Ab2HGDeT (ORCPT ); Mon, 6 Aug 2012 23:34:19 -0400 Date: Mon, 6 Aug 2012 20:34:13 -0700 From: Greg KH To: Bryan Wu Cc: Colin Cross , linux-kernel@vger.kernel.org, Henrique de Moraes Holschuh , Richard Purdie , linux-leds@vger.kernel.org Subject: Re: [PATCH] leds: triggers: send uevent when changing triggers Message-ID: <20120807033413.GA2261@kroah.com> References: <1343176370-5856-1-git-send-email-ccross@android.com> <20120726035958.GB7235@kroah.com> <20120726165112.GA23857@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1980 Lines: 50 On Tue, Aug 07, 2012 at 10:57:29AM +0800, Bryan Wu wrote: > On Wed, Aug 1, 2012 at 2:28 AM, Colin Cross wrote: > > 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? > > Greg, Richard and Henrique, can I take you guys' Ack here? Ack for what specific patch are you referring to? greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/