From patchwork Fri Jun 26 18:17:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 191882 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp646700ecs; Fri, 26 Jun 2020 11:17:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2dIq2o2x7NYvmmoV3jO1EETbGbDblA0yrKW67dLPOse5/x/7c/HyXI/9dzQ1NtaN6dvqo X-Received: by 2002:a50:8fa1:: with SMTP id y30mr4480157edy.86.1593195447362; Fri, 26 Jun 2020 11:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593195447; cv=none; d=google.com; s=arc-20160816; b=o7MgRdNtnu1Eg7jKZDLzqKrFnK3KXR4BYtdGR3Wr38Gsz1qYatMR6xIunSv857jeBA CHYi7i15D9KEQ99y9vUNWrEpxWAR25ZE2GEcENWWSrmI4AW02W1FghftqgiH6ygaiNF8 I1tpm8/0BsjQy3BsFJGPiG9f6F9JfMrhWrgjQU08VYhHDPD2pFKnNS8FTM9qrb9Zd2wY tFAIOF65GJCqQhipIR3vfuuQFa7P+la5zKXjnZDCiOivHgOfUBybhM1TPWCZT7g53uzY VJ9DKiDIZwpgsgyn/6ciY+DAYcwBZyWbuSVNfxw0HOsN8dmpfizIUpe3WjEcLzlX3C2z mVJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ObJy3OzFPVwRVlL2NFhYDlEcbRHlojhYSa7S3qkOSMA=; b=sjow5/w5JCpNMxqgLPXhGMGbYfWs6z40Ez6UKOMsPvcQMtrXCQY73VcIPXKo9NC0LQ THC9E55NNP9H4b31Fqi9fft95pJ1QOXuudJpp4yjen8ca4JvSOOTD7+sG/M9JDsKu+lP rWuiLgGjezT16H7bCZjzO6OgC2Nsc7HgcPtHGZZlI68wM1EUjEi3DNlvF4t90BAbTkr9 8gCyrt8YIx1F5HpcpiUeJBLIt1j7u8tWs5CYZozeEDIfcSee5Hzf9m8vNOzbK23T4gN0 CXL/KRqoIsjtOFN10EnI4fUD+s3VU8FHiW8ULZaxq+u9ecD5IyNyu2yoZBD8XgAiIfGk 5M5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="j8TuFR/J"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si17784448edz.588.2020.06.26.11.17.27; Fri, 26 Jun 2020 11:17:27 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="j8TuFR/J"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726344AbgFZSR0 (ORCPT + 9 others); Fri, 26 Jun 2020 14:17:26 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:48542 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726013AbgFZSRZ (ORCPT ); Fri, 26 Jun 2020 14:17:25 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHD2b002410; Fri, 26 Jun 2020 13:17:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1593195433; bh=ObJy3OzFPVwRVlL2NFhYDlEcbRHlojhYSa7S3qkOSMA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=j8TuFR/J7tzCEu0fsyPp2wq/HN0wHLQnNXXmVz4Z4rzEmd8FmPpH09snDjiWzdMmB 2VrqdaM3xLl22uds7bq9W0vdW8mRc5JVEN0k4/UT0aMhjNybpty7fBvJpdcYzlyjRO 567AcqvOyKb1pg1z33X7iWeFrVr03rEHDE+ynf+c= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05QIHDL0058613 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jun 2020 13:17:13 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 26 Jun 2020 13:17:12 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 26 Jun 2020 13:17:12 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHBAA081457; Fri, 26 Jun 2020 13:17:12 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski CC: Sekhar Nori , , , Murali Karicheri , Vignesh Raghavendra , Jan Kiszka , Grygorii Strashko Subject: [PATCH net-next 1/6] net: ethernet: ti: am65-cpsw-nuss: restore vlan configuration while down/up Date: Fri, 26 Jun 2020 21:17:04 +0300 Message-ID: <20200626181709.22635-2-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200626181709.22635-1-grygorii.strashko@ti.com> References: <20200626181709.22635-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The vlan configuration is not restored after interface down/up sequence. Steps to check: # ip link add link eth0 name eth0.100 type vlan id 100 # ifconfig eth0 down # ifconfig eth0 up This patch fixes it, restoring vlan ALE entries on .ndo_open(). Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver") Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 1492648247d9..82d3b1f20890 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -223,6 +223,9 @@ static int am65_cpsw_nuss_ndo_slave_add_vid(struct net_device *ndev, u32 port_mask, unreg_mcast = 0; int ret; + if (!netif_running(ndev) || !vid) + return 0; + ret = pm_runtime_get_sync(common->dev); if (ret < 0) { pm_runtime_put_noidle(common->dev); @@ -246,6 +249,9 @@ static int am65_cpsw_nuss_ndo_slave_kill_vid(struct net_device *ndev, struct am65_cpsw_common *common = am65_ndev_to_common(ndev); int ret; + if (!netif_running(ndev) || !vid) + return 0; + ret = pm_runtime_get_sync(common->dev); if (ret < 0) { pm_runtime_put_noidle(common->dev); @@ -571,6 +577,16 @@ static int am65_cpsw_nuss_ndo_slave_stop(struct net_device *ndev) return 0; } +static int cpsw_restore_vlans(struct net_device *vdev, int vid, void *arg) +{ + struct am65_cpsw_port *port = arg; + + if (!vdev) + return 0; + + return am65_cpsw_nuss_ndo_slave_add_vid(port->ndev, 0, vid); +} + static int am65_cpsw_nuss_ndo_slave_open(struct net_device *ndev) { struct am65_cpsw_common *common = am65_ndev_to_common(ndev); @@ -644,6 +660,9 @@ static int am65_cpsw_nuss_ndo_slave_open(struct net_device *ndev) } } + /* restore vlan configurations */ + vlan_for_each(ndev, cpsw_restore_vlans, port); + phy_attached_info(port->slave.phy); phy_start(port->slave.phy); From patchwork Fri Jun 26 18:17:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 191885 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp646890ecs; Fri, 26 Jun 2020 11:17:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLvLaR5zk27hACXHjsPQz6QLnU9bl5xM59XB3xkSNWbmXOBKJO68+ju5CSyeiekj3E6oMl X-Received: by 2002:a05:6402:c95:: with SMTP id cm21mr4534434edb.255.1593195465571; Fri, 26 Jun 2020 11:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593195465; cv=none; d=google.com; s=arc-20160816; b=XkRDrtamvI5GrwPDpSgKFJtRfrB0tYKWAQAhTiJL3Xx+xQBdbqRE20ZAJUalPjGOrO gyaUeCI2DUZXzOOtY8kDamPw6Hrc6+IZNxwr+bomNTyBbLBvmx1ITfeV+mRMVM03L4JR oo0ug8NBR0O/ZsOHUQLNPQq6mLcCaQikSWxAwbkiQqy+vX4aDiCX8I9ipjhdij7J4L5f xXkByyzeMCoPbtpqr17zI7Svu7ZZFBdm4GOeIjLMiQ8+UAeCOqum7hXMOf3Eppi+0O3W CzGjtMww0CHGYnzvZJBnH+UxcAy8VvZJGhk0i3lP8aQcdHPT+gQN/5jEJhvcopmKaw3q X+Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=PSrVH9Vy0CJwlnXdecSsLB4MTfyMn7rqBfKHS4xMWEQ=; b=D6x0MNhEtBtREvSTu3oeDc4F0a/T2XGLwL7iwNFf7nyWqAanwQdXgB2WwvMJY3Yx9Z LoJ9bCoi7GMPpsld0BXLXPfFnT9c90clcEWCtryFQvNSohv3Qx2LNTusaLTVY5ZMHbaH n0GRaLW4P4KAk7tfw8OYCxn6RH5ErOWUv+9tw+UvHkcKwJ/uMdTMXTCYfaCphHAxVvlO 5nMa/LFR8nRGYUISA2ggWDQytpzhXwJMcpb4kznhrar5Q8KSUiEOP6r+/EBN0x3HYJIA maFJ7B63pTtqAuGa++FG7UhXuREvkBck9GpqIpdq5M0TgiRKhXRnVPz1VBuizAbd96to kOZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MP5q6HVl; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si13555565edd.252.2020.06.26.11.17.45; Fri, 26 Jun 2020 11:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MP5q6HVl; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726424AbgFZSRc (ORCPT + 9 others); Fri, 26 Jun 2020 14:17:32 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:59798 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726013AbgFZSRa (ORCPT ); Fri, 26 Jun 2020 14:17:30 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHEtQ115231; Fri, 26 Jun 2020 13:17:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1593195434; bh=PSrVH9Vy0CJwlnXdecSsLB4MTfyMn7rqBfKHS4xMWEQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=MP5q6HVlfEWMWDTxgnPZBFc+ZU0ONGVhQAfH9uV4BxwCnzOSsFtjxF3YE7inZ8S86 n3F7BoSdOy8SXm2IaLbIZzTpdEz64KiRV5HSb7+6B7hDkohys0VOTuIWG15r2vK0im 3GswGXEtdLseMR5as4tb4WvEwa3vE0nf5O5oygqg= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHEO2004129; Fri, 26 Jun 2020 13:17:14 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 26 Jun 2020 13:17:14 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 26 Jun 2020 13:17:14 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHDXV122772; Fri, 26 Jun 2020 13:17:13 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski CC: Sekhar Nori , , , Murali Karicheri , Vignesh Raghavendra , Jan Kiszka , Grygorii Strashko Subject: [PATCH net-next 2/6] net: ethernet: ti: am65-cpsw: move to pf_p0_rx_ptype_rrobin init in probe Date: Fri, 26 Jun 2020 21:17:05 +0300 Message-ID: <20200626181709.22635-3-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200626181709.22635-1-grygorii.strashko@ti.com> References: <20200626181709.22635-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The pf_p0_rx_ptype_rrobin is global parameter so move its initialization in probe. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 82d3b1f20890..89ea29a26c3a 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -1894,8 +1894,6 @@ static int am65_cpsw_nuss_init_ndev_2g(struct am65_cpsw_common *common) netif_napi_add(port->ndev, &common->napi_rx, am65_cpsw_nuss_rx_poll, NAPI_POLL_WEIGHT); - common->pf_p0_rx_ptype_rrobin = false; - return ret; } @@ -2038,6 +2036,7 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev) common->rx_flow_id_base = -1; init_completion(&common->tdown_complete); common->tx_ch_num = 1; + common->pf_p0_rx_ptype_rrobin = false; ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(48)); if (ret) { From patchwork Fri Jun 26 18:17:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 191887 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp646989ecs; Fri, 26 Jun 2020 11:17:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVgQ8lfxJPpY9xyUVOmN3TZfKgwkoSZWCOUkxPtqhjvxytm5j4oyDbBUi4cv2ircJzp9Pr X-Received: by 2002:a17:906:7746:: with SMTP id o6mr3814586ejn.75.1593195473948; Fri, 26 Jun 2020 11:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593195473; cv=none; d=google.com; s=arc-20160816; b=vsep1aLTITOnzussNMcZ9HipU5fzxoPjeSnLiFeqI7yjUntzYzp0Q1bbaZxA4oI/Fi GNlPIuFIjYu3dez0/pAsalCKjampCrUBykU1KYh7JJ31cQU8xz9PsOH03jRB2kK4mQUE t00SIz6oFVBjnb2IGSmI/H/vmxy5sTHqOBAep4UHPvxhVB42nHcWFFDxv6D09QW+IOpg /h19/m3tbNRHD6NfgT/6Vlpvar3SFuzAUC7gT0TE1jCcTHXEshmmsN02ZLM8a9s1k6Is u2hGxFXzjPIwHxCbprhea2jFjTFfYDCXorCiM5lD70/qhoU5Ig898s8f6XH1u3UBbjXy uS4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=CxrNJvy49UltKzg8PWt+ReX2BFl8riwjabZ60O6qQNg=; b=T0x3ZoMc5siHA4Ic3nTU2I+kT1ssz1/JlNwADEPh9UaVQNdnPQFG/3LHJPcieUNurq 0CvYcGOl+63P2adBrbRyQ+KPkSPVsNY8YoA+RMTh2+iCeJ+1+5dpMLfJmuMMNLykhvxQ vARR2J/PKemfX+om79oPfm5vYDlygDYWn6eIDGVFq+zcI0DMiTZV3P56BN6QVVuAlj6C 11Gi8PEM9nN/pMTDrbMlW0lHRQYkEevgkKJZs0P3bekqD7tfHEx4JxwrgvNZkG6r/oS8 /ueJGyvUszhSigWgTxfvOb8rsX6VPiOcVPNGNFtGqaVuwwQ1vvMCJq/r0IJBIVbRTVhO CLLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=KaXcba3G; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si13555565edd.252.2020.06.26.11.17.53; Fri, 26 Jun 2020 11:17:53 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=KaXcba3G; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726402AbgFZSRb (ORCPT + 9 others); Fri, 26 Jun 2020 14:17:31 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:48598 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726378AbgFZSRa (ORCPT ); Fri, 26 Jun 2020 14:17:30 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHGIJ002416; Fri, 26 Jun 2020 13:17:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1593195436; bh=CxrNJvy49UltKzg8PWt+ReX2BFl8riwjabZ60O6qQNg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=KaXcba3GnACSHVvbXmGnlTSVdCNENiwjlio+efHBflx2KXGAOfbztH5Xmn/AiuueR SVe5/1mkQ9P1nbOoGRqwiMfu4OKxhNxNJwFJk5mXMwhvFS0/q0zfQRdCMDuJaCd0+J cyUxXyTKvfmArkmYuwuirbTVSPL3Yew2e5pM9NLA= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05QIHGKO058715 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jun 2020 13:17:16 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 26 Jun 2020 13:17:15 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 26 Jun 2020 13:17:15 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHFgQ122852; Fri, 26 Jun 2020 13:17:15 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski CC: Sekhar Nori , , , Murali Karicheri , Vignesh Raghavendra , Jan Kiszka , Grygorii Strashko Subject: [PATCH net-next 3/6] net: ethernet: ti: am65-cpsw-nuss: fix ports mac sl initialization Date: Fri, 26 Jun 2020 21:17:06 +0300 Message-ID: <20200626181709.22635-4-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200626181709.22635-1-grygorii.strashko@ti.com> References: <20200626181709.22635-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The MAC SL has to be initialized for each port otherwise am65_cpsw_nuss_slave_disable_unused() will crash for disabled ports. Signed-off-by: Grygorii Strashko --- Not critical as current driver supports one port only. drivers/net/ethernet/ti/am65-cpsw-nuss.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 89ea29a26c3a..7a921a480f29 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -1768,6 +1768,10 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common) common->cpsw_base + AM65_CPSW_NU_FRAM_BASE + (AM65_CPSW_NU_FRAM_PORT_OFFSET * (port_id - 1)); + port->slave.mac_sl = cpsw_sl_get("am65", dev, port->port_base); + if (IS_ERR(port->slave.mac_sl)) + return PTR_ERR(port->slave.mac_sl); + port->disabled = !of_device_is_available(port_np); if (port->disabled) continue; @@ -1811,10 +1815,6 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common) return ret; } - port->slave.mac_sl = cpsw_sl_get("am65", dev, port->port_base); - if (IS_ERR(port->slave.mac_sl)) - return PTR_ERR(port->slave.mac_sl); - mac_addr = of_get_mac_address(port_np); if (!IS_ERR(mac_addr)) { ether_addr_copy(port->slave.mac_addr, mac_addr); From patchwork Fri Jun 26 18:17:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 191886 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp646916ecs; Fri, 26 Jun 2020 11:17:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzS7mBNEi87PdlTvE/E3pntXIzBMrIqUJXN2OpYBaehkuuGwasaIp+y+53wrSZaYVhd7e6k X-Received: by 2002:aa7:c504:: with SMTP id o4mr4540715edq.311.1593195467588; Fri, 26 Jun 2020 11:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593195467; cv=none; d=google.com; s=arc-20160816; b=Y78NbiVTWN3SkrvUXupDu14kFvFKHSmBluMxZabAmXwC8K2ymtMIl9Ev0s7tPPQG2z FEDPqfecHyuS+zyi3hFXixWR27RxDLmoxhTqAkQCjTQiXBshU4t6Mr9x43+ig1u1Iwss rCyUyg8e47eYf+F5NMUMrGkGDymvSCDRBFHThFR7iO3pjJK5P1AEhjoNhpBwBpJ3NaJJ m+8+LEAHTlsJtP+/b/AH2aBfNUnjD0BnmwcwjSO691mcgdA4D8tpa61So5hpkIe1h5eB IBuYEaajQBxtsjtg95+lSSCc/nNx8GoOrRiaVwjzcPHNAo5gKr1ZN3Zb5dC5pA6qGpqP bmcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=phYtIIqn4y5a02HhamR20fkUSyepLjNfKvic75zwtOE=; b=oGrany77ZIu2Wn86nYxryHwFiVzmxDtXo/z7CjVFKZ3Lr3dEPX93GhUycGOqe4ob+d L1RBimWNJn9ZYrhV+PfpsFoOyjjAUacyRpbROouhToXH4Cxibzf41xxMZkL8F0zHBYwb ifRJ00QMReYFMOEHZC44Xje0rQilVircxnjtayTsP/Fsu5Su1w8p112lWTjiCvrN4Vl/ xAph6bUV9tN3KWBk3AF/UW7XEHKAr6lnvIS6BX0BYERQzYnwUZBs1jkxCDHloCK2Ja2O K9FyAlL6VsTSk0ls9EJe98S0H0r8FbLSKs5HtjnVRSAyts4lnyXvkxLbbo+VFb5GP6xz Y2eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fgF3SFL+; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si13555565edd.252.2020.06.26.11.17.47; Fri, 26 Jun 2020 11:17:47 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fgF3SFL+; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726506AbgFZSRq (ORCPT + 9 others); Fri, 26 Jun 2020 14:17:46 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:59806 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbgFZSRc (ORCPT ); Fri, 26 Jun 2020 14:17:32 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHI0L115330; Fri, 26 Jun 2020 13:17:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1593195438; bh=phYtIIqn4y5a02HhamR20fkUSyepLjNfKvic75zwtOE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fgF3SFL+v+V9x7x4iX2KJi0C2cz/f3nsgakc0bR9StRBKFmPir7nVkQgyf7KHT9yx AxJbbPQYNb8tF0bRfMPw+MJRFta3Vzgk50Zi/e8j6hMHE8cytHGByz6bPLLS5kWm2O 4Ixqjsw2BoqHp8CeTdCy1GHgsx3KRHUQunay7aJ8= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05QIHI4t058732 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jun 2020 13:17:18 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 26 Jun 2020 13:17:17 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 26 Jun 2020 13:17:17 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHGBO107617; Fri, 26 Jun 2020 13:17:17 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski CC: Sekhar Nori , , , Murali Karicheri , Vignesh Raghavendra , Jan Kiszka , Grygorii Strashko Subject: [PATCH net-next 4/6] net: ethernet: ti: am65-cpsw-ethtool: skip hw cfg when change p0-rx-ptype-rrobin Date: Fri, 26 Jun 2020 21:17:07 +0300 Message-ID: <20200626181709.22635-5-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200626181709.22635-1-grygorii.strashko@ti.com> References: <20200626181709.22635-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Skip HW configuration when p0-rx-ptype-rrobin is changed as it will be done by .ndev_open(), Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 1 - 1 file changed, 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c index 8c4690f3ebcb..f7b33875a385 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c +++ b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c @@ -741,7 +741,6 @@ static int am65_cpsw_set_ethtool_priv_flags(struct net_device *ndev, u32 flags) } common->pf_p0_rx_ptype_rrobin = rrobin; - am65_cpsw_nuss_set_p0_ptype(common); return 0; } From patchwork Fri Jun 26 18:17:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 191888 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp647044ecs; Fri, 26 Jun 2020 11:17:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdSo7eYTn+DiIMRdSZxaKd/k1Qvm8lCuHF8Dbd30JVU0A4k7BboHQLy71NsSd59xdkmsQa X-Received: by 2002:a05:6402:1d86:: with SMTP id dk6mr4780889edb.108.1593195479053; Fri, 26 Jun 2020 11:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593195479; cv=none; d=google.com; s=arc-20160816; b=lep/FlAncG4cWFbGWUfdWD3YcIHiMyI08hQqbIgNVRmnqHeo99/UTnyof991WcsdvU JOsDQiOffw0kSF/IfO9SmD/Ml0G6texPi+nh781Br/io/+z4YAGXel21AzK98aQvgDg8 7mDAQYQEafkGyJ4usao45+1A93PLgEFwxWNx+A2QY+99z2g3VdRAswEfpOHCaryC4vFD KhVUOsmoMgt+CGufkfar9PmUDPSeLbqT923Es4oha4FGYSZpPhREBNclLl4LKG1RC1rG m9ZSDXXKw+u3lH6iIDwdQysSE8ze2NxxUbYd83eNJeHbq2TzstlyCAtjeoXFniFQak1w pCEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=X1AdtspTztF0AsbIA9EqIyCbI1qi1qSf0aeaX1Wq600=; b=oHDwB9U3fHsLdzmeVfs3xB2TAqXJVxOR2BLqC54aWVfmx3pHmAWs35+v85i/tg5nbt uDuwnBcX7hruoYwcCtkJMkwl/PWHvOkCEBXygQUiG2FICSEEK26iDBjDEif+Q7H70DAA 0cLmaguyw1EiBBbZvHvAGLLRuNewN4OqpXg4SXjE88TfqmrC86wubWZtD7Z0o8zewg5o UEdtEYMZWJUfTvaoqKc8EKdv2YfAapY4+JAs8zTAfjBI+KpT95qpNfIrEZwM2g5sgF41 ByxVIKd3wUV1PCAr5eTZQLoNDqcFSAocviB0azb3aqFHqP5v5uExL0Xlb+Wq+aDLhWH8 /CAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pS7nzfvF; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si13555565edd.252.2020.06.26.11.17.58; Fri, 26 Jun 2020 11:17:59 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pS7nzfvF; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725836AbgFZSRz (ORCPT + 9 others); Fri, 26 Jun 2020 14:17:55 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:59804 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbgFZSRc (ORCPT ); Fri, 26 Jun 2020 14:17:32 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHKUt115360; Fri, 26 Jun 2020 13:17:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1593195440; bh=X1AdtspTztF0AsbIA9EqIyCbI1qi1qSf0aeaX1Wq600=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=pS7nzfvFqyrvwmju07m7Oyd6+zceLwR27lZTCbufbUafLxM0dL4B2Jcnb8dNP9wWG n/sWEragj6VJKengnFOMcmB+jPIYsGPJyJ/wyLvQx4Z3gnz4G+XAXwWfpcVM8PpNVD f+a5Og74LwjBQ5c+BYbfe/2fQH95ZzXzEt+AyBsY= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05QIHJba008680 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jun 2020 13:17:20 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 26 Jun 2020 13:17:19 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 26 Jun 2020 13:17:19 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHIXH122959; Fri, 26 Jun 2020 13:17:19 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski CC: Sekhar Nori , , , Murali Karicheri , Vignesh Raghavendra , Jan Kiszka , Grygorii Strashko 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 Message-ID: <20200626181709.22635-6-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200626181709.22635-1-grygorii.strashko@ti.com> References: <20200626181709.22635-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Ensure that critical setting can only be configured when there are no running netdevs - all ports are down. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.17.1 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"); From patchwork Fri Jun 26 18:17:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 191884 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp646882ecs; Fri, 26 Jun 2020 11:17:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxddt0YR7pXRsixCE6c+R2yktaY6XbG6Dx3s7PNe7+7sXdk4WyWo9TPCNSWGtKrU/pdPtY7 X-Received: by 2002:a17:906:1ed2:: with SMTP id m18mr3570706ejj.529.1593195464565; Fri, 26 Jun 2020 11:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593195464; cv=none; d=google.com; s=arc-20160816; b=MFx++DgEOzcYimxURcjKWn47gfBpuZ+DndxdFCC7q25QHNGQu6FXonfIeI9EecVQu8 azthR/1gTvyMc1a21o/io8+QPMMDdQpHwfXpihbeQ5lLu+dMfaPN9ol79bVt7+s7JVkq SFgcwuBFsOupE8sfdfYW6y1mGO6yDJsmum6lLEjIavwRImp9ZqJ3OV4KpP1PkxqBLhVC 1AizTEBFbnwvEk3qjPffuEwRAd7zTjhlnG1lgD8GPkIaOsaRHJyJFCms1Iod3HXUrrvI xkRDDOZhvxTy8ZfWcsf1i8hYuVoEk5E2+1jqxnb9/HMDrynrAUuaCzQplXnwcqB2X9p9 MavA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=BNg+DQH/3TSrqnuqngB8EXZIV8fz3RCqpdutiE3KweQ=; b=LVya6FfRLuumWUJGz+OWG6nTD8AkdCFo/VQ4prwxi6JQxe+45StXda08OUcc8bK/oq f9FnqTwA1jiwxSmqLC9rCRB8qKhKqa3SrKBywvGyLLXCoBxBnfndpkQvozxyOW47Eosa LJGUdkbNrFYATR9MeuWnEzPMBTlGwu8fwgV/ZWym9QmDYEryg2u7oQCBXmqoRWRaCqs+ cfqLF0Czz0ZghrslR+VQ9n8Dj2WqYvMCBHj04262vDqvm/qdQC1LIDSbSPWLWvfjQmn5 PlV6vNC6l/K7PmGQS9Widtp73Zz5spcfOuzAh9M/Ef3+baEpxUNfLnguWVRQ9EMzkrbH UYew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=igXLvPGb; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si13555565edd.252.2020.06.26.11.17.44; Fri, 26 Jun 2020 11:17:44 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=igXLvPGb; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725994AbgFZSRj (ORCPT + 9 others); Fri, 26 Jun 2020 14:17:39 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:48620 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726416AbgFZSRe (ORCPT ); Fri, 26 Jun 2020 14:17:34 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHLZ1002436; Fri, 26 Jun 2020 13:17:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1593195441; bh=BNg+DQH/3TSrqnuqngB8EXZIV8fz3RCqpdutiE3KweQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=igXLvPGbyjxH+HFjg2vIA5Gby6uJ8R/ukJ4qN28rnhHe4QQNNPEVKscRbnLXLOrAa GX2hlYKwGhINjUajwP3/VEemWYQVRRUHRGz7n8e/WbpJvowoxSECg14RVoFLZo73At rIqsxgOD2O2Mosipsy5tfFsz2/tRGlSoPubpEj/c= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHLhW004381; Fri, 26 Jun 2020 13:17:21 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 26 Jun 2020 13:17:21 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 26 Jun 2020 13:17:21 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05QIHKcE081657; Fri, 26 Jun 2020 13:17:21 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski CC: Sekhar Nori , , , Murali Karicheri , Vignesh Raghavendra , Jan Kiszka , Grygorii Strashko Subject: [PATCH net-next 6/6] net: ethernet: ti: am65-cpsw-nuss: enable am65x sr2.0 support Date: Fri, 26 Jun 2020 21:17:09 +0300 Message-ID: <20200626181709.22635-7-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200626181709.22635-1-grygorii.strashko@ti.com> References: <20200626181709.22635-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The AM65x SR2.0 MCU CPSW has fixed errata i2027 "CPSW: CPSW Does Not Support CPPI Receive Checksum (Host to Ethernet) Offload Feature". This errata also fixed for J271E SoC. Use SOC bus data for K3 SoC identification and apply i2027 errata w/a only for the AM65x SR1.0 SoC. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 47 ++++++++++++++++++++---- drivers/net/ethernet/ti/am65-cpsw-nuss.h | 2 +- 2 files changed, 41 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 7a921a480f29..9fdcd90e8323 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -148,10 +149,11 @@ static void am65_cpsw_nuss_get_ver(struct am65_cpsw_common *common) common->nuss_ver = readl(common->ss_base); common->cpsw_ver = readl(common->cpsw_base); dev_info(common->dev, - "initializing am65 cpsw nuss version 0x%08X, cpsw version 0x%08X Ports: %u\n", + "initializing am65 cpsw nuss version 0x%08X, cpsw version 0x%08X Ports: %u quirks:%08x\n", common->nuss_ver, common->cpsw_ver, - common->port_num + 1); + common->port_num + 1, + common->pdata.quirks); } void am65_cpsw_nuss_adjust_link(struct net_device *ndev) @@ -1877,7 +1879,7 @@ static int am65_cpsw_nuss_init_ndev_2g(struct am65_cpsw_common *common) port->ndev->ethtool_ops = &am65_cpsw_ethtool_ops_slave; /* Disable TX checksum offload by default due to HW bug */ - if (common->pdata->quirks & AM65_CPSW_QUIRK_I2027_NO_TX_CSUM) + if (common->pdata.quirks & AM65_CPSW_QUIRK_I2027_NO_TX_CSUM) port->ndev->features &= ~NETIF_F_HW_CSUM; ndev_priv->stats = netdev_alloc_pcpu_stats(struct am65_cpsw_ndev_stats); @@ -1981,21 +1983,50 @@ static void am65_cpsw_nuss_cleanup_ndev(struct am65_cpsw_common *common) } } +struct am65_cpsw_soc_pdata { + u32 quirks_dis; +}; + +static const struct am65_cpsw_soc_pdata am65x_soc_sr2_0 = { + .quirks_dis = AM65_CPSW_QUIRK_I2027_NO_TX_CSUM, +}; + +static const struct soc_device_attribute am65_cpsw_socinfo[] = { + { .family = "AM65X", + .revision = "SR2.0", + .data = &am65x_soc_sr2_0 + }, + {/* sentinel */} +}; + static const struct am65_cpsw_pdata am65x_sr1_0 = { .quirks = AM65_CPSW_QUIRK_I2027_NO_TX_CSUM, }; -static const struct am65_cpsw_pdata j721e_sr1_0 = { +static const struct am65_cpsw_pdata j721e_pdata = { .quirks = 0, }; static const struct of_device_id am65_cpsw_nuss_of_mtable[] = { - { .compatible = "ti,am654-cpsw-nuss", .data = &am65x_sr1_0 }, - { .compatible = "ti,j721e-cpsw-nuss", .data = &j721e_sr1_0 }, + { .compatible = "ti,am654-cpsw-nuss", .data = &am65x_sr1_0}, + { .compatible = "ti,j721e-cpsw-nuss", .data = &j721e_pdata}, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, am65_cpsw_nuss_of_mtable); +static void am65_cpsw_nuss_apply_socinfo(struct am65_cpsw_common *common) +{ + const struct soc_device_attribute *soc; + + soc = soc_device_match(am65_cpsw_socinfo); + if (soc && soc->data) { + const struct am65_cpsw_soc_pdata *socdata = soc->data; + + /* disable quirks */ + common->pdata.quirks &= ~socdata->quirks_dis; + } +} + static int am65_cpsw_nuss_probe(struct platform_device *pdev) { struct cpsw_ale_params ale_params = { 0 }; @@ -2014,7 +2045,9 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev) of_id = of_match_device(am65_cpsw_nuss_of_mtable, dev); if (!of_id) return -EINVAL; - common->pdata = of_id->data; + common->pdata = *(const struct am65_cpsw_pdata *)of_id->data; + + am65_cpsw_nuss_apply_socinfo(common); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cpsw_nuss"); common->ss_base = devm_ioremap_resource(&pdev->dev, res); diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.h b/drivers/net/ethernet/ti/am65-cpsw-nuss.h index 9faf4fb1409b..94f666ea0e53 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.h +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.h @@ -82,7 +82,7 @@ struct am65_cpsw_pdata { struct am65_cpsw_common { struct device *dev; struct device *mdio_dev; - const struct am65_cpsw_pdata *pdata; + struct am65_cpsw_pdata pdata; void __iomem *ss_base; void __iomem *cpsw_base;