Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753560AbcLGUT1 (ORCPT ); Wed, 7 Dec 2016 15:19:27 -0500 Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:36232 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752876AbcLGUT0 (ORCPT ); Wed, 7 Dec 2016 15:19:26 -0500 From: Stuart Yoder To: Greg KH CC: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , "agraf@suse.de" , "arnd@arndb.de" , Leo Li , Ioana Ciornei , "Catalin Horghidan" , Laurentiu Tudor , Ruxandra Ioana Radulescu Subject: RE: [PATCH v3 1/9] staging: fsl-mc: move bus driver out of staging Thread-Topic: [PATCH v3 1/9] staging: fsl-mc: move bus driver out of staging Thread-Index: AQHSTCUaF8l5kM8cdUiKwJF2//8LNKD8q6AAgABAMIA= Date: Wed, 7 Dec 2016 20:19:20 +0000 Message-ID: References: <1480632094-3621-1-git-send-email-stuart.yoder@nxp.com> <1480632094-3621-2-git-send-email-stuart.yoder@nxp.com> <20161207155248.GA11794@kroah.com> In-Reply-To: <20161207155248.GA11794@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=stuart.yoder@nxp.com; x-originating-ip: [162.203.173.167] x-microsoft-exchange-diagnostics: 1;VI1PR0401MB1728;7:NPiMiEzo52V5bmgwyBU8lom1Oduu7cRIGYZQS/uiA3lSYYFeDQX0OiJensgc+QBo/t7EcRu6BI5jwZEM74s3exItLaHNKcHXotSp0Z2Fr3I/Z3JgHb3qV/VfvqSNVnxpqJxyWNMwMCjrzlEldDWG2j4FmtkHBQp1RcwE3twqOQZfd5WZYr90L/WQ6ruRSN3Wouh3xOFmOWeSdujCzsSQmQVAjRKQeQQetn0Yz7PktLlc40JQqWsQ+NRXfJot9mlU/2eFdBTVV2gUS1ZB1j2JysEXUoPk9NmmDJWfXFAl0LcMj2J/ZA7yH0yejMlFSoWy1Hvzr8DSgh95fL0tkE6m/GLIHKnqCZeN5aq4HevqD4dT5qtMGp9NPmZXQSsH9JhGWsuvqquTnyqUXC8Co3LquRB8voVTohKAAKs+pySA2rc4weRpS7U5ilddYBDbdiRmC6xs5wySElOJgjTkCYN9sw== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39850400002)(39410400002)(39840400002)(39860400002)(39450400003)(24454002)(199003)(189002)(13464003)(377454003)(81166006)(7696004)(7736002)(97736004)(81156014)(4326007)(76576001)(9686002)(5660300001)(105586002)(76176999)(3280700002)(6506006)(92566002)(122556002)(101416001)(86362001)(6116002)(50986999)(54356999)(6916009)(102836003)(8936002)(2950100002)(106356001)(38730400001)(68736007)(66066001)(2900100001)(189998001)(106116001)(7846002)(33656002)(74316002)(3846002)(8676002)(229853002)(110136003)(3660700001)(2906002)(77096006)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB1728;H:VI1PR0401MB2638.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: f8742bb1-9dc5-4a6c-5629-08d41ede543e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0401MB1728; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148)(6047074);SRVR:VI1PR0401MB1728;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB1728; x-forefront-prvs: 01494FA7F7 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2016 20:19:20.9425 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB1728 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uB7KJWeZ006990 Content-Length: 3220 Lines: 72 > -----Original Message----- > From: Greg KH [mailto:gregkh@linuxfoundation.org] > Sent: Wednesday, December 07, 2016 9:53 AM > To: Stuart Yoder > Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org; agraf@suse.de; arnd@arndb.de; Leo Li > ; Ioana Ciornei ; Catalin Horghidan > ; Laurentiu Tudor ; Ruxandra Ioana Radulescu > > 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. As far as who accesses it... fsl-mc device drivers will reference the 'struct device' when registering interrupts, when calling functions like devm*, dev_err(), and for maintaining driver private data in 'driver_data'. Example of registering an irq where you can see the embedded struct dev (dpio_dev->dev) referenced: error = devm_request_irq(&dpio_dev->dev, irq->msi_desc->irq, dpio_irq_handler, 0, dev_name(&dpio_dev->dev), &dpio_dev->dev); > - do you have any Documentation/ABI entries? Not currently, but it looks like we need ones for bind/unbind. I will submit a patch to document these. > - 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. 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. > - don't call pr_info() in fsl_mc_bus_driver_init(), no need to > say anything if all goes well. Same goes with random > dev_info() calls, please remove. Ok, will do. Thanks, Stuart