[<prev] [next>] [day] [month] [year] [list]
Message-Id: <930fe55f-bdf1-a2b7-a96b-d9077a3fc302@linux.vnet.ibm.com>
Date: Tue, 20 Jun 2017 11:34:41 -0500
From: Eddie James <eajames@...ux.vnet.ibm.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Brad Bishop <bradleyb@...ziesquirrel.com>,
Jeremy Kerr <jk@...abs.org>,
Christopher Bostic <cbostic@...ux.vnet.ibm.com>,
Joel Stanley <joel@....id.au>, Andrew Jeffery <andrew@...id.au>
Subject: Re: [PATCH linux] drivers/fsi: Add SBEFIFO FSI client device driver
On 06/15/2017 5:24 AM, gregkh@...uxfoundation.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
>
Powered by blists - more mailing lists