From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757646Ab3HHHZ0 (ORCPT ); Thu, 8 Aug 2013 03:25:26 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:28386 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756745Ab3HHHZZ (ORCPT ); Thu, 8 Aug 2013 03:25:25 -0400 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.131.214.131 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX194sh7OmwTr1FcZ5/ASfotc Date: Thu, 8 Aug 2013 00:25:14 -0700 From: Tony Lindgren To: Pantelis Antoniou Cc: Greg Kroah-Hartman , Russell King , =?utf-8?Q?Beno=C3=AEt?= Coussno , Paul Walmsley , Sourav Poddar , Russ Dill , Felipe Balbi , Koen Kooi , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] arm: omap: Proper cleanups for omap_device Message-ID: <20130808072513.GY7656@atomide.com> References: <1375775624-12250-1-git-send-email-panto@antoniou-consulting.com> <1375775624-12250-6-git-send-email-panto@antoniou-consulting.com> <20130806093356.GA27889@kroah.com> <8C31ED90-E9EF-4264-858A-17CC2536B552@antoniou-consulting.com> <20130807161557.GO7656@atomide.com> <4B64047B-505F-4D54-871B-8F1B5315B613@antoniou-consulting.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B64047B-505F-4D54-871B-8F1B5315B613@antoniou-consulting.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Pantelis Antoniou [130807 09:31]: > Hi Tony, > > On Aug 7, 2013, at 7:15 PM, Tony Lindgren wrote: > > > * Pantelis Antoniou [130806 02:44]: > >> On Aug 6, 2013, at 12:33 PM, Greg Kroah-Hartman wrote: > >>> On Tue, Aug 06, 2013 at 10:53:44AM +0300, Pantelis Antoniou wrote: > >>>> + > >>>> static int _omap_device_notifier_call(struct notifier_block *nb, > >>>> unsigned long event, void *dev) > >>>> { > >>>> @@ -185,9 +211,13 @@ static int _omap_device_notifier_call(struct notifier_block *nb, > >>>> struct omap_device *od; > >>>> > >>>> switch (event) { > >>>> - case BUS_NOTIFY_DEL_DEVICE: > >>>> + case BUS_NOTIFY_UNBOUND_DRIVER: > >>>> + /* NOTIFY_DEL_DEVICE is not the right call... > >>>> + * we use a callback here, to make sure no-one is going to > >>>> + * try to use the omap_device data after they're deleted > >>>> + */ > >>>> if (pdev->archdata.od) > >>>> - omap_device_delete(pdev->archdata.od); > >>>> + device_schedule_callback(dev, _omap_device_cleanup); > >>> > >>> Really? This is one sign that you are totally using the driver core > >>> incorrectly. You shouldn't have to rely on notifier callbacks to handle > >>> device removals, your bus code should do that for you directly. > >>> > >>> I don't like this at all, sorry. > >>> > >> > >> Don't shoot the messenger please... > > > > As you're inititalizing capebus with DT, let's figure out what if > > anything you actually need from omap_device. I'd much rather remove > > dependencies than add more. > > > > There is no such thing as capebus anymore. This is just the path of > removing a platform device, which happens to also be an omap_device. OK, so let's figure out the minimal fixes needed. > >> This is all about fixing a crash without messing too many things. > > > > It seems this fix is only needed for supporting out-of-tree code? > > These features with omap_device we may not even want to support in > > the mainline tree as is being discussed.. > > > > What out of tree code? The only thing this patch does is make sure we > don't crash when a perfectly valid call to platform_device_unregister() happens. > > Drivers that don't use omap_device work just fine. So what's the minimal set of fixes then? Regards, Tony