From patchwork Tue Sep 13 17:28:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Thompson X-Patchwork-Id: 1677382 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=Lcsjoj+f; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MRr6M3Lq3z1ynm for ; Wed, 14 Sep 2022 03:28:42 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oY9i6-0004R8-28; Tue, 13 Sep 2022 17:28:34 +0000 Received: from mail-bn7nam10on2050.outbound.protection.outlook.com ([40.107.92.50] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oY9i3-0004PM-Fk for kernel-team@lists.ubuntu.com; Tue, 13 Sep 2022 17:28:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SEo4tlN0BJ7vm3dy1U44o5zp2gk77bAnl2CJFkDcuIly5MCxpyDF9te8x8RlI3HpkfxIyPenUO2WYf+e6RCbzOwk3EQvPfnRBKZujL37wUvek0rBC76M55DIFh8BqPPZ67isC5yn+Sk+VFf3KNlUZ0hEKyNMlQfoy/DGf5Je7ql7C4UfU8SBsyMngEwJkIKGJ4aNtLJui+4h3RF+RNh2UMXcmaPi4VcDmKNdDTL9CKcNH89MclTYclYkAHQQecHrGdzeDclrc0IG+9YJ8kTlY8vXr4DB+cS+53uVTNTJlrIg1ND/+i4wyq7OkCHailCj3/Y3ZtlnAZ25eeq85pTgbw== 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=eg+mrxXUSzRPwcPActTyre3TyP2F76837lrE6OG4eN8=; b=jURcRlA0GWE3NRtEk29VOWCD2RWdve+aBqNqSjyKq+dl3I0F9l68f+AHv9jKKNES9JvyD98cbngrYEwcBRDDKCXjZZ9qwgcKjQPqhkzW8RpTQU5i7fsL1yyoS1XB2fhF5xX7xCoa/cY05SzjtZ24hK/i0UyKZO8tvxd1AiXQtGLeHUdkne/qkInP7wT3DhuZiJkrHt9b1Igtj3oK/huf8ICcArfCmzpaje1Ja3jioSIb04Xx60VMUnW09xr1Y505XSf7evwZqCJE8juYdA1LYHeY9pDCNw59K1gPJEEpw753/c5QkjuL/kIr5K0BiBQvQZUrnftRs8xoKyQOCnAxdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=lists.ubuntu.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eg+mrxXUSzRPwcPActTyre3TyP2F76837lrE6OG4eN8=; b=Lcsjoj+f18grUB3h+Ja0QHBldVD7lv1NGewzsBOElqc/O5FFZkFktwO+8U0ONPlFeYX4gT74eO5/js2EPEj7dcadT9s/9zgWzzCpObUPMVIoWU4Sh6Ta1ihiJcozEUkXRbujEVRDDs/vDvtMnoz9TQaaVgt45w50GMxFSGc8/zZZyAfnmV91PqBOkJv9ACwPsRpoBkm3/9zP0Xje6Mql207W7qT9kRJ7LEU4XObOpdbfP2WxYnEowjjVaj5WiqVtATt6DQXL+a85AqbkD8xmyK8Sxj6F2JYbrDPx4SJNiYjlaobs82IqR+wajkZAoLB3BwHxn4OQNe5YaUbYdsTemw== Received: from DM6PR11CA0012.namprd11.prod.outlook.com (2603:10b6:5:190::25) by BY5PR12MB4259.namprd12.prod.outlook.com (2603:10b6:a03:202::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Tue, 13 Sep 2022 17:28:29 +0000 Received: from DS1PEPF0000B076.namprd05.prod.outlook.com (2603:10b6:5:190:cafe::ce) by DM6PR11CA0012.outlook.office365.com (2603:10b6:5:190::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.15 via Frontend Transport; Tue, 13 Sep 2022 17:28:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by DS1PEPF0000B076.mail.protection.outlook.com (10.167.17.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5612.10 via Frontend Transport; Tue, 13 Sep 2022 17:28:28 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Tue, 13 Sep 2022 17:28:28 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 13 Sep 2022 10:28:27 -0700 Received: from vdi.nvidia.com (10.127.8.14) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Tue, 13 Sep 2022 10:28:26 -0700 From: David Thompson To: Subject: [SRU][F:linux-bluefield][PATCH v1 1/1] UBUNTU: SAUCE: mlxbf_gige: clear MDIO gateway lock after read Date: Tue, 13 Sep 2022 13:28:13 -0400 Message-ID: <28b1a325f882c6b4e4ae1010cfa8414d7c65901c.1663089691.git.davthompson@nvidia.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000B076:EE_|BY5PR12MB4259:EE_ X-MS-Office365-Filtering-Correlation-Id: 1dd5ebce-2adf-40c7-0d23-08da95ad5f41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e/m6lyPCFgwcMWolOWIu/jxBXxlL0MWR4rHIZ+6A0hQK86Nk1I1Z+z0QOukKpc9hkFOA1t5pHZpcjeuHf1k69XBD4VeGvE+wgdAvPpNkEe6qaj8RgfLRzQlhV/x9G6jDJaUyWWF1b/MrymsFkYF1sGqTVjdU6NZTU7sOz/dsk0kcIcg0Wy+V6sFfisWhm5gT0y4dCJ7WJOWDwvvOJV0f1lH4L/hLZX+PrkzoqGd2+90/utCF+D2pxHFsBVEABxFqlqQom76WUA8gjSg/nQdS7Cw9SoU7HDdlkkTUOpCl73iSkrEyx6bvxZPrPIcjbZh8LAHxPLV3M9skW3/ylNNL8kaCsPoZ/ng5cAJJTMTR0C96pTbjK/nJfhhm9V2RTykruaKH8bwG8UqS1AzWHi9SJ4jZhF7+4Kt+PFE6rXtyiT6rpDXJyXutOOK+F+0Wn3C/ZWsxHfADK0LgI7RVfQ7YLQQxfOUlFBS7QsxDWTuKYqIQdkAu+V9hAjSu2jxpxTwmy+IBqIFP7mDlRvPGgCW74FsUsXeEJS8TA+JHIB0LMyTXAS3En6LXxiXuEUYZQdWqyBxb65Nw1ULSOvlQvdrI+bFB2XSTzbTWpYFNRBvTZdpc0oQZgcxIFH26xBDPCvT77r8Dalw+4gChwq5GrPXt3Q2xAqu6LiOrHpbH+nJexz95H7mPEAgWH3vr6UdyHHuO+nMWeBzlYEwy8kIYsi9y71yvjr+UQS+trkCekm+2N+w26T7Lw3pbajJDifGt3dmU0s7zV0cl9HCzbRAb6I0o5AMKe7issiO+OvDdWOzpBJ/RfUr0kvtgIGxNUpUYnnrqs1WQ1qfFfO/IekbX5F2WJobvhM0PrxnlCgB3Jh6a7cJxVVSk7ea+xHS/qWnG2Sf2 X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(40480700001)(6666004)(7696005)(8936002)(2906002)(36860700001)(54906003)(82740400003)(5660300002)(478600001)(356005)(81166007)(26005)(70586007)(316002)(4326008)(8676002)(83380400001)(47076005)(70206006)(426003)(41300700001)(107886003)(40460700003)(336012)(6916009)(82310400005)(86362001)(2616005)(186003)(966005)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 17:28:28.4294 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1dd5ebce-2adf-40c7-0d23-08da95ad5f41 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000B076.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4259 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: meriton@nvidia.com, khoav@nvidia.com, David Thompson , Asmaa Mnebhi Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1989495 The MDIO gateway (GW) lock in BlueField-2 GIGE logic is set after read. This patch adds logic to make sure the lock is always cleared at the end of each MDIO transaction. Reviewed-by: Asmaa Mnebhi Signed-off-by: David Thompson --- drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c index 6c8a4a529645..b7363c6c3e2d 100644 --- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c +++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c @@ -117,6 +117,9 @@ static int mlxbf_gige_mdio_read(struct mii_bus *bus, int phy_add, int phy_reg) /* Only return ad bits of the gw register */ ret &= MLXBF_GIGE_MDIO_GW_AD_MASK; + /* The MDIO lock is set on read. To release it, clear gw register */ + writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); + return ret; } @@ -141,6 +144,9 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add, temp, !(temp & MLXBF_GIGE_MDIO_GW_BUSY_MASK), 5, 1000000); + /* The MDIO lock is set on read. To release it, clear gw register */ + writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); + return ret; }