Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp638343pxw; Fri, 8 Apr 2022 17:39:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcZPEDlvcv76HNF44SQ6EpLUcKCvRfGui6YC97yWzxwIZQkEIuBSJhm+D8fzlRqfcNI0bR X-Received: by 2002:a17:907:8a15:b0:6e8:a80:aaae with SMTP id sc21-20020a1709078a1500b006e80a80aaaemr21161983ejc.637.1649464787999; Fri, 08 Apr 2022 17:39:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649464787; cv=pass; d=google.com; s=arc-20160816; b=t0hEGMPVR+9NqOkizBireue4gXQFY5yyXOHSugBQVzOQnukNfU9LjxhTJdTCd/+Qgh FfpWBUFhAdohgh4bd1UMoO6grEY8/yC4AuYVQx6H3jIAv4QCMm41KmVHTD6KQRqf/BzV 9JfWfVI5yuqMMGxY7Omy+iX6OS2FMHaXZ3EFq4HTREnic23ALS/5gX6IW0nhhFDJTrgI 11ERSkSoLBAwulJLct8PhrD90kD4xkUEhg2Qhsvibjgt0ZlrrRXRzrufM0pGuTY1uaGF GJFS5JWV3MMPP2NwBFEM8rvibuKI9Mr0v1PnKD6WH70yQnApa41ucbzJj4tFbxi6AnU7 dmlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ozv3lx9gpodI5BqGm9JcwhJkNegEH3qGgq3KmiWkWLc=; b=yVXbvW1qIvZCNQYoht1RjTXmEEemErX5KBzrDjC6gK78F9EnvAespRi/z+sFevtESA wwG3m9s7shCar1tepd79rSyU0r7Z/VEuK1lmL9HTeT1kNxHTl4+ELeYJ2q/vXQdMyZEG RjM6S7nBrZSgnHNugJ3oEq1cqUd/+8iOVeYMztAlpp/5COs5PnQwd/hsdUE4IJJeDRVc dq/4L18TvJLLJnO/BpNX6QGdYSYFH4TXC/jd2xNFRAl4o/yUeXCnMbMNBC1MpZCBVat0 zX7Np49rHj6u6LWxmDRMVf6R1tsC+o//xoChWRfTkaOpmLF4hk4JT57ZY2bi1tUWlNOT oAFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=R6uu9AVK; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx12-20020a170906af0c00b006e8681e498bsi1213078ejb.602.2022.04.08.17.39.23; Fri, 08 Apr 2022 17:39:47 -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=@Nvidia.com header.s=selector2 header.b=R6uu9AVK; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231583AbiDHQc4 (ORCPT + 99 others); Fri, 8 Apr 2022 12:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231444AbiDHQcz (ORCPT ); Fri, 8 Apr 2022 12:32:55 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2081.outbound.protection.outlook.com [40.107.92.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18B33100740; Fri, 8 Apr 2022 09:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bL+azEUwqCNerrgRR5sNE/IjdWR1DdA4445d+4bpPd2gG/5z0wKmZJvEI6epYyS8fngn+7uYIAQVe6W0R2OY40QcAaadxes5GThF3nUiCChU7QCq3g0m2s/DVnL/Ke1LDeo1pA1lu/To8T5WesEoTSD+m4swa2mHyf/4XFHAotpld16TDiYT1zl82aNNQYHbudBac7bQ+INt7pwxQXgTTZX/KD46qczEeDqr1TEfIZ6HgsP7kpy16ufOlTNL3YQHNadY+XIxTp9bRN0thZZfZ1jW19Vdi/CsD6euvt5+1v343l1U1c0izaJvBBRiU8TWh4JlD2GIfZtQdk8CsCVwJg== 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=Ozv3lx9gpodI5BqGm9JcwhJkNegEH3qGgq3KmiWkWLc=; b=gPqkt+2uH22rMfJrSN28l1MPP8dyZ7vquxqyTu8aEAkSBLkoUCn0RtSMr91p5vVIYNs6vfGM1Y80oYeYHtyKXYKlUif5l1itiHtmNOFZcpltuJGPAFKtUmXcV6WXUhgCCwsNbepHrLcVy9X3Dv8YwQERD8Y6jEaAYfqKjJKVDVxpqAxX0qiPbnwZItx1AWVPu/nw4sb0r9Cl9UTnkQVAdnJce7g8rF1o6ckhktWHNX+S7BEoH5p6rn/ML/0Rohu+csmKg5/RDBWhz1vcvxKXEy/BoR7htR3V1YMW6aDCN0hjrzJNJT0EUWDq9ItlALv7QO40KJ1HQfroGXB0LFadFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=Ozv3lx9gpodI5BqGm9JcwhJkNegEH3qGgq3KmiWkWLc=; b=R6uu9AVKLZbRsGkmdfgqJwX6lUTmGY4s/MLG+A3JQjvKjpFfmRCrOW0h1iETt7dNGcWKH1RXVYAMJ+LzqbUwIddpGlq69e5W2QB+8KA1skFtaEv1UTTv5RQNmQjoMH8bKrcW4oWg9Ue91OwjhMnwdgutPAtE/yoXjTwm+P1YELsax0e2tcl5NQ1clionXipFgyRFS5LG82ZTSUyoU7ylvboONfZlziDNal9zhfgIM7GduWKnavBwvmkZBrq9oEMJmNU2ZhWSwjp5nqIr/QyX4hPwTCww9XqXgYp+K5a1YqpliH0lHmQ1IUZkU9Wy0e2ZRoSArUyA+RG1uTI6Lyj7fw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) by BYAPR12MB5703.namprd12.prod.outlook.com (2603:10b6:a03:a5::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 16:30:48 +0000 Received: from MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::cdfb:f88e:410b:9374]) by MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::cdfb:f88e:410b:9374%6]) with mapi id 15.20.5144.026; Fri, 8 Apr 2022 16:30:48 +0000 Date: Fri, 8 Apr 2022 13:30:46 -0300 From: Jason Gunthorpe To: Niels Dossche Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Dennis Dalessandro , Mike Marciniszyn Subject: Re: [PATCH] IB/rdmavt: add lock to call to rvt_error_qp to prevent a race condition Message-ID: <20220408163046.GA3612436@nvidia.com> References: <20220228165330.41546-1-dossche.niels@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220228165330.41546-1-dossche.niels@gmail.com> X-ClientProxiedBy: BL0PR02CA0066.namprd02.prod.outlook.com (2603:10b6:207:3d::43) To MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55c4267c-e86d-4d22-b9e4-08da197d233c X-MS-TrafficTypeDiagnostic: BYAPR12MB5703:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: in6kvzUE8U2QS2Y1swBviJoBuGWPVULeeptKU9aqlKe0rLqehXkKRxb2a+DPLIQifJsljGeDy0YXmmRS0MJPjCAG6vw6ZhBakz1LCgsDaUQjAqG081y9kZcLSTDCKJD/blxIr01cqd/cGf+X0F7wHEJ3SgkyyBHAUYUTeIU5kcgvES3oMlx3+gxDVbsuRpH2I6hP1TiADjAZ1NdBXB8GCjPzZtgFO40QUZ7WrMlrL85yt/hBFL5yOL9iSMQHLyKjGa7ezKUBvllbVtoRpZ0DPcc/QPaQaOhl9Vm6MmOZIRImeFNSk/4qFC4LwVUTE2lpoqtCqLqx1YVdwaM19aKTgYu3xavxWL4l4FY/rEzY6cWdf/s+snvSEQ5CBPXwIXzM6pcSWYSFt05nXO7lijTsvGrMbJKYXZ6G8zzFhb4a6UvV0CYVZmyER8N24fTkRqUDbP7n5t75nLsvzhRpL8kiYhMcx/Gv+vw+nCIHOE/y4f60WHfHHMtFAQwxrWOJA0w/IvTnR1utI0nmZe+54f1h8yQOiLSvziQjYf7J34R/3CYSfTEJwgluqJEk9WBAzdygIKr3LkcRE+2SsOOIbqxJAuhz6MexqJWNMWiAMQpQQqjEwWG0pLbZGI4eHgGr6Fjd X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4192.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(4326008)(6506007)(38100700002)(86362001)(2906002)(6916009)(1076003)(83380400001)(66476007)(8676002)(66556008)(316002)(66946007)(36756003)(54906003)(5660300002)(6486002)(26005)(186003)(2616005)(6512007)(33656002)(4744005)(508600001)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ohYdTlM2xCNVbunQx1ft94NP2lcrkcEqd6pPtMI7xawW9fsnTQZPbnRUKnHX?= =?us-ascii?Q?19dCAIZNO17qIE9U1UvYzh9cGVwZ7qEcAZ8kMy/pUVjStulqHiYW6N5WjfrC?= =?us-ascii?Q?r3SjVIkTr1VD2Xz/A3ljjBhXhtKGeKpZMI41R4i16mGxUJgSgBhxdXtbrxus?= =?us-ascii?Q?xp4mLsLyvyOPnjeSo0gLzBcx7jDmAROvFdTrpFsIrUW+qqsf0i+QKFlwy9RO?= =?us-ascii?Q?yLNTGxz6HgsEJvnV5TCXM0vObQm271zOjQvEX8Xmuqv0BqxMgiU+I/0K8Y2g?= =?us-ascii?Q?eXxdif4LNhiXs7FJCCXAmc6HdRPly43OS9pNhxhhdN259m9LHclW6W70PDM2?= =?us-ascii?Q?k5CeDKSUr2QkbNxKWVVFIOYREjPkZyQ0/u2tj97SmSIF1WqBYMCmYvx8VucC?= =?us-ascii?Q?XCQaxz1/+iXfs9nWf6WgNSuOkPfryJk2cBo293Wkzegn7zI7gGfXPlGA+mGl?= =?us-ascii?Q?Zx+BPefPJhXVu8C9rB3yRdWC4WvbKege5lwuh2cSVUB/PnN8G1Iqw103Smp2?= =?us-ascii?Q?mgOW1lMr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L0NLGOuHm3?= =?us-ascii?Q?y7MDby5iqCB6G/IrfFZWkZtcQ0vQ9r52Z4I0jyIREa46FrW/AIbfGL2fEdN6?= =?us-ascii?Q?gRa1FARWBJk8WQH+XOF/+bbsg7cpw5sJVhs+wP9sZtJJJ849PvI3qFeoGZ8J?= =?us-ascii?Q?NiMEOFUyBWk6jXiozJoFg6Ne3VjMmyLbXj4IdCe9JfaKS13v9rhO5b1JUXPY?= =?us-ascii?Q?cn0KHSX2UPfc4B4elJfQskLHRrkqKoS8nI6DA8/2v7BYSkkK3xbRHQkkxiul?= =?us-ascii?Q?g6E2ICDov292OlyfFtp4fcvZf9FnGMoO5WUGerktiaQoHUVVGlbpX4bTPdUK?= =?us-ascii?Q?K1rkxXngbA=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55c4267c-e86d-4d22-b9e4-08da197d233c X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4192.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 16:30:48.3509 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c1TKIMcdDX4pjmAFSTiPniLNHgSOdLC7M+kzYy8ZIjv9aIIT0pAMm4/SUIU8Jglw X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB5703 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Mon, Feb 28, 2022 at 05:53:30PM +0100, Niels Dossche wrote: > The documentation of the function rvt_error_qp says both r_lock and > s_lock need to be held when calling that function. > It also asserts using lockdep that both of those locks are held. > However, the commit I referenced in Fixes accidentally makes the call > to rvt_error_qp in rvt_ruc_loopback no longer covered by r_lock. > This results in the lockdep assertion failing and also possibly in a > race condition. > > Fixes: d757c60eca9b ("IB/rdmavt: Fix concurrency panics in QP post_send and modify to error") > Signed-off-by: Niels Dossche > --- > drivers/infiniband/sw/rdmavt/qp.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) Applied to for-rc, thanks Jason