Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1389458
| From | Matias Bjørling <mb@lightnvm.io> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH] lightnvm: expose configuration through sysfs |
| Date | 2016-04-27 20:30 +0200 |
| Message-ID | <rsCnM-5TC-17@gated-at.bofh.it> (permalink) |
| References | <rsBBn-53U-1@gated-at.bofh.it> <rsBL4-59n-17@gated-at.bofh.it> <rsBL4-59n-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 04/27/2016 07:41 PM, Greg KH wrote:
> On Wed, Apr 27, 2016 at 10:18:57AM -0700, Simon A. F. Lund wrote:
>> --- a/include/linux/lightnvm.h
>> +++ b/include/linux/lightnvm.h
>> @@ -174,6 +174,7 @@ struct nvm_id_group {
>> u16 cpar;
>>
>> struct nvm_id_lp_tbl lptbl;
>> + struct kobject kobj;
>> };
>>
>> struct nvm_addr_format {
>> @@ -205,6 +206,7 @@ struct nvm_target {
>> struct list_head list;
>> struct nvm_tgt_type *type;
>> struct gendisk *disk;
>> + struct kobject kobj;
>> };
>>
>> struct nvm_tgt_instance {
>> @@ -360,6 +362,8 @@ struct nvm_dev {
>>
>> struct mutex mlock;
>> spinlock_t lock;
>> +
>> + struct kobject kobj;
>> };
>>
>> static inline struct ppa_addr generic_to_dev_addr(struct nvm_dev *dev,
>
> Never use "raw" kobjects in a driver for a device. You just guaranteed
> that userspace tools will not see these devices or attributes, which
> implies you didn't really test this using libudev :(
>
> Please use real devices, attached to the real devices your disks already
> have in the tree.
>
> And are you sure you didn't just mess up your reference counting by
> now having the lifecycle of these structures be dictated by the kobject?
>
> thanks,
>
> greg k-h
>
Hi Greg,
Thanks for the feedback.
lightnvm doesn't have anything to hook up with in the /dev/block/* until
a device is exposed through a target. A device goes into a staging area,
and then later is configured to expose a block device.
In the case of NVMe device driver, the driver brings up a device,
identifies it as a lightnvm device, then calls nvm_register and
registers the device. It skips the registration as a block device.
At the nvm_register point, the user can list the available devices
through an ioctl, and then choose a target to put on top. The target
will then expose it as a block device.
This might not be the ideal way. I like your input on what would be the
proper way to expose such a device.
-Matias
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH] lightnvm: expose configuration through sysfs "Simon A. F. Lund" <slund@cnexlabs.com> - 2016-04-27 19:40 +0200
Re: [RFC PATCH] lightnvm: expose configuration through sysfs Greg KH <gregkh@linuxfoundation.org> - 2016-04-27 19:50 +0200
Re: [RFC PATCH] lightnvm: expose configuration through sysfs Matias Bjørling <mb@lightnvm.io> - 2016-04-27 20:30 +0200
Re: [RFC PATCH] lightnvm: expose configuration through sysfs Greg KH <gregkh@linuxfoundation.org> - 2016-04-27 21:10 +0200
Re: [RFC PATCH] lightnvm: expose configuration through sysfs Matias Bjørling <mb@lightnvm.io> - 2016-04-27 21:30 +0200
[RFC PATCH] lightnvm: expose configuration through sysfs "Simon A. F. Lund" <slund@cnexlabs.com> - 2016-04-27 20:00 +0200
csiph-web