From: Heiner Kallweit <hkallweit1@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: nic_swsd@realtek.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 5/6] r8169: change type of driver_data
Date: Sun, 25 Mar 2018 23:29:11 +0200 [thread overview]
Message-ID: <0ca42355-d226-3136-c147-99ef46dc824a@gmail.com> (raw)
In-Reply-To: <20180325.164310.604360450302392080.davem@davemloft.net>
Am 25.03.2018 um 22:43 schrieb David Miller:
> From: Heiner Kallweit <hkallweit1@gmail.com>
> 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 <hkallweit1@gmail.com>
>
> 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.
>
Thanks for catching this. The patch however just changes the parameter
of pci_set_drvdata, not the position of this call.
This means the potential crash scenario we have already w/o the patch
and it's a long-standing bug.
Having said that I'd submit a fix for this bug first and then a
rebased version of the cleanup patch set (if fine with you).
> 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.
>
next prev parent reply other threads:[~2018-03-25 21:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-24 22:11 [PATCH net-next 0/6] r8169: patch set with further smaller improvements Heiner Kallweit
2018-03-24 22:18 ` [PATCH net-next 1/6] r8169: change argument type of callback hw_start in struct rtl8169_private Heiner Kallweit
2018-03-24 22:18 ` [PATCH net-next 2/6] r8169: change argument type of counter functions Heiner Kallweit
2018-03-24 22:18 ` [PATCH net-next 3/6] r8169: change argument type of PHY-related functions Heiner Kallweit
2018-03-24 22:18 ` [PATCH net-next 4/6] r8169: change argument type of interrupt handler Heiner Kallweit
2018-03-24 22:18 ` [PATCH net-next 5/6] r8169: change type of driver_data Heiner Kallweit
2018-03-25 20:43 ` David Miller
2018-03-25 21:29 ` Heiner Kallweit [this message]
2018-03-24 22:18 ` [PATCH net-next 6/6] r8169: change argument type of rtl8169_net_suspend and __rtl8169_resume Heiner Kallweit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ca42355-d226-3136-c147-99ef46dc824a@gmail.com \
--to=hkallweit1@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).