linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Grygorii Strashko <grygorii.strashko@ti.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 24/26] net: ethernet: ti: cpsw: fix ASSERT_RTNL() warning during suspend
Date: Thu, 28 May 2020 07:56:52 -0400	[thread overview]
Message-ID: <20200528115654.1406165-24-sashal@kernel.org> (raw)
In-Reply-To: <20200528115654.1406165-1-sashal@kernel.org>

From: Grygorii Strashko <grygorii.strashko@ti.com>

[ Upstream commit 4c64b83d03f4aafcdf710caad994cbc855802e74 ]

vlan_for_each() are required to be called with rtnl_lock taken, otherwise
ASSERT_RTNL() warning will be triggered - which happens now during System
resume from suspend:
  cpsw_suspend()
  |- cpsw_ndo_stop()
    |- __hw_addr_ref_unsync_dev()
      |- cpsw_purge_all_mc()
         |- vlan_for_each()
            |- ASSERT_RTNL();

Hence, fix it by surrounding cpsw_ndo_stop() by rtnl_lock/unlock() calls.

Fixes: 15180eca569b ("net: ethernet: ti: cpsw: fix vlan mcast")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/ti/cpsw.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index d7a953c647b4..39df8c8feb6c 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2999,11 +2999,15 @@ static int cpsw_suspend(struct device *dev)
 	struct cpsw_common *cpsw = dev_get_drvdata(dev);
 	int i;
 
+	rtnl_lock();
+
 	for (i = 0; i < cpsw->data.slaves; i++)
 		if (cpsw->slaves[i].ndev)
 			if (netif_running(cpsw->slaves[i].ndev))
 				cpsw_ndo_stop(cpsw->slaves[i].ndev);
 
+	rtnl_unlock();
+
 	/* Select sleep pin state */
 	pinctrl_pm_select_sleep_state(dev);
 
-- 
2.25.1


  parent reply	other threads:[~2020-05-28 11:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 11:56 [PATCH AUTOSEL 5.4 01/26] ARC: Fix ICCM & DCCM runtime size checks Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 02/26] ARC: [plat-eznps]: Restrict to CONFIG_ISA_ARCOMPACT Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 03/26] evm: Fix RCU list related warnings Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 04/26] scsi: pm: Balance pm_only counter of request queue during system resume Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 05/26] i2c: altera: Fix race between xfer_msg and isr thread Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 06/26] io_uring: initialize ctx->sqo_wait earlier Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 07/26] net sched: fix reporting the first-time use timestamp Sasha Levin
2020-05-31 21:19   ` Pavel Machek
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 08/26] x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 09/26] net: bmac: Fix read of MAC address from ROM Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 10/26] r8152: support additional Microsoft Surface Ethernet Adapter variant Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 11/26] drm/edid: Add Oculus Rift S to non-desktop list Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 12/26] s390/mm: fix set_huge_pte_at() for empty ptes Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 13/26] null_blk: return error for invalid zone size Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 14/26] net: mvpp2: fix RX hashing for non-10G ports Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 15/26] net/ethernet/freescale: rework quiesce/activate for ucc_geth Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 16/26] net: ethernet: stmmac: Enable interface clocks on probe for IPQ806x Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 17/26] selftests: mlxsw: qos_mc_aware: Specify arping timeout as an integer Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 18/26] net: sun: fix missing release regions in cas_init_one() Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 19/26] net/mlx5: Add command entry handling completion Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 20/26] net/mlx5e: Fix inner tirs handling Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 21/26] net/mlx5: Fix memory leak in mlx5_events_init Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 22/26] net/mlx5e: Update netdev txq on completions during closure Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 23/26] net/mlx5: Fix error flow in case of function_setup failure Sasha Levin
2020-05-28 11:56 ` Sasha Levin [this message]
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 25/26] net/mlx4_core: fix a memory leak bug Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 26/26] net: smsc911x: Fix runtime PM imbalance on error Sasha Levin

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=20200528115654.1406165-24-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=grygorii.strashko@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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).