From: Eddie James <eajames@linux.vnet.ibm.com>
To: gregkh@linuxfoundation.org
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Brad Bishop <bradleyb@fuzziesquirrel.com>,
Jeremy Kerr <jk@ozlabs.org>,
Christopher Bostic <cbostic@linux.vnet.ibm.com>,
Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>
Subject: Re: [PATCH linux] drivers/fsi: Add SBEFIFO FSI client device driver
Date: Tue, 20 Jun 2017 11:34:41 -0500 [thread overview]
Message-ID: <930fe55f-bdf1-a2b7-a96b-d9077a3fc302@linux.vnet.ibm.com> (raw)
In-Reply-To: <6363b930-6a69-daf7-c1b5-b1e5ccbc5170@linux.vnet.ibm.com>
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
>
next parent reply other threads:[~2017-06-20 16:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <6363b930-6a69-daf7-c1b5-b1e5ccbc5170@linux.vnet.ibm.com>
2017-06-20 16:34 ` Eddie James [this message]
2017-06-14 19:47 Edward A. James
2017-06-15 5:18 ` Greg KH
2017-06-15 5:18 ` Greg KH
2017-06-15 5:19 ` Greg KH
2017-06-15 5:24 ` Greg KH
2017-06-15 5:26 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=930fe55f-bdf1-a2b7-a96b-d9077a3fc302@linux.vnet.ibm.com \
--to=eajames@linux.vnet.ibm.com \
--cc=andrew@aj.id.au \
--cc=bradleyb@fuzziesquirrel.com \
--cc=cbostic@linux.vnet.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jk@ozlabs.org \
--cc=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®