From: Greg KH <gregkh@linuxfoundation.org>
To: Stuart Yoder <stuart.yoder@nxp.com>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"agraf@suse.de" <agraf@suse.de>, "arnd@arndb.de" <arnd@arndb.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Leo Li <leoyang.li@nxp.com>,
Catalin Horghidan <catalin.horghidan@nxp.com>,
Ioana Ciornei <ioana.ciornei@nxp.com>,
Laurentiu Tudor <laurentiu.tudor@nxp.com>
Subject: Re: [PATCH v3 1/9] staging: fsl-mc: move bus driver out of staging
Date: Thu, 8 Dec 2016 17:05:24 +0100 [thread overview]
Message-ID: <20161208160524.GA4977@kroah.com> (raw)
In-Reply-To: <VI1PR0401MB2638E11E4F86F3622FA0FAA28D850@VI1PR0401MB2638.eurprd04.prod.outlook.com>
On Wed, Dec 07, 2016 at 08:19:20PM +0000, Stuart Yoder wrote:
> > -----Original Message-----
> > From: Greg KH [mailto:gregkh@linuxfoundation.org]
> > Sent: Wednesday, December 07, 2016 9:53 AM
> > To: Stuart Yoder <stuart.yoder@nxp.com>
> > Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org; agraf@suse.de; arnd@arndb.de; Leo Li
> > <leoyang.li@nxp.com>; Ioana Ciornei <ioana.ciornei@nxp.com>; Catalin Horghidan
> > <catalin.horghidan@nxp.com>; Laurentiu Tudor <laurentiu.tudor@nxp.com>; Ruxandra Ioana Radulescu
> > <ruxandra.radulescu@nxp.com>
> > Subject: Re: [PATCH v3 1/9] staging: fsl-mc: move bus driver out of staging
> >
> > On Thu, Dec 01, 2016 at 04:41:26PM -0600, Stuart Yoder wrote:
> > > Move the source files out of staging into their final locations:
> > > -include files in drivers/staging/fsl-mc/include go to include/linux/fsl
> > > -irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip
> > > -source in drivers/staging/fsl-mc/bus goes to drivers/bus/fsl-mc
> > > -README.txt, providing and overview of DPAA goes to
> > > Documentation/dpaa2/overview.txt
> > > -update MAINTAINERS with new location
> > >
> > > Delete other remaining staging files-- Makefile, Kconfig, TODO
> >
> > Ok, given that I haven't ever reviewed this code, I had a few questions
> > that I couldn't easily figure out by looking at your code:
> > - what is the lifecycle of your 'struct device' usage? Who
> > creates it, who frees it, and who accesses it?
>
> We embed a 'struct device' inside our bus specific device struct
> 'struct fsl_mc_device'. So, when a new fsl-mc object is discovered
> on the bus during initial enumeration or hotplug we create a new
> 'struct fsl_mc_device' and do a device_initialize()/device_add().
> (see fsl_mc_device_add() for where this is done)
>
> 'struct device' is freed when a device is removed-- the reverse
> of the above.
Where is the device freed? I see you trying to do some "odd" stuff in
fsl_mc_device_remove() by deleting and then putting a device structure.
I can't find a "release()" callback anywhere for your bus, where is it?
What happens when the reference count falls to 0 for your struct device?
> > - root_dprc_count, why are you using an atomic variable for
> > this? What is it for other than "look, I'm running!"?
>
> There can be multiple root buses, and this variable simply tracks the count
> of them.
Why does it matter?
> It's is atomic there might be a theoretical race condition where 2
> buses might be added at the same time. The root buses are found in
> the device tree and so if there is no chance that device tree
> processing happens in parallel on multiple cores then we could remove
> the atomic.
Why not just use a lock, or better yet, not care about a "count" at all?
I don't see you doing anything with the count, other than emitting a
WARN() if it drops down below 0 for some reason, or when you call
fsl_mc_bus_exists() which for some reason is exported yet no one uses
it...
thanks,
greg k-h
next prev parent reply other threads:[~2016-12-08 16:05 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 22:41 [PATCH v3 0/9] staging: fsl-mc: move bus driver out of staging, add dpio Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 1/9] staging: fsl-mc: move bus driver out of staging Stuart Yoder
2016-12-07 15:52 ` Greg KH
2016-12-07 20:19 ` Stuart Yoder
2016-12-08 16:05 ` Greg KH [this message]
2016-12-09 0:36 ` Stuart Yoder
2016-12-09 7:10 ` Greg KH
2016-12-09 15:53 ` Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 2/9] bus: fsl-mc: dpio: add DPIO driver overview document Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 3/9] bus: fsl-mc: dpio: add APIs for DPIO objects Stuart Yoder
2016-12-02 11:26 ` Laurentiu Tudor
2016-12-15 16:36 ` Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 4/9] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs Stuart Yoder
2016-12-02 12:12 ` Laurentiu Tudor
2016-12-05 20:52 ` Dan Carpenter
2016-12-06 10:35 ` Laurentiu Tudor
2016-12-15 16:41 ` Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 5/9] bus: fsl-mc: dpio: add global dpaa2 definitions Stuart Yoder
2016-12-02 12:19 ` Laurentiu Tudor
2016-12-15 17:12 ` Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 6/9] bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2 Stuart Yoder
2016-12-02 12:40 ` Laurentiu Tudor
2016-12-15 22:20 ` Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 7/9] bus: fsl-mc: dpio: add the DPAA2 DPIO service interface Stuart Yoder
2016-12-02 13:02 ` Laurentiu Tudor
2016-12-15 22:43 ` Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 8/9] bus: fsl-mc: dpio: add the DPAA2 DPIO object driver Stuart Yoder
2016-12-01 22:41 ` [PATCH v3 9/9] bus: fsl-mc: dpio: add maintainer for DPIO Stuart Yoder
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=20161208160524.GA4977@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=agraf@suse.de \
--cc=arnd@arndb.de \
--cc=catalin.horghidan@nxp.com \
--cc=devel@driverdev.osuosl.org \
--cc=ioana.ciornei@nxp.com \
--cc=laurentiu.tudor@nxp.com \
--cc=leoyang.li@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stuart.yoder@nxp.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.