From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next 5/6] r8169: change type of driver_data Date: Sun, 25 Mar 2018 16:43:10 -0400 (EDT) Message-ID: <20180325.164310.604360450302392080.davem@davemloft.net> References: <6160c32d-3905-683a-7117-d2b11d310a34@gmail.com> <70541d5c-7a5e-3988-585d-2804ab41e4db@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: nic_swsd@realtek.com, netdev@vger.kernel.org To: hkallweit1@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:41710 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751899AbeCYUnM (ORCPT ); Sun, 25 Mar 2018 16:43:12 -0400 In-Reply-To: <70541d5c-7a5e-3988-585d-2804ab41e4db@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Heiner Kallweit Date: Sat, 24 Mar 2018 23:18:25 +0100 > Several functions accessing the device driver_data field don't need the > net_device. All needed parameters can be accessed via struct > rtl8169_private, therefore change type of driver_data accordingly. > > Signed-off-by: Heiner Kallweit This doesn't work. The pci_set_drvdata() call happens after register_netdevice(). At the exact moment register_netdevice() is called, any part of the driver can be invoked before it returns. Therefore this change will result in crashes because the drvdata won't be initialized early enough. I really think you're taking things too far with the cleanups of this driver. It is a reasonably old driver used by a lot of people, and I think avoiding regressions is 1000 times more important than "streamlining" control plane functions that have not effect whatsoever on real driver performance. Thank you.