From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
Jakub Kicinski <kuba@kernel.org>
Cc: Sekhar Nori <nsekhar@ti.com>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
Murali Karicheri <m-karicheri2@ti.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Grygorii Strashko <grygorii.strashko@ti.com>
Subject: [PATCH net-next 5/6] net: ethernet: ti: am65-cpsw-ethtool: configured critical setting only when no running netdevs
Date: Fri, 26 Jun 2020 21:17:08 +0300 [thread overview]
Message-ID: <20200626181709.22635-6-grygorii.strashko@ti.com> (raw)
In-Reply-To: <20200626181709.22635-1-grygorii.strashko@ti.com>
Ensure that critical setting can only be configured when there are no
running netdevs - all ports are down.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
index f7b33875a385..496dafb25128 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
@@ -445,7 +445,7 @@ static int am65_cpsw_set_channels(struct net_device *ndev,
/* Check if interface is up. Can change the num queues when
* the interface is down.
*/
- if (netif_running(ndev))
+ if (common->usage_count)
return -EBUSY;
am65_cpsw_nuss_remove_tx_chns(common);
@@ -734,6 +734,9 @@ static int am65_cpsw_set_ethtool_priv_flags(struct net_device *ndev, u32 flags)
rrobin = !!(flags & AM65_CPSW_PRIV_P0_RX_PTYPE_RROBIN);
+ if (common->usage_count)
+ return -EBUSY;
+
if (common->est_enabled && rrobin) {
netdev_err(ndev,
"p0-rx-ptype-rrobin flag conflicts with QOS\n");
--
2.17.1
next prev parent reply other threads:[~2020-06-26 18:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 18:17 [PATCH net-next 0/6] net: ethernet: ti: am65-cpsw: update and enable sr2.0 soc Grygorii Strashko
2020-06-26 18:17 ` [PATCH net-next 1/6] net: ethernet: ti: am65-cpsw-nuss: restore vlan configuration while down/up Grygorii Strashko
2020-06-26 18:17 ` [PATCH net-next 2/6] net: ethernet: ti: am65-cpsw: move to pf_p0_rx_ptype_rrobin init in probe Grygorii Strashko
2020-06-26 18:17 ` [PATCH net-next 3/6] net: ethernet: ti: am65-cpsw-nuss: fix ports mac sl initialization Grygorii Strashko
2020-06-26 18:17 ` [PATCH net-next 4/6] net: ethernet: ti: am65-cpsw-ethtool: skip hw cfg when change p0-rx-ptype-rrobin Grygorii Strashko
2020-06-26 18:17 ` Grygorii Strashko [this message]
2020-06-26 18:17 ` [PATCH net-next 6/6] net: ethernet: ti: am65-cpsw-nuss: enable am65x sr2.0 support Grygorii Strashko
2020-06-30 0:06 ` [PATCH net-next 0/6] net: ethernet: ti: am65-cpsw: update and enable sr2.0 soc David Miller
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=20200626181709.22635-6-grygorii.strashko@ti.com \
--to=grygorii.strashko@ti.com \
--cc=davem@davemloft.net \
--cc=jan.kiszka@siemens.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=vigneshr@ti.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
all inboxes | Powered by JetHome®