netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] r8169: fix PHY driver check on platforms w/o module softdeps
@ 2020-03-27 16:33 Heiner Kallweit
  2020-03-27 22:57 ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Heiner Kallweit @ 2020-03-27 16:33 UTC (permalink / raw)
  To: Realtek linux nic maintainers, David Miller; +Cc: Chih-Wei Huang, netdev

On Android/x86 the module loading infrastructure can't deal with
softdeps. Therefore the check for presence of the Realtek PHY driver
module fails. mdiobus_register() will try to load the PHY driver
module, therefore move the check to after this call and explicitly
check that a dedicated PHY driver is bound to the PHY device.

Fixes: f32593773549 ("r8169: check that Realtek PHY driver module is loaded")
Reported-by: Chih-Wei Huang <cwhuang@android-x86.org>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
Please apply fix back to 5.4 only. On 4.19 it would break processing.
---
 drivers/net/ethernet/realtek/r8169_main.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index a9bdafd15..791d99b9e 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5285,6 +5285,13 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
 	if (!tp->phydev) {
 		mdiobus_unregister(new_bus);
 		return -ENODEV;
+	} else if (!tp->phydev->drv) {
+		/* Most chip versions fail with the genphy driver.
+		 * Therefore ensure that the dedicated PHY driver is loaded.
+		 */
+		dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
+		mdiobus_unregister(new_bus);
+		return -EUNATCH;
 	}
 
 	/* PHY will be woken up in rtl_open() */
@@ -5446,15 +5453,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	int chipset, region;
 	int jumbo_max, rc;
 
-	/* Some tools for creating an initramfs don't consider softdeps, then
-	 * r8169.ko may be in initramfs, but realtek.ko not. Then the generic
-	 * PHY driver is used that doesn't work with most chip versions.
-	 */
-	if (!driver_find("RTL8201CP Ethernet", &mdio_bus_type)) {
-		dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
-		return -ENOENT;
-	}
-
 	dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp));
 	if (!dev)
 		return -ENOMEM;
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net] r8169: fix PHY driver check on platforms w/o module softdeps
  2020-03-27 16:33 [PATCH net] r8169: fix PHY driver check on platforms w/o module softdeps Heiner Kallweit
@ 2020-03-27 22:57 ` David Miller
  2020-03-27 23:10   ` Heiner Kallweit
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2020-03-27 22:57 UTC (permalink / raw)
  To: hkallweit1; +Cc: nic_swsd, cwhuang, netdev

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Fri, 27 Mar 2020 17:33:32 +0100

> On Android/x86 the module loading infrastructure can't deal with
> softdeps. Therefore the check for presence of the Realtek PHY driver
> module fails. mdiobus_register() will try to load the PHY driver
> module, therefore move the check to after this call and explicitly
> check that a dedicated PHY driver is bound to the PHY device.
> 
> Fixes: f32593773549 ("r8169: check that Realtek PHY driver module is loaded")
> Reported-by: Chih-Wei Huang <cwhuang@android-x86.org>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> Please apply fix back to 5.4 only. On 4.19 it would break processing.

Applied, but am I missing something here?  The Fixes: tag is a v5.6 change
which was not sent to -stable.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net] r8169: fix PHY driver check on platforms w/o module softdeps
  2020-03-27 22:57 ` David Miller
@ 2020-03-27 23:10   ` Heiner Kallweit
  2020-03-27 23:24     ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Heiner Kallweit @ 2020-03-27 23:10 UTC (permalink / raw)
  To: David Miller; +Cc: nic_swsd, cwhuang, netdev

On 27.03.2020 23:57, David Miller wrote:
> From: Heiner Kallweit <hkallweit1@gmail.com>
> Date: Fri, 27 Mar 2020 17:33:32 +0100
> 
>> On Android/x86 the module loading infrastructure can't deal with
>> softdeps. Therefore the check for presence of the Realtek PHY driver
>> module fails. mdiobus_register() will try to load the PHY driver
>> module, therefore move the check to after this call and explicitly
>> check that a dedicated PHY driver is bound to the PHY device.
>>
>> Fixes: f32593773549 ("r8169: check that Realtek PHY driver module is loaded")
>> Reported-by: Chih-Wei Huang <cwhuang@android-x86.org>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> Please apply fix back to 5.4 only. On 4.19 it would break processing.
> 
> Applied, but am I missing something here?  The Fixes: tag is a v5.6 change
> which was not sent to -stable.
> 
Somehow that change made it to -stable. See e.g. commit
85a19b0e31e256e77fd4124804b9cec10619de5e for 4.19.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net] r8169: fix PHY driver check on platforms w/o module softdeps
  2020-03-27 23:10   ` Heiner Kallweit
@ 2020-03-27 23:24     ` David Miller
  2020-03-28  9:52       ` issue with 85a19b0e31e2 on 4.19 -> revert Heiner Kallweit
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2020-03-27 23:24 UTC (permalink / raw)
  To: hkallweit1; +Cc: nic_swsd, cwhuang, netdev

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sat, 28 Mar 2020 00:10:57 +0100

> Somehow that change made it to -stable. See e.g. commit
> 85a19b0e31e256e77fd4124804b9cec10619de5e for 4.19.

This is a serious issue in that it seems that the people maintaining
the older stable release integrate arbitrary patches even if they
haven't been sent to v5.4 and v5.5

And I don't handle -stable backport submissions that far back anyways.

Therefore, I'm not going ot participate in that ongoing problem, so
feel free to contact the folks who integrated those changes into
-stable and ask them to revert.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: issue with 85a19b0e31e2 on 4.19 -> revert
  2020-03-27 23:24     ` David Miller
@ 2020-03-28  9:52       ` Heiner Kallweit
  2020-03-30 14:30         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Heiner Kallweit @ 2020-03-28  9:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: David Miller, nic_swsd, cwhuang, netdev

On 28.03.2020 00:24, David Miller wrote:
> From: Heiner Kallweit <hkallweit1@gmail.com>
> Date: Sat, 28 Mar 2020 00:10:57 +0100
> 
>> Somehow that change made it to -stable. See e.g. commit
>> 85a19b0e31e256e77fd4124804b9cec10619de5e for 4.19.
> 
> This is a serious issue in that it seems that the people maintaining
> the older stable release integrate arbitrary patches even if they
> haven't been sent to v5.4 and v5.5
> 
> And I don't handle -stable backport submissions that far back anyways.
> 
> Therefore, I'm not going to participate in that ongoing problem, so
> feel free to contact the folks who integrated those changes into
> -stable and ask them to revert.
> 
> Thanks.
> 
Greg,

commit 85a19b0e31e2 ("r8169: check that Realtek PHY driver module is loaded")
made it accidentally to 4.19 and causes an issue with Android/x86.
Could you please revert it?

Thanks, Heiner

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: issue with 85a19b0e31e2 on 4.19 -> revert
  2020-03-28  9:52       ` issue with 85a19b0e31e2 on 4.19 -> revert Heiner Kallweit
@ 2020-03-30 14:30         ` Greg Kroah-Hartman
  2020-03-30 14:39           ` Heiner Kallweit
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2020-03-30 14:30 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: David Miller, nic_swsd, cwhuang, netdev

On Sat, Mar 28, 2020 at 10:52:19AM +0100, Heiner Kallweit wrote:
> On 28.03.2020 00:24, David Miller wrote:
> > From: Heiner Kallweit <hkallweit1@gmail.com>
> > Date: Sat, 28 Mar 2020 00:10:57 +0100
> > 
> >> Somehow that change made it to -stable. See e.g. commit
> >> 85a19b0e31e256e77fd4124804b9cec10619de5e for 4.19.
> > 
> > This is a serious issue in that it seems that the people maintaining
> > the older stable release integrate arbitrary patches even if they
> > haven't been sent to v5.4 and v5.5
> > 
> > And I don't handle -stable backport submissions that far back anyways.
> > 
> > Therefore, I'm not going to participate in that ongoing problem, so
> > feel free to contact the folks who integrated those changes into
> > -stable and ask them to revert.
> > 
> > Thanks.
> > 
> Greg,
> 
> commit 85a19b0e31e2 ("r8169: check that Realtek PHY driver module is loaded")
> made it accidentally to 4.19 and causes an issue with Android/x86.
> Could you please revert it?

Now reverted.  Should I also drop this from 5.4.y and 5.5.y?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: issue with 85a19b0e31e2 on 4.19 -> revert
  2020-03-30 14:30         ` Greg Kroah-Hartman
@ 2020-03-30 14:39           ` Heiner Kallweit
  2020-03-30 15:07             ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Heiner Kallweit @ 2020-03-30 14:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: David Miller, nic_swsd, cwhuang, netdev

On 30.03.2020 16:30, Greg Kroah-Hartman wrote:
> On Sat, Mar 28, 2020 at 10:52:19AM +0100, Heiner Kallweit wrote:
>> On 28.03.2020 00:24, David Miller wrote:
>>> From: Heiner Kallweit <hkallweit1@gmail.com>
>>> Date: Sat, 28 Mar 2020 00:10:57 +0100
>>>
>>>> Somehow that change made it to -stable. See e.g. commit
>>>> 85a19b0e31e256e77fd4124804b9cec10619de5e for 4.19.
>>>
>>> This is a serious issue in that it seems that the people maintaining
>>> the older stable release integrate arbitrary patches even if they
>>> haven't been sent to v5.4 and v5.5
>>>
>>> And I don't handle -stable backport submissions that far back anyways.
>>>
>>> Therefore, I'm not going to participate in that ongoing problem, so
>>> feel free to contact the folks who integrated those changes into
>>> -stable and ask them to revert.
>>>
>>> Thanks.
>>>
>> Greg,
>>
>> commit 85a19b0e31e2 ("r8169: check that Realtek PHY driver module is loaded")
>> made it accidentally to 4.19 and causes an issue with Android/x86.
>> Could you please revert it?
> 
> Now reverted.  Should I also drop this from 5.4.y and 5.5.y?
> 
Thanks! On 5.4 and 5.5 it's not needed to revert. The following fix from 5.6
should make it to 5.4 and 5.5 soon.

2e8c339b4946 ("r8169: fix PHY driver check on platforms w/o module softdeps")

> thanks,
> 
> greg k-h
> 
Heiner

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: issue with 85a19b0e31e2 on 4.19 -> revert
  2020-03-30 14:39           ` Heiner Kallweit
@ 2020-03-30 15:07             ` Greg Kroah-Hartman
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2020-03-30 15:07 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: David Miller, nic_swsd, cwhuang, netdev

On Mon, Mar 30, 2020 at 04:39:08PM +0200, Heiner Kallweit wrote:
> On 30.03.2020 16:30, Greg Kroah-Hartman wrote:
> > On Sat, Mar 28, 2020 at 10:52:19AM +0100, Heiner Kallweit wrote:
> >> On 28.03.2020 00:24, David Miller wrote:
> >>> From: Heiner Kallweit <hkallweit1@gmail.com>
> >>> Date: Sat, 28 Mar 2020 00:10:57 +0100
> >>>
> >>>> Somehow that change made it to -stable. See e.g. commit
> >>>> 85a19b0e31e256e77fd4124804b9cec10619de5e for 4.19.
> >>>
> >>> This is a serious issue in that it seems that the people maintaining
> >>> the older stable release integrate arbitrary patches even if they
> >>> haven't been sent to v5.4 and v5.5
> >>>
> >>> And I don't handle -stable backport submissions that far back anyways.
> >>>
> >>> Therefore, I'm not going to participate in that ongoing problem, so
> >>> feel free to contact the folks who integrated those changes into
> >>> -stable and ask them to revert.
> >>>
> >>> Thanks.
> >>>
> >> Greg,
> >>
> >> commit 85a19b0e31e2 ("r8169: check that Realtek PHY driver module is loaded")
> >> made it accidentally to 4.19 and causes an issue with Android/x86.
> >> Could you please revert it?
> > 
> > Now reverted.  Should I also drop this from 5.4.y and 5.5.y?
> > 
> Thanks! On 5.4 and 5.5 it's not needed to revert. The following fix from 5.6
> should make it to 5.4 and 5.5 soon.
> 
> 2e8c339b4946 ("r8169: fix PHY driver check on platforms w/o module softdeps")

I don't see it in David's queue, so I'll go take it now for those trees.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-30 15:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 16:33 [PATCH net] r8169: fix PHY driver check on platforms w/o module softdeps Heiner Kallweit
2020-03-27 22:57 ` David Miller
2020-03-27 23:10   ` Heiner Kallweit
2020-03-27 23:24     ` David Miller
2020-03-28  9:52       ` issue with 85a19b0e31e2 on 4.19 -> revert Heiner Kallweit
2020-03-30 14:30         ` Greg Kroah-Hartman
2020-03-30 14:39           ` Heiner Kallweit
2020-03-30 15:07             ` Greg Kroah-Hartman

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).