stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Joakim Zhang <qiangqing.zhang@nxp.com>,
	Wong Vee Khee <vee.khee.wong@linux.intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Meng Li <Meng.Li@windriver.com>
Subject: [PATCH 5.10 09/21] net: stmmac: fix issue where clk is being unprepared twice
Date: Fri, 19 Nov 2021 18:37:44 +0100	[thread overview]
Message-ID: <20211119171444.186440779@linuxfoundation.org> (raw)
In-Reply-To: <20211119171443.892729043@linuxfoundation.org>

From: Wong Vee Khee <vee.khee.wong@linux.intel.com>

commit ab00f3e051e851a8458f0d0eb1bb426deadb6619 upstream.

In the case of MDIO bus registration failure due to no external PHY
devices is connected to the MAC, clk_disable_unprepare() is called in
stmmac_bus_clk_config() and intel_eth_pci_probe() respectively.

The second call in intel_eth_pci_probe() will caused the following:-

[   16.578605] intel-eth-pci 0000:00:1e.5: No PHY found
[   16.583778] intel-eth-pci 0000:00:1e.5: stmmac_dvr_probe: MDIO bus (id: 2) registration failed
[   16.680181] ------------[ cut here ]------------
[   16.684861] stmmac-0000:00:1e.5 already disabled
[   16.689547] WARNING: CPU: 13 PID: 2053 at drivers/clk/clk.c:952 clk_core_disable+0x96/0x1b0
[   16.697963] Modules linked in: dwc3 iTCO_wdt mei_hdcp iTCO_vendor_support udc_core x86_pkg_temp_thermal kvm_intel marvell10g kvm sch_fq_codel nfsd irqbypass dwmac_intel(+) stmmac uio ax88179_178a pcs_xpcs phylink uhid spi_pxa2xx_platform usbnet mei_me pcspkr tpm_crb mii i2c_i801 dw_dmac dwc3_pci thermal dw_dmac_core intel_rapl_msr libphy i2c_smbus mei tpm_tis intel_th_gth tpm_tis_core tpm intel_th_acpi intel_pmc_core intel_th i915 fuse configfs snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core snd_pcm snd_timer snd soundcore
[   16.746785] CPU: 13 PID: 2053 Comm: systemd-udevd Tainted: G     U            5.13.0-rc3-intel-lts #76
[   16.756134] Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-S ADP-S DRR4 CRB, BIOS ADLIFSI1.R00.1494.B00.2012031421 12/03/2020
[   16.769465] RIP: 0010:clk_core_disable+0x96/0x1b0
[   16.774222] Code: 00 8b 05 45 96 17 01 85 c0 7f 24 48 8b 5b 30 48 85 db 74 a5 8b 43 7c 85 c0 75 93 48 8b 33 48 c7 c7 6e 32 cc b7 e8 b2 5d 52 00 <0f> 0b 5b 5d c3 65 8b 05 76 31 18 49 89 c0 48 0f a3 05 bc 92 1a 01
[   16.793016] RSP: 0018:ffffa44580523aa0 EFLAGS: 00010086
[   16.798287] RAX: 0000000000000000 RBX: ffff8d7d0eb70a00 RCX: 0000000000000000
[   16.805435] RDX: 0000000000000002 RSI: ffffffffb7c62d5f RDI: 00000000ffffffff
[   16.812610] RBP: 0000000000000287 R08: 0000000000000000 R09: ffffa445805238d0
[   16.819759] R10: 0000000000000001 R11: 0000000000000001 R12: ffff8d7d0eb70a00
[   16.826904] R13: ffff8d7d027370c8 R14: 0000000000000006 R15: ffffa44580523ad0
[   16.834047] FS:  00007f9882fa2600(0000) GS:ffff8d80a0940000(0000) knlGS:0000000000000000
[   16.842177] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   16.847966] CR2: 00007f9882bea3d8 CR3: 000000010b126001 CR4: 0000000000370ee0
[   16.855144] Call Trace:
[   16.857614]  clk_core_disable_lock+0x1b/0x30
[   16.861941]  intel_eth_pci_probe.cold+0x11d/0x136 [dwmac_intel]
[   16.867913]  pci_device_probe+0xcf/0x150
[   16.871890]  really_probe+0xf5/0x3e0
[   16.875526]  driver_probe_device+0x64/0x150
[   16.879763]  device_driver_attach+0x53/0x60
[   16.883998]  __driver_attach+0x9f/0x150
[   16.887883]  ? device_driver_attach+0x60/0x60
[   16.892288]  ? device_driver_attach+0x60/0x60
[   16.896698]  bus_for_each_dev+0x77/0xc0
[   16.900583]  bus_add_driver+0x184/0x1f0
[   16.904469]  driver_register+0x6c/0xc0
[   16.908268]  ? 0xffffffffc07ae000
[   16.911598]  do_one_initcall+0x4a/0x210
[   16.915489]  ? kmem_cache_alloc_trace+0x305/0x4e0
[   16.920247]  do_init_module+0x5c/0x230
[   16.924057]  load_module+0x2894/0x2b70
[   16.927857]  ? __do_sys_finit_module+0xb5/0x120
[   16.932441]  __do_sys_finit_module+0xb5/0x120
[   16.936845]  do_syscall_64+0x42/0x80
[   16.940476]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[   16.945586] RIP: 0033:0x7f98830e5ccd
[   16.949177] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 93 31 0c 00 f7 d8 64 89 01 48
[   16.967970] RSP: 002b:00007ffc66b60168 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   16.975583] RAX: ffffffffffffffda RBX: 000055885de35ef0 RCX: 00007f98830e5ccd
[   16.982725] RDX: 0000000000000000 RSI: 00007f98832541e3 RDI: 0000000000000012
[   16.989868] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000000
[   16.997042] R10: 0000000000000012 R11: 0000000000000246 R12: 00007f98832541e3
[   17.004222] R13: 0000000000000000 R14: 0000000000000000 R15: 00007ffc66b60328
[   17.011369] ---[ end trace df06a3dab26b988c ]---
[   17.016062] ------------[ cut here ]------------
[   17.020701] stmmac-0000:00:1e.5 already unprepared

Removing the stmmac_bus_clks_config() call in stmmac_dvr_probe and let
dwmac-intel to handle the unprepare and disable of the clk device.

Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Reviewed-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Meng Li <Meng.Li@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    1 -
 1 file changed, 1 deletion(-)

--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5179,7 +5179,6 @@ error_mdio_register:
 	stmmac_napi_del(ndev);
 error_hw_init:
 	destroy_workqueue(priv->wq);
-	stmmac_bus_clks_config(priv, false);
 
 	return ret;
 }



  parent reply	other threads:[~2021-11-19 17:38 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 17:37 [PATCH 5.10 00/21] 5.10.81-rc1 review Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 01/21] fortify: Explicitly disable Clang support Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 02/21] block: Add a helper to validate the block size Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 03/21] loop: Use blk_validate_block_size() to validate " Greg Kroah-Hartman
2021-11-19 21:45   ` Pavel Machek
2021-11-20  7:39     ` Greg Kroah-Hartman
2021-11-21 16:59       ` Pavel Machek
2021-11-19 17:37 ` [PATCH 5.10 04/21] bootconfig: init: Fix memblock leak in xbc_make_cmdline() Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 05/21] net: stmmac: add clocks management for gmac driver Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 06/21] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 07/21] net: stmmac: fix missing unlock on error in stmmac_suspend() Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 08/21] net: stmmac: fix system hang if change mac address after interface ifdown Greg Kroah-Hartman
2021-11-19 17:37 ` Greg Kroah-Hartman [this message]
2021-11-19 17:37 ` [PATCH 5.10 10/21] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 11/21] arm64: vdso32: suppress error message for make mrproper Greg Kroah-Hartman
2021-11-19 21:47   ` Pavel Machek
2021-11-19 22:24     ` Nick Desaulniers
2021-11-19 22:30       ` Nick Desaulniers
2021-11-21  7:48       ` Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 12/21] x86/iopl: Fake iopl(3) CLI/STI usage Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 13/21] parisc/entry: fix trace test in syscall exit path Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 14/21] PCI/MSI: Destroy sysfs before freeing entries Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 15/21] PCI/MSI: Deal with devices lying about their MSI mask capability Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 16/21] PCI: Add MSI masking quirk for Nvidia ION AHCI Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 17/21] erofs: remove the occupied parameter from z_erofs_pagevec_enqueue() Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 18/21] erofs: fix unsafe pagevec reuse of hooked pclusters Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 19/21] scripts/lld-version.sh: Rewrite based on upstream ld-version.sh Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 20/21] perf/core: Avoid put_page() when GUP fails Greg Kroah-Hartman
2021-11-19 17:37 ` [PATCH 5.10 21/21] thermal: Fix NULL pointer dereferences in of_thermal_ functions Greg Kroah-Hartman
2021-11-19 18:46 ` [PATCH 5.10 00/21] 5.10.81-rc1 review Florian Fainelli
2021-11-19 19:46 ` Fox Chen
2021-11-20  0:49 ` Shuah Khan
2021-11-20  7:28 ` Pavel Machek
2021-11-20 15:21 ` Sudip Mukherjee
2021-11-20 15:27 ` Daniel Díaz
2021-11-20 16:06   ` Naresh Kamboju
2021-11-21  7:49     ` Greg Kroah-Hartman
2021-11-20 16:52 ` Guenter Roeck
2021-11-22  2:48 ` Samuel Zou

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=20211119171444.186440779@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=Meng.Li@windriver.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiangqing.zhang@nxp.com \
    --cc=stable@vger.kernel.org \
    --cc=vee.khee.wong@linux.intel.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).