Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934060AbcLIRZr (ORCPT ); Fri, 9 Dec 2016 12:25:47 -0500 Received: from mail-db5eur01on0063.outbound.protection.outlook.com ([104.47.2.63]:60657 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933314AbcLIRZq (ORCPT ); Fri, 9 Dec 2016 12:25:46 -0500 From: Stuart Yoder To: Greg KH CC: "devel@driverdev.osuosl.org" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "agraf@suse.de" , Leo Li , Catalin Horghidan , "Ioana Ciornei" , Laurentiu Tudor 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//8LNKD8q6AAgABAMICAAVWqAIAAhxjwgAB12YCAAJE1gA== Date: Fri, 9 Dec 2016 15:53:27 +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> <20161208160524.GA4977@kroah.com> <20161209071043.GA2940@kroah.com> In-Reply-To: <20161209071043.GA2940@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: [192.88.168.1] x-microsoft-exchange-diagnostics: 1;VI1PR0401MB1727;7:Acz6d1D31YEnVkqeyW17YKFse0MpTIKIqrUMw1nbUQxFiHjprbTygnuf8J2x55FjTz3Vj1+g2e0X3UpfR0NTQsDzaUdr3ASd9k7CT9pCmRZk0mi/CHCbq/ubtnIuI+DeXLP4IAcdRbli4Kyre9aQUTvWB+jP5LkJok6ClhpwdiejrQeTTDJFloZBwzhTh8cognJqGnr6a5OGfyF21vjj8MT3fqgQIa/AiPBhDGQ8L8/NhyDPB2u8qhrPwsjxMFseK8h37a3uXWnLWlvhutCi4K8+DWC74lNAdzyE6Nt0w8Spq1QhipudpVdYcULDl4k4O5JnD77Ulenwklbsg7c/ZJveAmebC7X3/WG/x6o+OXfAGaeUqRlHVeOuS1jd4zWO0oPbzTVAeQmJd8invk1rJzhrws5E+ImBXcuuWjKgnSrBrvdZXY6FjZRnOeMBdmCInYaaBzVN2zqQFC9kPV0guA== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39860400002)(39850400002)(39840400002)(39410400002)(39450400003)(199003)(189002)(3280700002)(110136003)(3660700001)(8676002)(81156014)(81166006)(8936002)(102836003)(33656002)(97736004)(2906002)(6116002)(66066001)(122556002)(2900100001)(6916009)(4326007)(93886004)(77096006)(305945005)(7696004)(92566002)(76576001)(9686002)(2950100002)(3846002)(189998001)(74316002)(86362001)(106116001)(50986999)(6506006)(6436002)(5660300001)(7736002)(106356001)(76176999)(54356999)(105586002)(68736007)(38730400001)(101416001)(229853002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB1727;H:VI1PR0401MB2638.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: 133d99bd-4f1a-439f-885c-08d4204b843a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0401MB1727; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(6047074);SRVR:VI1PR0401MB1727;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB1727; x-forefront-prvs: 015114592F 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: 09 Dec 2016 15:53:27.6374 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB1727 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 uB9HPrwq022070 Content-Length: 1412 Lines: 39 > > > 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? > > > > Hrm...something seems wrong in free path, and I think this needs to > > be refactored. > > > > IIRC, when German (former maintainer) wrote that code he loosely based > > it on the register/unregister platform bus code: > > > > int platform_device_register(struct platform_device *pdev) > > { > > device_initialize(&pdev->dev); > > arch_setup_pdev_archdata(pdev); > > return platform_device_add(pdev); > > } > > void platform_device_unregister(struct platform_device *pdev) > > { > > platform_device_del(pdev); > > platform_device_put(pdev); > > } > > > > ...I'm puzzling over how that code handles a refcount of zero > > as I see no 'release' callback anywhere, but I must be missing > > something. > > > > In any case, we'll get this refactored. > > Have you tried removing a device? The kernel should complain loudly > about there not being a release function for your device. Yes, device removal has been working from day 1. A brief look seems to indicate that the ref count never goes to zero, which needs to be debugged. Thanks, Stuart