Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3539946pxb; Mon, 4 Apr 2022 20:29:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvMLm+QQYUhvk17D9DDQs1e6hH26XXxC7dbv0iwf9HjpGua4iZxuGbxbEXxAKTfJrmjXoS X-Received: by 2002:a17:90a:4897:b0:1c7:5fce:cbcd with SMTP id b23-20020a17090a489700b001c75fcecbcdmr1710364pjh.45.1649129397274; Mon, 04 Apr 2022 20:29:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649129397; cv=pass; d=google.com; s=arc-20160816; b=h2MmajrhHE9xZzcdtS3eRpLkL1Ay862cR0k9M0ZcJw/idFOYcNtjSOXYazqNSMGQVK zYrusgWfiplNaSb1k5fTrnAdQpqcmsX09yLVu4K3Aubuy3tFZF7nKsF+0b86iRXYAfS4 Qc44ktq1vG3zpofyEhCqji1FyZghvFR0XWKAT7+w9iXOpdVaZkbfnCH+vlAF9v8jQcWd TqE950Cpe5NbZXdu9y7fDuCgw8rDykcL4w0ZgVdfPu9r8CnVYfyFxEGK0qsmVxe0f9q7 CYDBPn3aeBP05DOhOCru69/DDS4efDXsbGfazVaueM7mVQRX5sTBXqcRH+bRJgfmHwpe dLWQ== 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=aQC89sjlu3OpJc585lX5tjE80YKj9sPyBw9litizpg0=; b=b0zMkhQrRcR4z8N8W4jtkfw4iVHxyKMo4TZ1g7+eitqCBZaQ3sIm88J1WGQZyo3c11 G81EbDb6kqWaJ122gjh+yyO9/AvUd/xPkWZz43eFX16D56bPwKdWeVJUDUD0uX8lHNH+ 1IDC+PyQWYgZ2cEAx+v2wLGGTLUb9rGrlbXgSpWDnwQn1NjJhuyzE3zpPVSSayNBNegN JnV3kFlR9CSGLsmSPlrtPPHU57SVxPFZDWfjGbftmjrFOg4vhHEez1q9s3MIIJHMxMZv Hf6cHxGTRfNMs940nzCB2VpjHblG3fBwX8UA5fO9L/sDnXjtbiugwI2YM2BQ7KnYkxGs hFVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=rSnx6yUT; 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k6-20020a654646000000b003816043eff9si12109588pgr.494.2022.04.04.20.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:29:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=rSnx6yUT; 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 68C312A4BF0; Mon, 4 Apr 2022 18:29:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354451AbiDDNol (ORCPT + 99 others); Mon, 4 Apr 2022 09:44:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358692AbiDDNof (ORCPT ); Mon, 4 Apr 2022 09:44:35 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2053.outbound.protection.outlook.com [40.107.223.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 245B63E5C0; Mon, 4 Apr 2022 06:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HXy2WKXXFKNbCjTC2qahvb87Sxs7covHdpMXqmSdcVl0g0b7EkeVc67XL7e4YWLmMRj4UM/XOpR8yWRPlcu/aWk9wl1kw6ndMtA1Kfq9cypDTblorknQcuAURyRdwUvWFJM3FRxIcrcwTVO9aZPEUiHOAryv6vlZAeNkftA4DRtzRAOmNU4ghqw/noRkKPAxGnwT+GvsxPN7+YGv/kYCobbyH8uzxaw9qwerahyf8mJt+b1XELP3tMXR3nXzU26AyZtvqxO10UwHYUMxZr/hVXsj4INCG9VeKV1gM8d7Zlff/s8OsPX23JxUL91IxJHca9gd8Z9rltVZMi8LCbE1mA== 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=aQC89sjlu3OpJc585lX5tjE80YKj9sPyBw9litizpg0=; b=SOdM8aPt2tgITOFXy8vM38+72zut34tIdsHvv2hB1B2X1UN+ZzbBKgQ6qJXfglytFS6vv0Uz60GuazKxfM1UDqSlfI9AGSdTKiJhdtKMxdogNjTBp6grZl/c0o/26A+WlKhswljblf6dFH4tR9m9MjwgBBevTzaZm67e8yFH548fzpnBNXV46H9UCnGyZ441jUdJnF1q+w2VtWknY8iXWtt1hm6tOwqQzgSjUjRaXPykqkj8w9jVQkuVKQYxNe7vpxC5GOZtwyIuWfbPOc0CUhATG2rtKsYE+5F3JAE1cVx5b4gFNthCr1OfOh5XKjZ8dmR89qo7HuJYctOX1YgErw== 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=aQC89sjlu3OpJc585lX5tjE80YKj9sPyBw9litizpg0=; b=rSnx6yUTjZbYAiET0ZROoZN0FXgYRFaROfEUdI7ttXkFT+yBuRDc81LIAzoS01M0bycCCBQhdBoNzJ/jPyvi9Gw1ctm/BRPa/tfXhx4yqCCtmc8xm1YBQYN3cGQPxqo1rRoi9JN1Pp0WcyJK9oYAps8EGcXevJhKYsZrridLkSNaDqDdmeVBOtwo6Vz2AYkwRJqZ/q7UL6PmHUZQX/Y62j2KcXToN/ID7KbSJFHI9s8h2h0c2dIX/sYQwXajZIh/YgM/5PGN62pV49J2JVL1E/iuXNQYdWs/WF+X/QPMVUC4upjuUxtBvwoc2/+2J4BWQwlQDFn1iSs65xMrNV82sA== 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 BN7PR12MB2596.namprd12.prod.outlook.com (2603:10b6:408:29::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31; Mon, 4 Apr 2022 13:42:11 +0000 Received: from MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::cdfb:f88e:410b:9374]) by MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::cdfb:f88e:410b:9374%5]) with mapi id 15.20.5123.031; Mon, 4 Apr 2022 13:42:11 +0000 Date: Mon, 4 Apr 2022 10:42:09 -0300 From: Jason Gunthorpe To: Niels Dossche , Dennis Dalessandro Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Marciniszyn Subject: Re: [PATCH] IB/rdmavt: add lock to call to rvt_error_qp to prevent a race condition Message-ID: <20220404134209.GA2905506@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: BL1P223CA0011.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::16) 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: 80e50b04-7e99-49ba-0aee-08da1640eb32 X-MS-TrafficTypeDiagnostic: BN7PR12MB2596: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: Zq9O4hzHl73comRVC403wKBHZ65VJEtG7lDw03x7zAAAjShhV7D6WrtiV7BymjSDGYBkLRIACeYZ7IlTJTuziyCaXbAagPYjShlCoahQfGMyMWhK6UTfjmPhkhU8fzia3kn1zodevtOA5TI/bVGdHwOKndd+RyxtM5qBeIH9tMYX4AMFgkmryBhVnasLzzcpgZS8cRi7pp0/i8HMi0om+4iDWlHmMnUFZrV7PThZ3jfmxQ9rtI7RH/hCCKLnwQODLVy+dQLPonNPhqVVp/PTLPVabg3TEjFu50UI0D4zGPo7tKI9VZc+EDK/V+iAWKuFmKEzveZmFXoyjs1wIXBSJqNNH3hPIGLY2NMXwkWZfC5scqjJz0ZgbWMKhX5cmMs0xoIlcU40wLOe2YogOXVqTHIE0/1PfPo4vk657sOCz1npTcnwOSsUhrjF6hPtKNRQzV8MqKwvXwDVpVH6e0gdfzXPSefIGR3PK+7XnNqIU3nBSrcGu64IWl/aJKRgOUaFRiG/qHcA6s873CJ6pFfVUNJRkeU5asXZ9Sc5UIoX2XYPVJurIZwC896FAbt/77y+PSAqrLPZQFuvTeCJb9bjRrAMSSgQXIxVg0sggdm8oCsAZaRsNzoXlFvc6DRcNh+Puh6MLPqqP8yej8dUKdCPGhVX1Wm/81UBl28xRSfUQPlLZFMN4J3Wy80SGsgE2Y9IJI782kPJ8qK33hXh/v5iBQ== 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)(6486002)(38100700002)(4326008)(6506007)(66556008)(186003)(36756003)(508600001)(1076003)(5660300002)(4744005)(2616005)(966005)(26005)(8676002)(66476007)(66946007)(83380400001)(110136005)(316002)(86362001)(33656002)(8936002)(6512007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MhddzGb2bZiVdHMfqrQWZwysEW22+osW0oHUwzajawarQ4jAAS5p9ZSzXL9o?= =?us-ascii?Q?evB98tnSHKmcyb/SuGG0npHKvtHeD60S9ZCpbMxDanLbm0/g4gHVSBlD3v7n?= =?us-ascii?Q?XNN9nG6leYxv3GbGSslVzfqrdCUovr7+gPi6JHgzbGbvyNYXvTBdFdFErHBb?= =?us-ascii?Q?7bhzj3C6+jFJncGTzXxT/iQOL+3hVFO4forfHQpsAX+iTKuVgdzVNVW1QCLy?= =?us-ascii?Q?pgsSN0yAw4MtKin0Jy2xm5ZHy2O4RdaDOueqd7l5luZDKF5rk0bwCWi+x7Mi?= =?us-ascii?Q?H9EkU5rNd/8t/cRStVf99E563PSrAYr9JEIv0weUYtSPbfrqSqB4VREWEU6F?= =?us-ascii?Q?fzr+R0Wr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xgjksHN9XWscul9C2gkFN4?= =?us-ascii?Q?Max8IIYL6FHsRdwoVAH5NksxvWQJ43eri+pTWh8sZujwXTNF0BV1/LMAJodu?= =?us-ascii?Q?af2U24C1My22CNSm5zGYNesGd5hVPm9n2VAyN9GAoIjXtelCtKpAnICpopNm?= =?us-ascii?Q?AI6Uy1aX/gHbwECWSTMOcNVnE8u+84grhxihvhotg5ZvQBwg2yo08XKuhDKe?= =?us-ascii?Q?jraD7n8Y9OxOVIUZQ1cHUlkCx3WFOXsw3YKbyQxG4a5dvK0JhLDr8hExr9BK?= =?us-ascii?Q?oDxx3FNYVRVIsOjZgWF/6FJHInR6+rZ0Ki6A204dzp22/rPdM6soS5CRgoQ9?= =?us-ascii?Q?DB8ZvZnuXhgUm92zoWHlI+lpEsxFeBAXnksNCkJhyaOU7LJNEt5cpgcZH0aS?= =?us-ascii?Q?pfV0UK4OQFIxPl33jMQR4qsE5EwHH7N8tUKTHfO7fkFdwHtpEGFZuIgLSr2L?= =?us-ascii?Q?mXGQYQCODa8qJUwhc29fHiDJDq6rFamrYoyXuAid1POun8GvFer6NQVyB5TK?= =?us-ascii?Q?G6m8qvFqtg=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80e50b04-7e99-49ba-0aee-08da1640eb32 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4192.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2022 13:42:10.9426 (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: yJKC4FWpmliMZNWuAjXOQvMmDodcVklDqBEVRe/1BKLicR4CvcDQeswYrrrSZTka X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2596 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_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 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(-) Dennis? And this too: https://patchwork.kernel.org/project/linux-rdma/patch/20220228195144.71946-1-dossche.niels@gmail.com/ Thanks, Jason