netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] r8169 (x86) clk fixes to fix S0ix not being reached
@ 2018-09-12  9:34 Hans de Goede
  2018-09-12  9:34 ` [PATCH v2 1/3] clk: x86: add "ether_clk" alias for Bay Trail / Cherry Trail Hans de Goede
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Hans de Goede @ 2018-09-12  9:34 UTC (permalink / raw)
  To: David S . Miller, Heiner Kallweit, Michael Turquette,
	Stephen Boyd, Andy Shevchenko, Pierre-Louis Bossart
  Cc: Hans de Goede, linux-wireless, netdev, Johannes Stezenbach,
	Carlo Caione, linux-clk

Hi David,

This series adds code to the r8169 ethernet driver to get and enable an
external clock if present, avoiding the need for a hack in the
clk-pmc-atom driver where that clock was left on continuesly causing x86
some devices to not reach deep power saving states (S0ix) when suspended
causing to them to quickly drain their battery while suspended.

The 3 commits in this series need to be merged in order to avoid
regressions while bisecting. The clk-pmc-atom driver does not see much
changes (it was last touched over a year ago). So the clk maintainers
have agreed with merging all 3 patches through the net tree.
All 3 patches have Stephen Boyd's Acked-by for this purpose.

This v2 of the series only had some minor tweaks done to the commit
messages and is ready for merging through the net tree now.

Thanks & Regards,

Hans

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

* [PATCH v2 1/3] clk: x86: add "ether_clk" alias for Bay Trail / Cherry Trail
  2018-09-12  9:34 [PATCH v2 0/3] r8169 (x86) clk fixes to fix S0ix not being reached Hans de Goede
@ 2018-09-12  9:34 ` Hans de Goede
       [not found] ` <20180912093456.23400-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Hans de Goede @ 2018-09-12  9:34 UTC (permalink / raw)
  To: David S . Miller, Heiner Kallweit, Michael Turquette,
	Stephen Boyd, Andy Shevchenko, Pierre-Louis Bossart
  Cc: Hans de Goede, linux-wireless, netdev, Johannes Stezenbach,
	Carlo Caione, linux-clk

Commit d31fd43c0f9a ("clk: x86: Do not gate clocks enabled by the
firmware") causes all unclaimed PMC clocks on Cherry Trail devices to be on
all the time, resulting on the device not being able to reach S0i2 or S0i3
when suspended.

The reason for this commit is that on some Bay Trail / Cherry Trail devices
the ethernet controller uses pmc_plt_clk_4. This commit adds an "ether_clk"
alias, so that the relevant ethernet drivers can try to (optionally) use
this, without needing X86 specific code / hacks, thus fixing ethernet on
these devices without breaking S0i3 support.

This commit uses clkdev_hw_create() to create the alias, mirroring the code
for the already existing "mclk" alias for pmc_plt_clk_3.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=193891#c102
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=196861
Cc: Johannes Stezenbach <js@sig21.net>
Cc: Carlo Caione <carlo@endlessm.com>
Reported-by: Johannes Stezenbach <js@sig21.net>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Tweaked the commit msg a bit
-Added: Stephen's Acked-by, Andy's Reviewed-by
---
 drivers/clk/x86/clk-pmc-atom.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/clk/x86/clk-pmc-atom.c b/drivers/clk/x86/clk-pmc-atom.c
index 08ef69945ffb..75151901ff7d 100644
--- a/drivers/clk/x86/clk-pmc-atom.c
+++ b/drivers/clk/x86/clk-pmc-atom.c
@@ -55,6 +55,7 @@ struct clk_plt_data {
 	u8 nparents;
 	struct clk_plt *clks[PMC_CLK_NUM];
 	struct clk_lookup *mclk_lookup;
+	struct clk_lookup *ether_clk_lookup;
 };
 
 /* Return an index in parent table */
@@ -351,11 +352,20 @@ static int plt_clk_probe(struct platform_device *pdev)
 		goto err_unreg_clk_plt;
 	}
 
+	data->ether_clk_lookup = clkdev_hw_create(&data->clks[4]->hw,
+						  "ether_clk", NULL);
+	if (!data->ether_clk_lookup) {
+		err = -ENOMEM;
+		goto err_drop_mclk;
+	}
+
 	plt_clk_free_parent_names_loop(parent_names, data->nparents);
 
 	platform_set_drvdata(pdev, data);
 	return 0;
 
+err_drop_mclk:
+	clkdev_drop(data->mclk_lookup);
 err_unreg_clk_plt:
 	plt_clk_unregister_loop(data, i);
 	plt_clk_unregister_parents(data);
@@ -369,6 +379,7 @@ static int plt_clk_remove(struct platform_device *pdev)
 
 	data = platform_get_drvdata(pdev);
 
+	clkdev_drop(data->ether_clk_lookup);
 	clkdev_drop(data->mclk_lookup);
 	plt_clk_unregister_loop(data, PMC_CLK_NUM);
 	plt_clk_unregister_parents(data);
-- 
2.19.0.rc0

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

* [PATCH v2 2/3] r8169: Get and enable optional ether_clk clock
       [not found] ` <20180912093456.23400-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2018-09-12  9:34   ` Hans de Goede
  0 siblings, 0 replies; 9+ messages in thread
From: Hans de Goede @ 2018-09-12  9:34 UTC (permalink / raw)
  To: David S . Miller, Heiner Kallweit, Michael Turquette,
	Stephen Boyd, Andy Shevchenko, Pierre-Louis Bossart
  Cc: Hans de Goede, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, Johannes Stezenbach, Carlo Caione,
	linux-clk-u79uwXL29TY76Z2rM5mHXA

On some boards a platform clock is used as clock for the r8169 chip,
this commit adds support for getting and enabling this clock (assuming
it has an "ether_clk" alias set on it).

This is related to commit d31fd43c0f9a ("clk: x86: Do not gate clocks
enabled by the firmware") which is a previous attempt to fix this for some
x86 boards, but this causes all Cherry Trail SoC using boards to not reach
there lowest power states when suspending.

This commit (together with an atom-pmc-clk driver commit adding the alias)
fixes things properly by making the r8169 get the clock and enable it when
it needs it.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=193891#c102
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=196861
Cc: Johannes Stezenbach <js-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
Cc: Carlo Caione <carlo-6IF/jdPJHihWk0Htik3J/w@public.gmane.org>
Reported-by: Johannes Stezenbach <js-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
Acked-by: Stephen Boyd <sboyd-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
Changes in v2:
-Tweaked the commit msg a bit
-Added: Stephen's Acked-by, Andy's Reviewed-by
---
 drivers/net/ethernet/realtek/r8169.c | 33 ++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index b08d51bf7a20..474229548731 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -13,6 +13,7 @@
 #include <linux/pci.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/ethtool.h>
 #include <linux/phy.h>
@@ -665,6 +666,7 @@ struct rtl8169_private {
 
 	u16 event_slow;
 	const struct rtl_coalesce_info *coalesce_info;
+	struct clk *clk;
 
 	struct mdio_ops {
 		void (*write)(struct rtl8169_private *, int, int);
@@ -7254,6 +7256,11 @@ static int rtl_jumbo_max(struct rtl8169_private *tp)
 	}
 }
 
+static void rtl_disable_clk(void *data)
+{
+	clk_disable_unprepare(data);
+}
+
 static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data;
@@ -7274,6 +7281,32 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT);
 	tp->supports_gmii = cfg->has_gmii;
 
+	/* Get the *optional* external "ether_clk" used on some boards */
+	tp->clk = devm_clk_get(&pdev->dev, "ether_clk");
+	if (IS_ERR(tp->clk)) {
+		rc = PTR_ERR(tp->clk);
+		if (rc == -ENOENT) {
+			/* clk-core allows NULL (for suspend / resume) */
+			tp->clk = NULL;
+		} else if (rc == -EPROBE_DEFER) {
+			return rc;
+		} else {
+			dev_err(&pdev->dev, "failed to get clk: %d\n", rc);
+			return rc;
+		}
+	} else {
+		rc = clk_prepare_enable(tp->clk);
+		if (rc) {
+			dev_err(&pdev->dev, "failed to enable clk: %d\n", rc);
+			return rc;
+		}
+
+		rc = devm_add_action_or_reset(&pdev->dev, rtl_disable_clk,
+					      tp->clk);
+		if (rc)
+			return rc;
+	}
+
 	/* enable device (incl. PCI PM wakeup and hotplug setup) */
 	rc = pcim_enable_device(pdev);
 	if (rc < 0) {
-- 
2.19.0.rc0

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

* [PATCH v2 3/3] clk: x86: Stop marking clocks as CLK_IS_CRITICAL
  2018-09-12  9:34 [PATCH v2 0/3] r8169 (x86) clk fixes to fix S0ix not being reached Hans de Goede
  2018-09-12  9:34 ` [PATCH v2 1/3] clk: x86: add "ether_clk" alias for Bay Trail / Cherry Trail Hans de Goede
       [not found] ` <20180912093456.23400-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2018-09-12  9:34 ` Hans de Goede
  2022-07-24 21:00   ` [BISECTED] igb initialization failure on Bay Trail Matwey V. Kornilov
  2018-09-18  1:48 ` [PATCH v2 0/3] r8169 (x86) clk fixes to fix S0ix not being reached David Miller
  3 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2018-09-12  9:34 UTC (permalink / raw)
  To: David S . Miller, Heiner Kallweit, Michael Turquette,
	Stephen Boyd, Andy Shevchenko, Pierre-Louis Bossart
  Cc: Hans de Goede, linux-wireless, netdev, Johannes Stezenbach,
	Carlo Caione, linux-clk

Commit d31fd43c0f9a ("clk: x86: Do not gate clocks enabled by the
firmware"), which added the code to mark clocks as CLK_IS_CRITICAL, causes
all unclaimed PMC clocks on Cherry Trail devices to be on all the time,
resulting on the device not being able to reach S0i3 when suspended.

The reason for this commit is that on some Bay Trail / Cherry Trail devices
the r8169 ethernet controller uses pmc_plt_clk_4. Now that the clk-pmc-atom
driver exports an "ether_clk" alias for pmc_plt_clk_4 and the r8169 driver
has been modified to get and enable this clock (if present) the marking of
the clocks as CLK_IS_CRITICAL is no longer necessary.

This commit removes the CLK_IS_CRITICAL marking, fixing Cherry Trail
devices not being able to reach S0i3 greatly decreasing their battery
drain when suspended.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=193891#c102
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=196861
Cc: Johannes Stezenbach <js@sig21.net>
Cc: Carlo Caione <carlo@endlessm.com>
Reported-by: Johannes Stezenbach <js@sig21.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Tweaked the commit msg a bit
-Added: Stephen's Acked-by, Andy's Reviewed-by
---
 drivers/clk/x86/clk-pmc-atom.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/clk/x86/clk-pmc-atom.c b/drivers/clk/x86/clk-pmc-atom.c
index 75151901ff7d..d977193842df 100644
--- a/drivers/clk/x86/clk-pmc-atom.c
+++ b/drivers/clk/x86/clk-pmc-atom.c
@@ -187,13 +187,6 @@ static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,
 	pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;
 	spin_lock_init(&pclk->lock);
 
-	/*
-	 * If the clock was already enabled by the firmware mark it as critical
-	 * to avoid it being gated by the clock framework if no driver owns it.
-	 */
-	if (plt_clk_is_enabled(&pclk->hw))
-		init.flags |= CLK_IS_CRITICAL;
-
 	ret = devm_clk_hw_register(&pdev->dev, &pclk->hw);
 	if (ret) {
 		pclk = ERR_PTR(ret);
-- 
2.19.0.rc0

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

* Re: [PATCH v2 0/3] r8169 (x86) clk fixes to fix S0ix not being reached
  2018-09-12  9:34 [PATCH v2 0/3] r8169 (x86) clk fixes to fix S0ix not being reached Hans de Goede
                   ` (2 preceding siblings ...)
  2018-09-12  9:34 ` [PATCH v2 3/3] clk: x86: Stop marking clocks as CLK_IS_CRITICAL Hans de Goede
@ 2018-09-18  1:48 ` David Miller
  3 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2018-09-18  1:48 UTC (permalink / raw)
  To: hdegoede
  Cc: hkallweit1, mturquette, sboyd, andriy.shevchenko,
	pierre-louis.bossart, linux-wireless, netdev, js, carlo,
	linux-clk

From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 12 Sep 2018 11:34:53 +0200

> This series adds code to the r8169 ethernet driver to get and enable an
> external clock if present, avoiding the need for a hack in the
> clk-pmc-atom driver where that clock was left on continuesly causing x86
> some devices to not reach deep power saving states (S0ix) when suspended
> causing to them to quickly drain their battery while suspended.
> 
> The 3 commits in this series need to be merged in order to avoid
> regressions while bisecting. The clk-pmc-atom driver does not see much
> changes (it was last touched over a year ago). So the clk maintainers
> have agreed with merging all 3 patches through the net tree.
> All 3 patches have Stephen Boyd's Acked-by for this purpose.
> 
> This v2 of the series only had some minor tweaks done to the commit
> messages and is ready for merging through the net tree now.

Thanks for all of that useful information.

Series applied, thanks.

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

* [BISECTED] igb initialization failure on Bay Trail
  2018-09-12  9:34 ` [PATCH v2 3/3] clk: x86: Stop marking clocks as CLK_IS_CRITICAL Hans de Goede
@ 2022-07-24 21:00   ` Matwey V. Kornilov
  2022-07-25 15:32     ` Pierre-Louis Bossart
  2022-07-27 12:18     ` Hans de Goede
  0 siblings, 2 replies; 9+ messages in thread
From: Matwey V. Kornilov @ 2022-07-24 21:00 UTC (permalink / raw)
  To: hdegoede
  Cc: andriy.shevchenko, carlo, davem, hkallweit1, js, linux-clk,
	linux-wireless, mturquette, netdev, pierre-louis.bossart, sboyd

Hello,

I've just found that the following commit

    648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")

breaks the ethernet on my Lex 3I380CW (Atom E3845) motherboard. The board is
equipped with dual Intel I211 based 1Gbps copper ethernet.

Before the commit I see the following:

     igb 0000:01:00.0: added PHC on eth0
     igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
     igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e4
     igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
     igb 0000:01:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
     igb 0000:02:00.0: added PHC on eth1
     igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection
     igb 0000:02:00.0: eth1: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e5
     igb 0000:02:00.0: eth1: PBA No: FFFFFF-0FF
     igb 0000:02:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)

while when the commit is applied I see the following:

     igb 0000:01:00.0: added PHC on eth0
     igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
     igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e4
     igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
     igb 0000:01:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
     igb: probe of 0000:02:00.0 failed with error -2

Please note, that the second ethernet initialization is failed.


See also: http://www.lex.com.tw/products/pdf/3I380A&3I380CW.pdf

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

* Re: [BISECTED] igb initialization failure on Bay Trail
  2022-07-24 21:00   ` [BISECTED] igb initialization failure on Bay Trail Matwey V. Kornilov
@ 2022-07-25 15:32     ` Pierre-Louis Bossart
  2022-07-26  9:15       ` Matwey V. Kornilov
  2022-07-27 12:18     ` Hans de Goede
  1 sibling, 1 reply; 9+ messages in thread
From: Pierre-Louis Bossart @ 2022-07-25 15:32 UTC (permalink / raw)
  To: Matwey V. Kornilov, hdegoede
  Cc: andriy.shevchenko, carlo, davem, hkallweit1, js, linux-clk,
	linux-wireless, mturquette, netdev, sboyd



On 7/24/22 16:00, Matwey V. Kornilov wrote:
> Hello,
> 
> I've just found that the following commit
> 
>     648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
> 
> breaks the ethernet on my Lex 3I380CW (Atom E3845) motherboard. The board is
> equipped with dual Intel I211 based 1Gbps copper ethernet.

It's not going to be simple, it's 4 yr old commit that fixes other
issues with S0i3...

> 
> Before the commit I see the following:
> 
>      igb 0000:01:00.0: added PHC on eth0
>      igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
>      igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e4
>      igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
>      igb 0000:01:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
>      igb 0000:02:00.0: added PHC on eth1
>      igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection
>      igb 0000:02:00.0: eth1: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e5
>      igb 0000:02:00.0: eth1: PBA No: FFFFFF-0FF
>      igb 0000:02:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
> 
> while when the commit is applied I see the following:
> 
>      igb 0000:01:00.0: added PHC on eth0
>      igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
>      igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e4
>      igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
>      igb 0000:01:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
>      igb: probe of 0000:02:00.0 failed with error -2
> 
> Please note, that the second ethernet initialization is failed.
> 
> 
> See also: http://www.lex.com.tw/products/pdf/3I380A&3I380CW.pdf

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

* Re: [BISECTED] igb initialization failure on Bay Trail
  2022-07-25 15:32     ` Pierre-Louis Bossart
@ 2022-07-26  9:15       ` Matwey V. Kornilov
  0 siblings, 0 replies; 9+ messages in thread
From: Matwey V. Kornilov @ 2022-07-26  9:15 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Hans de Goede, Andy Shevchenko, carlo, davem, hkallweit1, js,
	linux-clk, linux-wireless, mturquette, netdev, sboyd

пн, 25 июл. 2022 г. в 20:08, Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com>:
>
>
>
> On 7/24/22 16:00, Matwey V. Kornilov wrote:
> > Hello,
> >
> > I've just found that the following commit
> >
> >     648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
> >
> > breaks the ethernet on my Lex 3I380CW (Atom E3845) motherboard. The board is
> > equipped with dual Intel I211 based 1Gbps copper ethernet.
>
> It's not going to be simple, it's 4 yr old commit that fixes other
> issues with S0i3...

Additionally, it seems that the issue appears only when CONFIG_IGB=m
is used. When CONFIG_IGB=y then both ethernets are initialized
correctly.
However, most (if not all) kernel configs in Linux distros use CONFIG_IGB=m

>
> >
> > Before the commit I see the following:
> >
> >      igb 0000:01:00.0: added PHC on eth0
> >      igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
> >      igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e4
> >      igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
> >      igb 0000:01:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
> >      igb 0000:02:00.0: added PHC on eth1
> >      igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection
> >      igb 0000:02:00.0: eth1: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e5
> >      igb 0000:02:00.0: eth1: PBA No: FFFFFF-0FF
> >      igb 0000:02:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
> >
> > while when the commit is applied I see the following:
> >
> >      igb 0000:01:00.0: added PHC on eth0
> >      igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
> >      igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e4
> >      igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
> >      igb 0000:01:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
> >      igb: probe of 0000:02:00.0 failed with error -2
> >
> > Please note, that the second ethernet initialization is failed.
> >
> >
> > See also: http://www.lex.com.tw/products/pdf/3I380A&3I380CW.pdf



-- 
With best regards,
Matwey V. Kornilov

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

* Re: [BISECTED] igb initialization failure on Bay Trail
  2022-07-24 21:00   ` [BISECTED] igb initialization failure on Bay Trail Matwey V. Kornilov
  2022-07-25 15:32     ` Pierre-Louis Bossart
@ 2022-07-27 12:18     ` Hans de Goede
  1 sibling, 0 replies; 9+ messages in thread
From: Hans de Goede @ 2022-07-27 12:18 UTC (permalink / raw)
  To: Matwey V. Kornilov
  Cc: andriy.shevchenko, carlo, davem, hkallweit1, js, linux-clk,
	linux-wireless, mturquette, netdev, pierre-louis.bossart, sboyd

Hi Paul,

On 7/24/22 23:00, Matwey V. Kornilov wrote:
> Hello,
> 
> I've just found that the following commit
> 
>     648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
> 
> breaks the ethernet on my Lex 3I380CW (Atom E3845) motherboard. The board is
> equipped with dual Intel I211 based 1Gbps copper ethernet.
> 
> Before the commit I see the following:
> 
>      igb 0000:01:00.0: added PHC on eth0
>      igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
>      igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e4
>      igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
>      igb 0000:01:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
>      igb 0000:02:00.0: added PHC on eth1
>      igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection
>      igb 0000:02:00.0: eth1: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e5
>      igb 0000:02:00.0: eth1: PBA No: FFFFFF-0FF
>      igb 0000:02:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
> 
> while when the commit is applied I see the following:
> 
>      igb 0000:01:00.0: added PHC on eth0
>      igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
>      igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 4c:02:89:10:02:e4
>      igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
>      igb 0000:01:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
>      igb: probe of 0000:02:00.0 failed with error -2
> 
> Please note, that the second ethernet initialization is failed.
> 
> 
> See also: http://www.lex.com.tw/products/pdf/3I380A&3I380CW.pdf

Yes some boards use more then 1 clk for the ethernet and do not take
care of enabling/disabling the clk in their ACPI.

As Pierre-Louis mentioned already the disabling of the clocks is necessary
to make 100-s of different (tablet) models suspend properly.

Unfortunately this is known to break ethernet on some boards. As a workaround
we use DMI quirks on those few boards to keep the clocks enabled there, see:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/pmc_atom.c#n381

If you can submit a patch adding your board to this DMI table, then I will
merge it and get it on its way to Linus Torvalds asap.

If you instead want me to write the patch for you, please run:

sudo dmidecode > dmidecode.txt

And attach the generated dmidecode.txt file to your next email.

Regards,

Hans


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

end of thread, other threads:[~2022-07-27 12:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12  9:34 [PATCH v2 0/3] r8169 (x86) clk fixes to fix S0ix not being reached Hans de Goede
2018-09-12  9:34 ` [PATCH v2 1/3] clk: x86: add "ether_clk" alias for Bay Trail / Cherry Trail Hans de Goede
     [not found] ` <20180912093456.23400-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-12  9:34   ` [PATCH v2 2/3] r8169: Get and enable optional ether_clk clock Hans de Goede
2018-09-12  9:34 ` [PATCH v2 3/3] clk: x86: Stop marking clocks as CLK_IS_CRITICAL Hans de Goede
2022-07-24 21:00   ` [BISECTED] igb initialization failure on Bay Trail Matwey V. Kornilov
2022-07-25 15:32     ` Pierre-Louis Bossart
2022-07-26  9:15       ` Matwey V. Kornilov
2022-07-27 12:18     ` Hans de Goede
2018-09-18  1:48 ` [PATCH v2 0/3] r8169 (x86) clk fixes to fix S0ix not being reached David Miller

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