Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3858534pxu; Tue, 20 Oct 2020 02:16:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN5oiwjflD17blYRvjWLUJK7SK5zNvWPuoabdGdXQJ9vt9jnSp+in8SW7JrESp1xAIGizQ X-Received: by 2002:aa7:c6cd:: with SMTP id b13mr1884718eds.32.1603185393214; Tue, 20 Oct 2020 02:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603185393; cv=none; d=google.com; s=arc-20160816; b=cW3kz8wDwy+teKddVIGSJgFWzYWXxqUbeMXW3t6tcHTgUwxwUFEgOgp9lLW7qYEetm lGSW9dkMn2qQpgZBi09YoZkf7WHho8tBjIUpaeOnfXxC4Bn89kgb7XqCjhNhZo6NZjF4 L1a8kX+bDxpvUCrYdz18mEPwMATHwvZ42w08J+rCSTczGnMggwCcVlfYx7Fzqu3TQ8Vb hqi1oZc5slxM/OgeebB5D+bQ39D1ACePvwHK6ztrikSHcsXdLQGcQWZE5os1anJOdw90 l+/QmHxdHdvyiR1OkMXgZOerPHRBHiSV+W3ax+i1uZj+41ziMcFOzyZJCGD4YoTRZgu8 b/NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DRng7TBazrBB0TH/cxu/re8Syh3uFw1RCXUxNX3nLHk=; b=D5unGfsEF6DUYqffXkjxeFICg8aGJhNcRQo5mhwa/oqUcgGK+Tv5nEp0tNHwreQQBJ zWX13/Qg8tkmX4tqsREmSoFXcNupYyAQQLIfiM+vwhyYd7DXYT0OEpg7b/iNax35wVRq GcXu+ijOjO/CjOz8M0W/xEfOg1tobcDpsQXM4ZUyLneciro+wvumFYIwJ4tF24qrrcu0 G0H+aCxozoeq+7/vRzPAitjBPKFFI1VHguv4BdgAfkN4WS/BufideZItGEj75moty3KL iQui+LzjzlHUP40h7F2QsMF24j+z3Y4MVayTp/K7PQHJhr7I14oLuAUWMBOVtZ3Q7kVD rQKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=Fn9aeH1L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss5si839100ejb.737.2020.10.20.02.16.10; Tue, 20 Oct 2020 02:16:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@alliedtelesis.co.nz header.s=mail181024 header.b=Fn9aeH1L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391206AbgJTDqG (ORCPT + 99 others); Mon, 19 Oct 2020 23:46:06 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:33457 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391205AbgJTDqF (ORCPT ); Mon, 19 Oct 2020 23:46:05 -0400 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id DD94C806B7; Tue, 20 Oct 2020 16:46:02 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1603165562; bh=DRng7TBazrBB0TH/cxu/re8Syh3uFw1RCXUxNX3nLHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Fn9aeH1L0aZwM1i+ct1HrPskOAJ+cfk9i2n+XUbgkRQt10iCK2Z26/Wkw4hP6vbnm kIL24ennOp4FcVwbyDLVxFXm1hQsNOS+pzXRvkBU7KTHNzmQCPHWxjdhQIGXNnYBA6 eBdqk/P2hDxFerch4fwEcV8yzzFoG+3bhGVD5AvdHoiaTAtliAvY0qYO9RHl3k8+Cv tORb7+bC7pjZxzvgESWOJvJVeR5n34InCDOpjEp8Hxb1YCApFlH7PHXOEurbwKcfgv HRO6bRvwKTSX1oTlUYSS37nfJBe0If3h8x4ZrK7VzV1MJ6XmS7TSOecTH4UkEpU9lP qmJjgk9Egiihw== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Tue, 20 Oct 2020 16:46:02 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.20]) by smtp (Postfix) with ESMTP id 6E47213EEBB; Tue, 20 Oct 2020 16:46:02 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id B95D1283A9C; Tue, 20 Oct 2020 16:46:02 +1300 (NZDT) From: Chris Packham To: andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, kuba@kernel.org, linux@armlinux.org.uk Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Packham Subject: [PATCH v3 1/3] net: dsa: mv88e6xxx: Don't force link when using in-band-status Date: Tue, 20 Oct 2020 16:45:56 +1300 Message-Id: <20201020034558.19438-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201020034558.19438-1-chris.packham@alliedtelesis.co.nz> References: <20201020034558.19438-1-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable x-atlnz-ls: pat Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a port is configured with 'managed =3D "in-band-status"' don't force the link up, the switch MAC will detect the link status correctly. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn --- Changes in v3: - None Changes in v2: - Add review from Andrew drivers/net/dsa/mv88e6xxx/chip.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx= /chip.c index f0dbc05e30a4..1ef392ee52c5 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -767,8 +767,11 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch = *ds, int port, goto error; } =20 - if (ops->port_set_link) - err =3D ops->port_set_link(chip, port, LINK_FORCED_UP); + if (ops->port_set_link) { + int link =3D mode =3D=3D MLO_AN_INBAND ? LINK_UNFORCED : LINK_FORCED_= UP; + + err =3D ops->port_set_link(chip, port, link); + } } error: mv88e6xxx_reg_unlock(chip); --=20 2.28.0