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);