* [net] ixgbe: fix registration order of driver and DCA nofitication @ 2013-04-04 2:50 Jeff Kirsher 2013-04-04 3:11 ` Joe Perches 2013-04-05 4:50 ` David Miller 0 siblings, 2 replies; 4+ messages in thread From: Jeff Kirsher @ 2013-04-04 2:50 UTC (permalink / raw) To: davem; +Cc: Jakub Kicinski, netdev, gospo, sassmann, stable, Jeff Kirsher From: Jakub Kicinski <jakub.kicinski@intel.com> ixgbe_notify_dca cannot be called before driver registration because it expects driver's klist_devices to be allocated and initialized. While on it make sure debugfs files are removed when registration fails. Cc: stable <stable@vger.kernel.org> Signed-off-by: Jakub Kicinski <jakub.kicinski@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index db5611a..79f4a26 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -7922,12 +7922,19 @@ static int __init ixgbe_init_module(void) ixgbe_dbg_init(); #endif /* CONFIG_DEBUG_FS */ + ret = pci_register_driver(&ixgbe_driver); + if (ret) { +#ifdef CONFIG_DEBUG_FS + ixgbe_dbg_exit(); +#endif /* CONFIG_DEBUG_FS */ + return ret; + } + #ifdef CONFIG_IXGBE_DCA dca_register_notify(&dca_notifier); #endif - ret = pci_register_driver(&ixgbe_driver); - return ret; + return 0; } module_init(ixgbe_init_module); -- 1.7.11.7 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net] ixgbe: fix registration order of driver and DCA nofitication 2013-04-04 2:50 [net] ixgbe: fix registration order of driver and DCA nofitication Jeff Kirsher @ 2013-04-04 3:11 ` Joe Perches 2013-04-04 3:25 ` David Miller 2013-04-05 4:50 ` David Miller 1 sibling, 1 reply; 4+ messages in thread From: Joe Perches @ 2013-04-04 3:11 UTC (permalink / raw) To: Jeff Kirsher; +Cc: davem, Jakub Kicinski, netdev, gospo, sassmann, stable On Wed, 2013-04-03 at 19:50 -0700, Jeff Kirsher wrote: > From: Jakub Kicinski <jakub.kicinski@intel.com> > > ixgbe_notify_dca cannot be called before driver registration > because it expects driver's klist_devices to be allocated and > initialized. While on it make sure debugfs files are removed > when registration fails. Why not take out a bunch of these #ifdef CONFIG_DEBUG_FS at the same time? Something like: drivers/net/ethernet/intel/ixgbe/ixgbe.h | 5 +++++ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 +++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index a8e10cf..ca93238 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h @@ -740,6 +740,11 @@ extern void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter); extern void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter); extern void ixgbe_dbg_init(void); extern void ixgbe_dbg_exit(void); +#else +static inline void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter) {} +static inline void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter) {} +static inline void ixgbe_dbg_init(void) {} +static inline void ixgbe_dbg_exit(void) {} #endif /* CONFIG_DEBUG_FS */ static inline struct netdev_queue *txring_txq(const struct ixgbe_ring *ring) { diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index e56a3d1..06cd8cd 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -7575,9 +7575,7 @@ skip_sriov: e_err(probe, "failed to allocate sysfs resources\n"); #endif /* CONFIG_IXGBE_HWMON */ -#ifdef CONFIG_DEBUG_FS ixgbe_dbg_adapter_init(adapter); -#endif /* CONFIG_DEBUG_FS */ return 0; @@ -7613,9 +7611,7 @@ static void ixgbe_remove(struct pci_dev *pdev) struct ixgbe_adapter *adapter = pci_get_drvdata(pdev); struct net_device *netdev = adapter->netdev; -#ifdef CONFIG_DEBUG_FS ixgbe_dbg_adapter_exit(adapter); -#endif /*CONFIG_DEBUG_FS */ set_bit(__IXGBE_DOWN, &adapter->state); cancel_work_sync(&adapter->service_task); @@ -7878,16 +7874,19 @@ static int __init ixgbe_init_module(void) pr_info("%s - version %s\n", ixgbe_driver_string, ixgbe_driver_version); pr_info("%s\n", ixgbe_copyright); -#ifdef CONFIG_DEBUG_FS ixgbe_dbg_init(); -#endif /* CONFIG_DEBUG_FS */ + + ret = pci_register_driver(&ixgbe_driver); + if (ret) { + ixgbe_dbg_exit(); + return ret; + } #ifdef CONFIG_IXGBE_DCA dca_register_notify(&dca_notifier); #endif - ret = pci_register_driver(&ixgbe_driver); - return ret; + return 0; } module_init(ixgbe_init_module); @@ -7905,9 +7904,7 @@ static void __exit ixgbe_exit_module(void) #endif pci_unregister_driver(&ixgbe_driver); -#ifdef CONFIG_DEBUG_FS ixgbe_dbg_exit(); -#endif /* CONFIG_DEBUG_FS */ rcu_barrier(); /* Wait for completion of call_rcu()'s */ } ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net] ixgbe: fix registration order of driver and DCA nofitication 2013-04-04 3:11 ` Joe Perches @ 2013-04-04 3:25 ` David Miller 0 siblings, 0 replies; 4+ messages in thread From: David Miller @ 2013-04-04 3:25 UTC (permalink / raw) To: joe; +Cc: jeffrey.t.kirsher, jakub.kicinski, netdev, gospo, sassmann, stable From: Joe Perches <joe@perches.com> Date: Wed, 03 Apr 2013 20:11:12 -0700 > On Wed, 2013-04-03 at 19:50 -0700, Jeff Kirsher wrote: >> From: Jakub Kicinski <jakub.kicinski@intel.com> >> >> ixgbe_notify_dca cannot be called before driver registration >> because it expects driver's klist_devices to be allocated and >> initialized. While on it make sure debugfs files are removed >> when registration fails. > > Why not take out a bunch of these #ifdef CONFIG_DEBUG_FS at > the same time? Something like: Because it's a bug fix targetted at 'net' and thus must be a minimal fix rather than something targetted at 'net-next' where we could do cleanups like that. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net] ixgbe: fix registration order of driver and DCA nofitication 2013-04-04 2:50 [net] ixgbe: fix registration order of driver and DCA nofitication Jeff Kirsher 2013-04-04 3:11 ` Joe Perches @ 2013-04-05 4:50 ` David Miller 1 sibling, 0 replies; 4+ messages in thread From: David Miller @ 2013-04-05 4:50 UTC (permalink / raw) To: jeffrey.t.kirsher; +Cc: jakub.kicinski, netdev, gospo, sassmann, stable From: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Date: Wed, 3 Apr 2013 19:50:54 -0700 > From: Jakub Kicinski <jakub.kicinski@intel.com> > > ixgbe_notify_dca cannot be called before driver registration > because it expects driver's klist_devices to be allocated and > initialized. While on it make sure debugfs files are removed > when registration fails. > > Cc: stable <stable@vger.kernel.org> > Signed-off-by: Jakub Kicinski <jakub.kicinski@intel.com> > Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Applied, thanks Jeff. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-05 4:50 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-04-04 2:50 [net] ixgbe: fix registration order of driver and DCA nofitication Jeff Kirsher 2013-04-04 3:11 ` Joe Perches 2013-04-04 3:25 ` David Miller 2013-04-05 4:50 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox