From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio Porcedda Subject: Re: [PATCH 10/10] drivers: misc: use module_platform_driver_probe() Date: Wed, 20 Mar 2013 10:02:23 +0100 Message-ID: References: <1363266691-15757-1-git-send-email-fabio.porcedda@gmail.com> <201303191648.31527.arnd@arndb.de> <201303191759.27762.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: In-Reply-To: <201303191759.27762.arnd@arndb.de> Sender: linux-media-owner@vger.kernel.org To: Arnd Bergmann Cc: Geert Uytterhoeven , H Hartley Sweeten , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-media@vger.kernel.org" , "linux-ide@vger.kernel.org" , "lm-sensors@lm-sensors.org" , "linux-input@vger.kernel.org" , "linux-fbdev@vger.kernel.org" , Greg Kroah-Hartman , Grant Likely List-Id: linux-ide@vger.kernel.org On Tue, Mar 19, 2013 at 6:59 PM, Arnd Bergmann wrote: > On Tuesday 19 March 2013, Fabio Porcedda wrote: >> On Tue, Mar 19, 2013 at 5:48 PM, Arnd Bergmann wrote: >> > On Tuesday 19 March 2013, Geert Uytterhoeven wrote: >> >> Hmm, so we may have drivers that (now) work perfectly fine with >> >> module_platform_driver_probe()/platform_driver_probe(), but will start >> >> failing suddenly in the future? >> > >> > They will fail if someone changes the initialization order. That would >> > already break drivers before deferred probing support (and was the reason >> > we added feature in the first place), but now we can be much more liberal >> > with the order in which drivers are initialized, except when they are >> > using platform_driver_probe() >> > >> >> I guess we need a big fat WARN_ON(-EPROBE_DEFER) in >> >> platform_driver_probe() to catch these? >> > >> > Yes, very good idea. >> >> If it's fine, I'll send a patch for that. > > That would be cool, yes. I looked at it earlier (after sending my email above) > and couldn't find an easy way to do it though, because platform_drv_probe > does not know whether it is called from platform_driver_probe or not. > > Maybe using something other than platform_driver_register would work here. > > Arnd I think we can check inside the deferred_probe_work_func() if the dev->probe function pointer is equal to platform_drv_probe_fail(). Regards -- Fabio Porcedda From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756347Ab3CTJCs (ORCPT ); Wed, 20 Mar 2013 05:02:48 -0400 Received: from mail-ob0-f180.google.com ([209.85.214.180]:62380 "EHLO mail-ob0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755883Ab3CTJCo (ORCPT ); Wed, 20 Mar 2013 05:02:44 -0400 MIME-Version: 1.0 In-Reply-To: <201303191759.27762.arnd@arndb.de> References: <1363266691-15757-1-git-send-email-fabio.porcedda@gmail.com> <201303191648.31527.arnd@arndb.de> <201303191759.27762.arnd@arndb.de> From: Fabio Porcedda Date: Wed, 20 Mar 2013 10:02:23 +0100 Message-ID: Subject: Re: [PATCH 10/10] drivers: misc: use module_platform_driver_probe() To: Arnd Bergmann Cc: Geert Uytterhoeven , H Hartley Sweeten , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-media@vger.kernel.org" , "linux-ide@vger.kernel.org" , "lm-sensors@lm-sensors.org" , "linux-input@vger.kernel.org" , "linux-fbdev@vger.kernel.org" , Greg Kroah-Hartman , Grant Likely Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 19, 2013 at 6:59 PM, Arnd Bergmann wrote: > On Tuesday 19 March 2013, Fabio Porcedda wrote: >> On Tue, Mar 19, 2013 at 5:48 PM, Arnd Bergmann wrote: >> > On Tuesday 19 March 2013, Geert Uytterhoeven wrote: >> >> Hmm, so we may have drivers that (now) work perfectly fine with >> >> module_platform_driver_probe()/platform_driver_probe(), but will start >> >> failing suddenly in the future? >> > >> > They will fail if someone changes the initialization order. That would >> > already break drivers before deferred probing support (and was the reason >> > we added feature in the first place), but now we can be much more liberal >> > with the order in which drivers are initialized, except when they are >> > using platform_driver_probe() >> > >> >> I guess we need a big fat WARN_ON(-EPROBE_DEFER) in >> >> platform_driver_probe() to catch these? >> > >> > Yes, very good idea. >> >> If it's fine, I'll send a patch for that. > > That would be cool, yes. I looked at it earlier (after sending my email above) > and couldn't find an easy way to do it though, because platform_drv_probe > does not know whether it is called from platform_driver_probe or not. > > Maybe using something other than platform_driver_register would work here. > > Arnd I think we can check inside the deferred_probe_work_func() if the dev->probe function pointer is equal to platform_drv_probe_fail(). Regards -- Fabio Porcedda From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio Porcedda Date: Wed, 20 Mar 2013 09:02:23 +0000 Subject: Re: [PATCH 10/10] drivers: misc: use module_platform_driver_probe() Message-Id: List-Id: References: <1363266691-15757-1-git-send-email-fabio.porcedda@gmail.com> <201303191648.31527.arnd@arndb.de> <201303191759.27762.arnd@arndb.de> In-Reply-To: <201303191759.27762.arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org On Tue, Mar 19, 2013 at 6:59 PM, Arnd Bergmann wrote: > On Tuesday 19 March 2013, Fabio Porcedda wrote: >> On Tue, Mar 19, 2013 at 5:48 PM, Arnd Bergmann wrote: >> > On Tuesday 19 March 2013, Geert Uytterhoeven wrote: >> >> Hmm, so we may have drivers that (now) work perfectly fine with >> >> module_platform_driver_probe()/platform_driver_probe(), but will start >> >> failing suddenly in the future? >> > >> > They will fail if someone changes the initialization order. That would >> > already break drivers before deferred probing support (and was the reason >> > we added feature in the first place), but now we can be much more liberal >> > with the order in which drivers are initialized, except when they are >> > using platform_driver_probe() >> > >> >> I guess we need a big fat WARN_ON(-EPROBE_DEFER) in >> >> platform_driver_probe() to catch these? >> > >> > Yes, very good idea. >> >> If it's fine, I'll send a patch for that. > > That would be cool, yes. I looked at it earlier (after sending my email above) > and couldn't find an easy way to do it though, because platform_drv_probe > does not know whether it is called from platform_driver_probe or not. > > Maybe using something other than platform_driver_register would work here. > > Arnd I think we can check inside the deferred_probe_work_func() if the dev->probe function pointer is equal to platform_drv_probe_fail(). Regards -- Fabio Porcedda From mboxrd@z Thu Jan 1 00:00:00 1970 From: fabio.porcedda@gmail.com (Fabio Porcedda) Date: Wed, 20 Mar 2013 10:02:23 +0100 Subject: [PATCH 10/10] drivers: misc: use module_platform_driver_probe() In-Reply-To: <201303191759.27762.arnd@arndb.de> References: <1363266691-15757-1-git-send-email-fabio.porcedda@gmail.com> <201303191648.31527.arnd@arndb.de> <201303191759.27762.arnd@arndb.de> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Mar 19, 2013 at 6:59 PM, Arnd Bergmann wrote: > On Tuesday 19 March 2013, Fabio Porcedda wrote: >> On Tue, Mar 19, 2013 at 5:48 PM, Arnd Bergmann wrote: >> > On Tuesday 19 March 2013, Geert Uytterhoeven wrote: >> >> Hmm, so we may have drivers that (now) work perfectly fine with >> >> module_platform_driver_probe()/platform_driver_probe(), but will start >> >> failing suddenly in the future? >> > >> > They will fail if someone changes the initialization order. That would >> > already break drivers before deferred probing support (and was the reason >> > we added feature in the first place), but now we can be much more liberal >> > with the order in which drivers are initialized, except when they are >> > using platform_driver_probe() >> > >> >> I guess we need a big fat WARN_ON(-EPROBE_DEFER) in >> >> platform_driver_probe() to catch these? >> > >> > Yes, very good idea. >> >> If it's fine, I'll send a patch for that. > > That would be cool, yes. I looked at it earlier (after sending my email above) > and couldn't find an easy way to do it though, because platform_drv_probe > does not know whether it is called from platform_driver_probe or not. > > Maybe using something other than platform_driver_register would work here. > > Arnd I think we can check inside the deferred_probe_work_func() if the dev->probe function pointer is equal to platform_drv_probe_fail(). Regards -- Fabio Porcedda