From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Williams Subject: Re: [PATCH v2 00/12] gendisk: Generate uevent after attribute available Date: Thu, 30 Jun 2016 18:29:31 -0700 Message-ID: References: <20160630015953.6888-1-famz@redhat.com> <20160630062442.GA19761@infradead.org> <20160630063554.GE23296@ad.usersys.redhat.com> <20160630063839.GA17205@infradead.org> <20160701010113.GB10122@ad.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <20160701010113.GB10122@ad.usersys.redhat.com> Sender: linux-mmc-owner@vger.kernel.org To: Fam Zheng Cc: Christoph Hellwig , Linux Kernel Mailing List , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Jens Axboe , "Ed L. Cashin" , Jiri Kosina , "Michael S. Tsirkin" , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , Shaohua Li , Ulf Hansson , David Woodhouse , Brian Norris , Keith Busch , linuxppc-dev , linux-block@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-raid , "linux-mmc@vger.kernel.org" List-Id: linux-raid.ids On Thu, Jun 30, 2016 at 6:01 PM, Fam Zheng wrote: > On Wed, 06/29 23:38, Christoph Hellwig wrote: >> On Thu, Jun 30, 2016 at 02:35:54PM +0800, Fam Zheng wrote: >> > also more code and less flexible IMO. For example, we need at least two >> > variants, for attribute_group and device_attribute separately, right? >> >> Yes, or maybe just a calling convention that just passes both. > > OK, I can look into that, but I'm not sure about the error handling. Currently > add_disk returns void, do you have any plan on that too? should I change it in > v3 (to at least return the attribute creation failure)? I think we should only support a "groups" interface to device_add_disk() and convert all the drivers that currently do device_create_file() after add_disk() to pass in a group list instead. That way we follow the expectation that the only way to get an attribute for a device to show up before KOBJ_ADD, is to define a group: >From Documentation/driver-model/device.txt: As explained in Documentation/kobject.txt, device attributes must be be created before the KOBJ_ADD uevent is generated. The only way to realize that is by defining an attribute group. Let's defer the return value fixing for now. You can find the pending device_add_disk() patches in the nvdimm patchwork starting with "block: introduce device_add_disk()" https://patchwork.kernel.org/project/linux-nvdimm/list/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 Sender: dan.j.williams@gmail.com In-Reply-To: <20160701010113.GB10122@ad.usersys.redhat.com> References: <20160630015953.6888-1-famz@redhat.com> <20160630062442.GA19761@infradead.org> <20160630063554.GE23296@ad.usersys.redhat.com> <20160630063839.GA17205@infradead.org> <20160701010113.GB10122@ad.usersys.redhat.com> From: Dan Williams Date: Thu, 30 Jun 2016 18:29:31 -0700 Message-ID: Subject: Re: [PATCH v2 00/12] gendisk: Generate uevent after attribute available To: Fam Zheng Cc: Christoph Hellwig , Linux Kernel Mailing List , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Jens Axboe , "Ed L. Cashin" , Jiri Kosina , "Michael S. Tsirkin" , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , Shaohua Li , Ulf Hansson , David Woodhouse , Brian Norris , Keith Busch , linuxppc-dev , linux-block@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-raid , "linux-mmc@vger.kernel.org" , linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Content-Type: text/plain; charset=UTF-8 List-ID: On Thu, Jun 30, 2016 at 6:01 PM, Fam Zheng wrote: > On Wed, 06/29 23:38, Christoph Hellwig wrote: >> On Thu, Jun 30, 2016 at 02:35:54PM +0800, Fam Zheng wrote: >> > also more code and less flexible IMO. For example, we need at least two >> > variants, for attribute_group and device_attribute separately, right? >> >> Yes, or maybe just a calling convention that just passes both. > > OK, I can look into that, but I'm not sure about the error handling. Currently > add_disk returns void, do you have any plan on that too? should I change it in > v3 (to at least return the attribute creation failure)? I think we should only support a "groups" interface to device_add_disk() and convert all the drivers that currently do device_create_file() after add_disk() to pass in a group list instead. That way we follow the expectation that the only way to get an attribute for a device to show up before KOBJ_ADD, is to define a group: >>From Documentation/driver-model/device.txt: As explained in Documentation/kobject.txt, device attributes must be be created before the KOBJ_ADD uevent is generated. The only way to realize that is by defining an attribute group. Let's defer the return value fixing for now. You can find the pending device_add_disk() patches in the nvdimm patchwork starting with "block: introduce device_add_disk()" https://patchwork.kernel.org/project/linux-nvdimm/list/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Williams Subject: Re: [PATCH v2 00/12] gendisk: Generate uevent after attribute available Date: Thu, 30 Jun 2016 18:29:31 -0700 Message-ID: References: <20160630015953.6888-1-famz@redhat.com> <20160630062442.GA19761@infradead.org> <20160630063554.GE23296@ad.usersys.redhat.com> <20160630063839.GA17205@infradead.org> <20160701010113.GB10122@ad.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-qk0-f194.google.com ([209.85.220.194]:33764 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbcGAB3d (ORCPT ); Thu, 30 Jun 2016 21:29:33 -0400 In-Reply-To: <20160701010113.GB10122@ad.usersys.redhat.com> Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Fam Zheng Cc: Christoph Hellwig , Linux Kernel Mailing List , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Jens Axboe , "Ed L. Cashin" , Jiri Kosina , "Michael S. Tsirkin" , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , Shaohua Li , Ulf Hansson , David Woodhouse , Brian Norris , Keith Busch , linuxppc-dev , linux-block@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-raid , "linux-mmc@vger.kernel.org" On Thu, Jun 30, 2016 at 6:01 PM, Fam Zheng wrote: > On Wed, 06/29 23:38, Christoph Hellwig wrote: >> On Thu, Jun 30, 2016 at 02:35:54PM +0800, Fam Zheng wrote: >> > also more code and less flexible IMO. For example, we need at least two >> > variants, for attribute_group and device_attribute separately, right? >> >> Yes, or maybe just a calling convention that just passes both. > > OK, I can look into that, but I'm not sure about the error handling. Currently > add_disk returns void, do you have any plan on that too? should I change it in > v3 (to at least return the attribute creation failure)? I think we should only support a "groups" interface to device_add_disk() and convert all the drivers that currently do device_create_file() after add_disk() to pass in a group list instead. That way we follow the expectation that the only way to get an attribute for a device to show up before KOBJ_ADD, is to define a group: >>From Documentation/driver-model/device.txt: As explained in Documentation/kobject.txt, device attributes must be be created before the KOBJ_ADD uevent is generated. The only way to realize that is by defining an attribute group. Let's defer the return value fixing for now. You can find the pending device_add_disk() patches in the nvdimm patchwork starting with "block: introduce device_add_disk()" https://patchwork.kernel.org/project/linux-nvdimm/list/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: dan.j.williams@intel.com (Dan Williams) Date: Thu, 30 Jun 2016 18:29:31 -0700 Subject: [PATCH v2 00/12] gendisk: Generate uevent after attribute available In-Reply-To: <20160701010113.GB10122@ad.usersys.redhat.com> References: <20160630015953.6888-1-famz@redhat.com> <20160630062442.GA19761@infradead.org> <20160630063554.GE23296@ad.usersys.redhat.com> <20160630063839.GA17205@infradead.org> <20160701010113.GB10122@ad.usersys.redhat.com> Message-ID: On Thu, Jun 30, 2016@6:01 PM, Fam Zheng wrote: > On Wed, 06/29 23:38, Christoph Hellwig wrote: >> On Thu, Jun 30, 2016@02:35:54PM +0800, Fam Zheng wrote: >> > also more code and less flexible IMO. For example, we need at least two >> > variants, for attribute_group and device_attribute separately, right? >> >> Yes, or maybe just a calling convention that just passes both. > > OK, I can look into that, but I'm not sure about the error handling. Currently > add_disk returns void, do you have any plan on that too? should I change it in > v3 (to at least return the attribute creation failure)? I think we should only support a "groups" interface to device_add_disk() and convert all the drivers that currently do device_create_file() after add_disk() to pass in a group list instead. That way we follow the expectation that the only way to get an attribute for a device to show up before KOBJ_ADD, is to define a group: >>From Documentation/driver-model/device.txt: As explained in Documentation/kobject.txt, device attributes must be be created before the KOBJ_ADD uevent is generated. The only way to realize that is by defining an attribute group. Let's defer the return value fixing for now. You can find the pending device_add_disk() patches in the nvdimm patchwork starting with "block: introduce device_add_disk()" https://patchwork.kernel.org/project/linux-nvdimm/list/