Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7159202ybi; Mon, 8 Jul 2019 15:51:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEB+i0M6iDBUJKzRSZHNAq202gsENNUeM1b2i+eJ/1Va6fjzbcQmsfHPhhwTPouhmlg7WV X-Received: by 2002:a17:902:2d01:: with SMTP id o1mr28403059plb.105.1562626284439; Mon, 08 Jul 2019 15:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562626284; cv=none; d=google.com; s=arc-20160816; b=rfnVFLqLwn90COAL9WWef1yiYX1UcTioxUo4C3yx+IPaRMSQwgdJ+gKrNllKTgM39y ehdyjmvui9MRGIFHrknt6sS2LE/u2BxruC7E2D60TQmVuaLmrFvlWQfBmNb2ovEdEc7/ /gnZDwPNt7/kN6ul8Mrxq6JWOSGm8NlxaO13O8dc8nNAvFBJeMaDIhKI2t2c+J+6cVYP pLai1U9Dh2Pxxx1IVKcSP2pXk/M9ZOgXHuORO9nvGRPNxtfvos03keXkt1GxSYjmQIyO S+8YysGyRjDIx9hCRjeYlJtlCuFtwwlB+1VnPbpx+6hnuxDJ09A0mM1DdeLm+vUvTsZT WUnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=h0qJMdNciD39g3Q1jo3+1MbbNG9llP7wamgm8+ijc+0=; b=GKmk78CBV7mspclA2XwftfFEamTYhwI+qm2FY4ylHkZEe+D/rbQmStXwcyZsz+TR+s KabUB/ohN7ZnHgNU7QSjlX5gFBiHDocIMredKej5cM9oQZTghZWG20KCzK4QVW3YfhKg bHBfS9cxssTIImORoYLY2BkLcX/mu822Ad7rJJ+dC7LuH963a3iPaS8PGIpTmHjQYSC5 nKudHcGJfWpBmXBd2T0b7ZFm3lE+Qp0ZLrV5R9mOIQYWLy4LAYDe2bDw74MET+X/I/y2 2HPHgK9N9ipNmg3ExBw8NAwRvnNBOwaTu5rPlQfI3vNqI6Ya1vf4Jwkyo6XYbKw3UZnW e42w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ui6Ji331; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a63si20993550pge.113.2019.07.08.15.51.09; Mon, 08 Jul 2019 15:51:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ui6Ji331; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404678AbfGHVfC (ORCPT + 99 others); Mon, 8 Jul 2019 17:35:02 -0400 Received: from mail-lf1-f42.google.com ([209.85.167.42]:45173 "EHLO mail-lf1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731786AbfGHVen (ORCPT ); Mon, 8 Jul 2019 17:34:43 -0400 Received: by mail-lf1-f42.google.com with SMTP id u10so11907222lfm.12 for ; Mon, 08 Jul 2019 14:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h0qJMdNciD39g3Q1jo3+1MbbNG9llP7wamgm8+ijc+0=; b=ui6Ji331Gj4iwXnkewrzPZ/m3RPsSXRJWkE7ReaRNP99ArpS/s3Y8NOJ1YBuphMqgG hs2b/ERPkCcI5cCgjFjbBnM6cgvYsVSaH2tw5e372IW2I8kz+60ZaJLQtuYXv6EYA8UN /o8YBdjETAyImMGUap37phy9QX7QkvEk55lFo7E9i91UC8z9XsIZXV5QaP20y7X8MGXf 2AfVXtFI887KCOJ3BIENfyL44EuD5nDPFaTfwfUy8sIK6I4H3VYBMjInQZrs3lqxF7iO RhQkAaavW480NkS+JEwqB6/IA8a9708QIoYKU8cdZ5fvQDX7T32VI/loHpxbusuvIqHr 3Xdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=h0qJMdNciD39g3Q1jo3+1MbbNG9llP7wamgm8+ijc+0=; b=FF9wuEK/e7Nhwl7kw7UY6ziw2wNeW3rrkJQMA1jWk6w/a2qYKkYewBSEtTNL2i+Ecd fCvlO1zn5npyjCVBuNQhWfpZFnKkwFsrT/LHhM6eEEJgBprybIBj1NH5E9zQbaSeEMF/ 0ydflgGqOsUbVQZB2n2JdwB4Uy9PoP4KNHT3V5C+dkRphFe3KTWLPGoIusJ97+9kr07E flG17w3E1GlJvPZWmR75FylxKVshHgmgW+Gu66Sno4W5j8JiBzHviibT8IbF7sDSatEN nkJ/u12ZuPDshs/Dc8Dd0r2S399EBcLMGwQpsxJEjm4VXdevIrr9ynQ2wAUqMTD3gjJc S3GA== X-Gm-Message-State: APjAAAXhHPlhvhDEUm1cIO6Oavlxz+AGo4PzYXe2se1WpqyIVwCkU/44 fCy1haXmfA4NLO0ZrdrtbJk/kA== X-Received: by 2002:a19:c150:: with SMTP id r77mr10408764lff.76.1562621681121; Mon, 08 Jul 2019 14:34:41 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id o24sm3883096ljg.6.2019.07.08.14.34.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 14:34:40 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, hawk@kernel.org, davem@davemloft.net Cc: ast@kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, xdp-newbies@vger.kernel.org, ilias.apalodimas@linaro.org, netdev@vger.kernel.org, daniel@iogearbox.net, jakub.kicinski@netronome.com, john.fastabend@gmail.com, Ivan Khoronzhuk Subject: [PATCH v9 net-next 4/5] net: ethernet: ti: cpsw_ethtool: allow res split while down Date: Tue, 9 Jul 2019 00:34:31 +0300 Message-Id: <20190708213432.8525-5-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190708213432.8525-1-ivan.khoronzhuk@linaro.org> References: <20190708213432.8525-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org That's possible to set channel num while interfaces are down. When interface gets up it should resplit budget. This resplit can happen after phy is up but only if speed is changed, so should be set before this, for this allow it to happen while changing number of channels, when interfaces are down. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw_ethtool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw_ethtool.c b/drivers/net/ethernet/ti/cpsw_ethtool.c index c477e6b620d6..e4d7185fde49 100644 --- a/drivers/net/ethernet/ti/cpsw_ethtool.c +++ b/drivers/net/ethernet/ti/cpsw_ethtool.c @@ -620,8 +620,7 @@ int cpsw_set_channels_common(struct net_device *ndev, } } - if (cpsw->usage_count) - cpsw_split_res(cpsw); + cpsw_split_res(cpsw); ret = cpsw_resume_data_pass(ndev); if (!ret) -- 2.17.1