Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3858700imw; Thu, 7 Jul 2022 08:38:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u1wA1fVyNhCjwmLBVKViqQOzuFRe9ccXMy28MbwrXcfHNILz+5Lad6G4MBrai5HIFcBJ4W X-Received: by 2002:a05:6402:5412:b0:435:5997:ccb5 with SMTP id ev18-20020a056402541200b004355997ccb5mr61401470edb.167.1657208329559; Thu, 07 Jul 2022 08:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657208329; cv=none; d=google.com; s=arc-20160816; b=dncv524Sx5sbpYxCE+T1iv4gDhb+1xfvBJOoCBYSPGVkL/P5zQWHPnEQ2Nh8cZVp2R cu8EPE7nnTWU10y3QUYTxBSxx6Wig5d5Xn8BXE5kh4k6uHIRpV1Q/5usOAquO4B4wIPm vuRcS3jzoWPyDvz9gn+/CLDuvb7oQVFJ3741lGDR3K7RmNyBtfYGbE1LYX6t5mMYtPN3 8ySCM5N4VW113XzgJaDllaPNA0pxzAUADGBTcMFg1pH7eYCONwrXhb0+l775T3rG7hS6 ds443AS4x78CMLWnXqIKgAcrYl+s3erY3tWa9keuh4tjNrQQKJpjxBUlmkgjV1W4jG7g DQag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=eeLhqIP2MsCYexr/0dS9s+ND5mThvcFs1kMlQh/auhU=; b=LaBf0+QRPemuiMwnLZiBQwnjN0EudFgnuk+U2ZHNDzFLawfvDPtVQq94FZpJNm30+J w8+rlbeX/dJXZIPg7MdpG2Vru9nVjcYR8fR6NrsQNyYoyfS3ZKrFHcryIE137rBzSEzb gFTsLLc07IWlEYfm4TG+G9fXWlSaNd5HgNrOIxVsGxk9vbYTnmJdKyVxUZDbDG5oMWm6 VDVQqRFBnLHPlqSQrrUicwdoxgJ9PhXOtXuCU8wfsmaggVFNlYxpwjO8EsxDQ0o/Y46j UgktN1fR9zhQYCVCqHWq4gsPJpvW29TxT5AhjAdy56+Xz6W/GoFIllrYPvRewWAZ1Svq WkEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv19-20020a17090760d300b0072a6e49d3a2si2075186ejc.852.2022.07.07.08.38.24; Thu, 07 Jul 2022 08:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236137AbiGGPaQ (ORCPT + 99 others); Thu, 7 Jul 2022 11:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236054AbiGGP3y (ORCPT ); Thu, 7 Jul 2022 11:29:54 -0400 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFC851902A; Thu, 7 Jul 2022 08:29:53 -0700 (PDT) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id 961281886E77; Thu, 7 Jul 2022 15:29:52 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id 8D1CF25032B7; Thu, 7 Jul 2022 15:29:52 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 88EA3A1E00B9; Thu, 7 Jul 2022 15:29:52 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 Received: from wse-c0127.vestervang (unknown [208.127.141.28]) by smtp.gigahost.dk (Postfix) with ESMTPSA id 2E5869120FED; Thu, 7 Jul 2022 15:29:51 +0000 (UTC) From: Hans Schultz To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, Hans Schultz , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Daniel Borkmann , Ido Schimmel , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: [PATCH v4 net-next 4/6] net: dsa: mv88e6xxx: allow reading FID when handling ATU violations Date: Thu, 7 Jul 2022 17:29:28 +0200 Message-Id: <20220707152930.1789437-5-netdev@kapio-technology.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220707152930.1789437-1-netdev@kapio-technology.com> References: <20220707152930.1789437-1-netdev@kapio-technology.com> MIME-Version: 1.0 Organization: Westermo Network Technologies AB Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,FROM_FMBLA_NEWDOM, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For convenience the function mv88e6xxx_g1_atu_op() has been used to read ATU violations, but the function has other purposes and does not enable the possibility to read the FID when reading ATU violations. The FID is needed to get hold of which VID was involved in the violation, thus the need to be able to read the FID. Signed-off-by: Hans Schultz --- drivers/net/dsa/mv88e6xxx/global1_atu.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa/mv88e6xxx/global1_atu.c index 40bd67a5c8e9..5d120d53823c 100644 --- a/drivers/net/dsa/mv88e6xxx/global1_atu.c +++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c @@ -114,6 +114,19 @@ static int mv88e6xxx_g1_atu_op_wait(struct mv88e6xxx_chip *chip) return mv88e6xxx_g1_wait_bit(chip, MV88E6XXX_G1_ATU_OP, bit, 0); } +static int mv88e6xxx_g1_read_atu_violation(struct mv88e6xxx_chip *chip) +{ + int err; + + err = mv88e6xxx_g1_write(chip, MV88E6XXX_G1_ATU_OP, + MV88E6XXX_G1_ATU_OP_BUSY | + MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION); + if (err) + return err; + + return mv88e6xxx_g1_atu_op_wait(chip); +} + static int mv88e6xxx_g1_atu_op(struct mv88e6xxx_chip *chip, u16 fid, u16 op) { u16 val; @@ -359,8 +372,7 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) mv88e6xxx_reg_lock(chip); - err = mv88e6xxx_g1_atu_op(chip, 0, - MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION); + err = mv88e6xxx_g1_read_atu_violation(chip); if (err) goto out; -- 2.30.2