lkml.org 
[lkml]   [2017]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH linux] drivers/fsi: Add SBEFIFO FSI client device driver
From
Date


On 06/15/2017 5:24 AM, gregkh@linuxfoundation.org
<https://patchwork.kernel.org/project/LKML/list/?submitter=37061> wrote:
> On Wed, Jun 14, 2017 at 02:47:27PM -0500, Edward A. James wrote:
>> +struct sbefifo {
>> + struct timer_list poll_timer;
>> + struct fsi_device *fsi_dev;
>> + struct miscdevice mdev;
>> + wait_queue_head_t wait;
>> + struct list_head link;
>> + struct list_head xfrs;
>> + struct kref kref;
>> + spinlock_t lock;
>> + char name[32];
>> + int idx;
>> + int rc;
>> +};
>
> You have a misc device, a pointer to a fsi_device, and a kref in this
> structure. Which one actually does the reference counting? It seems
> there are 3 different ways it could happen. That's not right at all,
> and ripe for lots and lots of confusion. Only use one please.

Thanks for the comments, the problem here is that there is no way to
init the miscdevice device kobject with a kobj_type. So we'd have to
just do raw kref get/put there so we can get our release function. Does
any other linux driver use miscdevice for reference counting? I couldn't
find anything. It seems cleaner to me to have our own kref. The fsi_dev
is really a parent device, so we shouldn't use that for reference counting.

What do you think? I can add comments to make things clearer?

Thanks,
Eddie

>
> thanks,
>
> greg k-h
>

\
 
 \ /
  Last update: 2017-06-20 18:35    [W:0.177 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site