From patchwork Sat Apr 15 17:05:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 83748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1149963vqo; Sat, 15 Apr 2023 10:07:45 -0700 (PDT) X-Google-Smtp-Source: AKy350bMXWsLyoySQ/CzmFze8dZaMcw8Gbwk8PliTVrcnpO2C6UODy30UIG0wbw0WjKmaOx+lCBq X-Received: by 2002:a05:6a21:328a:b0:ec:5ba5:8a73 with SMTP id yt10-20020a056a21328a00b000ec5ba58a73mr13138376pzb.26.1681578465618; Sat, 15 Apr 2023 10:07:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681578465; cv=pass; d=google.com; s=arc-20160816; b=hmr6cLgD8Hy926700p45Tl1Qr6cOOfsB+l73OrZL/62BSsLo3X4+h1+CB7wuAR3qpd kp1VrPPZJuEOC3vwLAN7FHPAKkRf1W5svdTlW53sI7MwfDeMX/OebXhztFerP3Oipzzu 6DRVeIzocbx9vW/+QYcRv6XR0fZ+jbySkjHEJ6RjF7tOAGzw3L3qheOGjBwViWEXg8Ln Na3Y2p4UZYPv6hE62wN0vMLvWOFUC43VD6lPB5PMmTKOiZ74CX8nrvC0LfwMAbHUatVp aacWE4JEbb1KxM+JxxVE0Z/FkBNGmxp13V6/k/WLc+uT71+lPvoY5ynn3o1o5xE5tBik mAag== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a6566c6000000b005131132cb02si7269826pgw.678.2023.04.15.10.07.33; Sat, 15 Apr 2023 10:07:45 -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 S230184AbjDORGg (ORCPT + 99 others); Sat, 15 Apr 2023 13:06:36 -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> 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: mESD1yvV6b8ZtZIHgqzPqEqWIlYoUJiLLfL4bfxI3eCJVfD7xB7ZnCECTu4cyFpjdjMCI9sbTFC8W51HXfOAK8I7wdYVnOrAEZV4rMmCz5pnZQFdaMn+yYAJOkJ+N6JC5crKDNIx+/d5uJeuOoGMT612pw220vFvADrw912R1LPqLtw01B3ESz6GzWdrUOkS1/h5owLjwQ4JQLseulo3k5X3B/KlKK1kiZ9D+xIexK+orPqVbI2vhnXgY2mPSIBOEeDIbFKVqdttjRoboUjjTb/W1UZ5pd0IGsnTn0HMhThGnhsWN5IEvlyomnU3dKHUBdP0va3QmqJVJQ56MnoFBnQJ1KojyS+HThh9xC92CjHQiAhWdDRJDz36pZ5xQCM9D0YOVs860+HLswuTDAmRY7s94cOm7WSy4pLtnNdg6+oyEaHjcRnexLLHx8moBKqKnIcszooAA+t4leg1c7K8Ncg3TOd/nSZO87bOFnfrcw54fY+L62fgqYRl06rjfhz06xfXMBbOFvYTtgep8n2tHZsDxJw72lL+iRAfTNMM9Z0wkSvU7Zn1r2hDnT5ZQd39Q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ossTenant-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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763262820881350915?= X-GMAIL-MSGID: =?utf-8?q?1763262820881350915?= 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 Reviewed-by: Florian Fainelli Reviewed-by: Simon Horman --- 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;