Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp2032654rwe; Sat, 15 Apr 2023 10:07:31 -0700 (PDT) X-Google-Smtp-Source: AKy350b3IM2qPAQQ9fDAxSdienN4Y1hESlFofRPZBkrQeqIiTtyHdu/TQ0VozumBbyHR24R6fblh X-Received: by 2002:a17:90b:897:b0:23f:5fe7:25a1 with SMTP id bj23-20020a17090b089700b0023f5fe725a1mr9668697pjb.13.1681578451711; Sat, 15 Apr 2023 10:07:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681578451; cv=pass; d=google.com; s=arc-20160816; b=lRYBgsiu1QFuPEfOs6beb8AYEqf9yMDmq2kWl3KjU/45KPAKIPDuSq2enu3IdYmnI3 6O+7JzCpu/jdMPjeWkL9Ox4CaxWMzxenj6Mqy3RADj28QnCGIb6gA69JcN8s2VFQKiNl 5D3XEw/KfoRhyGA78ZMYvxGRWVsAtkRrIbt+L3VZ2NSYA5Ba/4dzpbUng0wBPkFgdSDI LV63Lry0HplFgdeSoicmp/88UMLN58YzzRpGzLC20F31YL8tIFMmr+HmZVwwlO1ILxv/ rcxU73dfCFL2H3p8NZ7KhFcPYnfTGgMuInPnlXIcuuRV2HDH9aeHxNPeJipIdqinoPcz 6uvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=o7XO6Vv3Pdc+N+MCXSftnkk0NDi/KSFwnsmEPh6i+7A=; b=hrVpUOjTWK7UyvhH72JEkrHp6DpvrvF1uPczOiukhbigSXr/+YkIhaGqd1TZyxZQul 5nsN6e9dKuPSsKFihJI5CLA5G9JPpq2v4z8s3cc8GN04tHiQ3sdgr+9RfS9vPVhj+iYj pVjfVFCiJdgRxKHV++lGOeHKtnJzIwG/ptF/msWPTl+XmarUfzB2dWLRLxL+NOVc4h00 L0q5Kpq8kWRIos0TJ50Xr7iGRjet3Epig0KhIel2R1Ss0l+54pTPgPf63FnFZjX21j59 xf2+aQfnZjlmnhG4KnoXqP7Ukr0tJYeFe+hqtblKnreDW0v7DPsVGptU4SwfkGUl8Ym1 j0zA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=OTlUpyO4; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a17090a178f00b002468f910624si7428328pja.116.2023.04.15.10.07.20; Sat, 15 Apr 2023 10:07:31 -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; dkim=pass header.i=@nxp.com header.s=selector2 header.b=OTlUpyO4; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230183AbjDORGf (ORCPT + 99 others); Sat, 15 Apr 2023 13:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230145AbjDORGQ (ORCPT ); Sat, 15 Apr 2023 13:06:16 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2051.outbound.protection.outlook.com [40.107.105.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A88B30C6; Sat, 15 Apr 2023 10:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GgGpYkWVzmYwabqg/1WYzdhPwqfyRVQNArLDwF60u05x2dHsaC41Eb+NclXiymJ5AcgqSZR1TWJclmJDuSSfOgZSSHn8csBXfEsLmJh1T5IT80lPR2RHjc5CE73s31t+gX55vWedaIpz3PAVzTcE8gYTYl7dp8mwXaMGXkELki8Z5IE0lXM+9Jr2JZw9/fKbDYbJLEm403dgEwFY1/dQx8b4QJSsRtcEhk5ms785Fukg7ejN/PLlAtXHZhjID8efd0OVi1Ej3Vf3KSygrL5eHAX+z+MyvJ++37Z/REZpYPfLz2jMGbrn3xJ/KrBeFRmvKuEppgN+MmjlV8pHlBQXpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o7XO6Vv3Pdc+N+MCXSftnkk0NDi/KSFwnsmEPh6i+7A=; b=muG0TLHQlxUGhekyU60PPL33uzJQpp1L5ddJ7Mn6uJxOfB28hLqG2KLJ1yOR9/l2EJdBN42zU3MBnUb1myx+J6hnEjgnNFVcCXu9IM8F4oIf/1fuQmo22oApcPAquXtDvcpJOvsbGX+0be4BZrqd1rukQ8tHqrDJcn+WwDm5BCZwpg56ulo0ud+v+eEyVBeAfU7Wr5SzusZuZaPt1+thfLfAIad5OiALNoVtN7XWqz7D3xfZqEU2IA2a4xvr/DW97nqNJdO5UBWSsl3Hp3y5JMOGUme8qLoAGcUL+kUR5VdViLTTH+YX7/J1C+hAqhUOQg+/iVT5FDEBNA60B9pu/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o7XO6Vv3Pdc+N+MCXSftnkk0NDi/KSFwnsmEPh6i+7A=; b=OTlUpyO4OEVWyqbA1ZJguYyBlVoj4geH+JTZMwdmZxvmPllpPbSbEnVO3ImP96dWBnst+VGNwBPBnMoE7J57wuM6ecZZs24gP8+29RKn1RBOSC6wByoWArmfIPNSkDyAA6T9CwLiloPZU/2y55jQL1hpu2vZhdlJC1GY1HghNyQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by PAXPR04MB8158.eurprd04.prod.outlook.com (2603:10a6:102:1c3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Sat, 15 Apr 2023 17:06:07 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Sat, 15 Apr 2023 17:06:07 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Xiaoliang Yang , linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/7] net: mscc: ocelot: don't rely on cached verify_status in ocelot_port_get_mm() Date: Sat, 15 Apr 2023 20:05:48 +0300 Message-Id: <20230415170551.3939607-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230415170551.3939607-1-vladimir.oltean@nxp.com> References: <20230415170551.3939607-1-vladimir.oltean@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: FR0P281CA0100.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::6) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|PAXPR04MB8158:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f5aeac5-eba5-41f7-605b-08db3dd3b3fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VBrHHg/eUkVh/WCtBwtKNRiFlCCQqxLa4uX/PkyItxjL6a7mBwZuCqF84P0SAZUDhVF9pfl+rWgv7BLgmIVhDN7w6iSMLlqnVcY0LLI0/Qt/c3RJsm5xSyW9WkZKepnI2/+rTl2edDqXqGMdDa09wuL61ybXhjn6kwEHlCzZQnxI7efc3NLkixyROrloy0KXs+fQZJnfThASUAtm7UJ3i3o50VgX4axDxoDyIe8042aNb++9oaMhfMzLLmCSvmKpNkyuJSeXYeP8YoDr2QbnCwEkJm6lfr43YWCcmMxZwNvVGeOWZunVb/jV3mirAIJQCiTQhsTBk04YYvQT2vabG9B87nqXEWgYyeKDdMZCal13TDxuurleTbWV1kaH4suKixOeIBVFbYRgVh4N8Ls5PHcpfHJmwxPSS4GfpyMsX2PenGpe/HsdZcgQL/GR83nNHP861yjJgJUZmjz953FKD5cBM4pmCDDLLKCdzuPHuhdnwaMWwvpdfEEHN3VURKvEUx5cjC9Vrt8XOnzWIknPFuZQ789Zyzp1WRF6B/ZKTKN1ishESqeh0FsfNQ4jlPgz7+BlhT2nG067CpzwC7SUrfjU4SGTEbWcJDMyvaF3GNgq4YDaMJ/Jw1yg/q5wIV4d X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199021)(316002)(4326008)(38100700002)(38350700002)(6916009)(66556008)(66946007)(66476007)(5660300002)(44832011)(2616005)(6666004)(52116002)(36756003)(86362001)(6486002)(41300700001)(54906003)(1076003)(186003)(6506007)(26005)(6512007)(66899021)(2906002)(8676002)(7416002)(8936002)(83380400001)(15650500001)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mESD1yvV6b8ZtZIHgqzPqEqWIlYoUJiLLfL4bfxI3eCJVfD7xB7ZnCECTu4c?= =?us-ascii?Q?yFpjdjMCI9sbTFC8W51HXfOAK8I7wdYVnOrAEZV4rMmCz5pnZQFdaMn+yYAJ?= =?us-ascii?Q?OkJ+N6JC5crKDNIx+/d5uJeuOoGMT612pw220vFvADrw912R1LPqLtw01B3E?= =?us-ascii?Q?Sz6GzWdrUOkS1/h5owLjwQ4JQLseulo3k5X3B/KlKK1kiZ9D+xIexK+orPqV?= =?us-ascii?Q?bI2vhnXgY2mPSIBOEeDIbFKVqdttjRoboUjjTb/W1UZ5pd0IGsnTn0HMhThG?= =?us-ascii?Q?nhsWN5IEvlyomnU3dKHUBdP0va3QmqJVJQ56MnoFBnQJ1KojyS+HThh9xC92?= =?us-ascii?Q?CjHQiAhWdDRJDz36pZ5xQCM9D0YOVs860+HLswuTDAmRY7s94cOm7WSy4pLt?= =?us-ascii?Q?nNdg6+oyEaHjcRnexLLHx8moBKqKnIcszooAA+t4leg1c7K8Ncg3TOd/nSZO?= =?us-ascii?Q?87bOFnfrcw54fY+L62fgqYRl06rjfhz06xfXMBbOFvYTtgep8n2tHZsDxJw7?= =?us-ascii?Q?2lL+iRAfTNMM9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c5LcUGHK?= =?us-ascii?Q?7BDAH7uoKV8axSCG4bZHrKMbVXIhFAE1/zsZ4ha1QRptY6XTqb1fqybeSOj3?= =?us-ascii?Q?SRyQBmu3whBc7NAN4RltSp4epN15fdeo6esEbHoP6FvL4qUWgVBW7OMqQ0re?= =?us-ascii?Q?0qvAuirfY0p/NKdEQvWJdVNBuU6WYVtM3WGMxsbqbcXLb8bXsyPNfZCGa80s?= =?us-ascii?Q?KQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f5aeac5-eba5-41f7-605b-08db3dd3b3fb X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2023 17:06:07.1686 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8h1JB32CE59SiZ4ttXjyZcESPbbldgJmqqheqEYwx+3oP2YNSdq1N1v+MpR7aYkyttYwyZdIVtsSvWaaj3xtPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8158 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 ocelot_mm_update_port_status() updates mm->verify_status, but when the verification state of a port changes, an IRQ isn't emitted, but rather, only when the verification state reaches one of the final states (like DISABLED, FAILED, SUCCEEDED) - things that would affect mm->tx_active, which is what the IRQ *is* actually emitted for. That is to say, user space may miss reports of an intermediary MAC Merge verification state (like from INITIAL to VERIFYING), unless there was an IRQ notifying the driver of the change in mm->tx_active as well. This is not a huge deal, but for reliable reporting to user space, let's call ocelot_mm_update_port_status() synchronously from ocelot_port_get_mm(), which makes user space see the current MM status. Signed-off-by: Vladimir Oltean --- Diff: patch is new. drivers/net/ethernet/mscc/ocelot_mm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mscc/ocelot_mm.c b/drivers/net/ethernet/mscc/ocelot_mm.c index ce6429d46814..3e458f72f645 100644 --- a/drivers/net/ethernet/mscc/ocelot_mm.c +++ b/drivers/net/ethernet/mscc/ocelot_mm.c @@ -205,6 +205,7 @@ int ocelot_port_get_mm(struct ocelot *ocelot, int port, state->tx_min_frag_size = ethtool_mm_frag_size_add_to_min(add_frag_size); state->rx_min_frag_size = ETH_ZLEN; + ocelot_mm_update_port_status(ocelot, port); state->verify_status = mm->verify_status; state->tx_active = mm->tx_active; -- 2.34.1