Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2928179pxv; Mon, 12 Jul 2021 05:27:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzy+y42tQEJBJbSGvhj07p4xQ/tod/GRvZOcSQqywZ0wN0z9FZ9QeIZy/clkNTLgnff7XS X-Received: by 2002:a05:6e02:218c:: with SMTP id j12mr6201663ila.32.1626092878850; Mon, 12 Jul 2021 05:27:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626092878; cv=pass; d=google.com; s=arc-20160816; b=FqpgBfV5H/SUtqnlZ7W+rVWCMDsz5FVhTbtC9i0UdLf7zpFb0TeTrUx5vHXTlcNHhO 3+q0UbrHycSPN7+jTCQ2G2m5qeCujFqGQx1qS2WDmKbk1t/FFphutZi3HVPOSH9gsdHB Bl31X9opHg/LBsFPXHYnuPAnwyraFLjw9obvzCE5b2WEmqbhjaw/E+oEnV7AdvQSioeG j+8BVoSsOvyiVzV3Jbcb3drtxRMtJFQGREyVZdhMfQ9pvj9fupFJN5/nmKxQhwPgxCQ+ c/WCTUGZbcuW9yCIKkZunLn7bAqIbe2Ejpl61w2BsyGd27h1ZRGy5PEnW24jh3Ou1Nao EudQ== 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:dkim-signature; bh=h686Og7nWQgIy2F8Ldwi3r/IKqxjRlyyk0G5ijPDQc4=; b=NxYteb9+9cqrfGahvbypRpHU2X2yRxgFiiT1OhPrfRVXyXKmTMeN1TvvoDV5SpVfMq Ed0aCg3d4PK0nIxnAj9W+A+GIFE+ZNjzl3zHTZH4R4TJaAFv0FBGwHI3V2b3Fq3VBMGa DLjSzhX3lkPv5M7mUNYpAm7fzu3dsGj/NhkxH3oBmTwPoCIu4dTflwIQ8t8PXELiB4WR scDZ0m5QgU6nTmKxE/2HthYTYk6+wsUCNa8eu+eUPDGoID5R+O7ab+AhHqf+n8+VLrql miXryL99t6IJw1R84Eluks89IWpj0M0PTvZa/mUy9lmcMK2YfN+r1uaE9jRvGvdBccEm mAZQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=Z5Lf2T7X; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Kcnjxphy; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si18933682ilm.156.2021.07.12.05.27.47; Mon, 12 Jul 2021 05:27:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=Z5Lf2T7X; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Kcnjxphy; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232618AbhGLM3k (ORCPT + 99 others); Mon, 12 Jul 2021 08:29:40 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:22386 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231749AbhGLM3j (ORCPT ); Mon, 12 Jul 2021 08:29:39 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16CCNWFk002693; Mon, 12 Jul 2021 12:26:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=h686Og7nWQgIy2F8Ldwi3r/IKqxjRlyyk0G5ijPDQc4=; b=Z5Lf2T7XeyaI09CcvmHrub48Ljw+cYSwP1I4vkpRaTsKXNRGm3mc+fyOBf3GkDFmUomU l7swtFvy4I6K2S3t8fJ4kXBryTuEeMJsxh4QdMHaK+J3PmtKWu3ZrXNkQXZ0ATezXLZi NvZLinEZ+nrXdGyCBMsdnwqZD7HmEZTE+wUm3P5xfvbDwdoCChy18MnE46koquPOywtk K/P18V37d3QZftdG8B82KW7ljxdwaxGeurYv+NPIc8qnIa1nvBkmhXgBbcP/LY+UONnH 0wSTCitjLYZy05TlH/uYCWlQGD3tnVzQfHDvqI0napUdxd2MmVSC6Y7X1ERrnUcdwwfG Fg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 39q35s2hve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:26:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16CCKmJV134677; Mon, 12 Jul 2021 12:26:47 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2105.outbound.protection.outlook.com [104.47.70.105]) by aserp3030.oracle.com with ESMTP id 39qycrhjsa-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:26:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZAAZWUt85vdiRUk+diKU/JWpnwNM90WoAd22z64N3nDVAZP/3xS2NrqJn2LLxjWtqxFsVPK/gwsJtdF2QLDXiHK1Yku5q6b3+fRu8EBl323fwcijJ5aBFErcoAh8a8b1/erqRXnEU/fXF9aufG8Ll8XujnEq5CSq18O6zVwIUVSBk+Go7/jmM+7TNST0dnIgWaJZm5YIWnAuqj2ih3D3BXXW7v4VKJ+RMfCm9RfpDRfsf58SjyTClYKhRmS1GinuN5pnOo81R87+EEh38zE1JRfzDnMY9A4RR7I6+SIvVquZJIxipgCgssuxM/sLuDYHOcFHq1fCispnRQV+TY68g== 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-SenderADCheck; bh=h686Og7nWQgIy2F8Ldwi3r/IKqxjRlyyk0G5ijPDQc4=; b=O4H3qRhSMIhReRPEksEBhvnO9hdXWVS1DmGfkrLmSvB+toAljSKOUJmnYHkCn+x4UuAyKuhmbb2rNYzxIfH3WNWjurF6LgHw2rbGPjl1VA406F99J4a8WsZ3ntIMk4TBSBI7T4Zfw+FXtFYzpKLS3ISlBJbkuffVhXFmCIjEM4AkH0qKrAOJLzDHqf7d7xh6iWCCxCyKT2j2gZ2XKPBOH2PUgXnyFdrPpRX9wMDIqDb1Q014G70p2/g27O8BMLospdAea4mZaaRC3cwCtpIdGuHXAj+jTvG5Z3X3IO8BuqVewxZ/LL+2SPlili7uZdaj6pt2I+lZBjqf49oj78dvPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h686Og7nWQgIy2F8Ldwi3r/IKqxjRlyyk0G5ijPDQc4=; b=Kcnjxphyg3f32CiJD+sUDZsvNXpqlstSLoKgP7Vg4WNojaUOnjqV3Gqo6bupYWye5gByCgqLAz7eP/82DvF2KBWOeYaekXD1giM5lYUQRZtb/AdA4mr5xKHjGqoZK2iSKwOKVx3VHHb2xTyyntno2qD4GNiG+JMxpeHQFcTGgTI= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from CY4PR1001MB2086.namprd10.prod.outlook.com (2603:10b6:910:49::39) by CY4PR1001MB2309.namprd10.prod.outlook.com (2603:10b6:910:3f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Mon, 12 Jul 2021 12:26:45 +0000 Received: from CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::9dcb:26d6:7408:b4d5]) by CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::9dcb:26d6:7408:b4d5%6]) with mapi id 15.20.4308.026; Mon, 12 Jul 2021 12:26:45 +0000 From: Anand Khoje To: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dledford@redhat.com, jgg@ziepe.ca, haakon.bugge@oracle.com, leon@kernel.org Subject: [PATCH v8 for-next 2/3] IB/core: Shifting initialization of device->cache_lock Date: Mon, 12 Jul 2021 17:56:24 +0530 Message-Id: <20210712122625.1147-3-anand.a.khoje@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210712122625.1147-1-anand.a.khoje@oracle.com> References: <20210712122625.1147-1-anand.a.khoje@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYAP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:8015::10) To CY4PR1001MB2086.namprd10.prod.outlook.com (2603:10b6:910:49::39) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from AAKHOJE-T480.in.oracle.com (122.170.228.204) by TYAP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:8015::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Mon, 12 Jul 2021 12:26:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9aebda85-b98a-4679-f4ba-08d94530502b X-MS-TrafficTypeDiagnostic: CY4PR1001MB2309: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1vtfyKFfsI5DKDykDLARljsE421/hILQwsOFCQ+c4YU1g5ScIW+sKKMhfAc2SCYcDCDlgm4CARp2KZJnv2VpPr6oDifRBDwcJCdPmZ15AeW7nGyixLbisQnjvZoYkBvB7hM5lxHtg2KOJh+v3cwvR4Ju1Qmx8PMPz7Vk6ssEemUI7l0+htqJw/nl+xJl6PeoJ/UWbLvIIlgZxSgWchAcRGkbGqzCwQayEBHwjNaD/vIQ7nRXcHZsJcAu6YKyRh2qrcADLhn2CiNaktGonaqUfzl6/04f0/e+onZgR5F0QtFMyx1x8MyVY/HnUF4Me1XzVsFM47B6Nf3508XivGTlkCuz1/Q5g+zBwIA3M87VtoJioC5esTjXajZ1Hu7OmHSljITx7N0EWbrUSvdKXi0+uAZTFIiZ3YnKXbnfJCniey+BD/zX/dskS5aklypeSN72/oOiJrGv5cWZQWxfB931dhtAPJ5N2aIKHuXkqiOP7o8G8cb7YoG6O5/X1lB215thHT4pd6/ybSH9/CxavLeFkK3BpdGujeRwKGRR/MXlBPKG8pVQFq6O/nFH2MX6vJn0tdX0Sl5QP8u9VN/bsoHgpmuhZpVGJC4yTNVDCYtJm65oacotPfQ3jYoQcOCLmrur3Jd6jXbNN+ZLIQxefxdRQ1MOxVzAlvCmLWIdXvBMuAQlgeepadzvT8ExFQLji/4KRa4sMDCVztHhQ5xodAA64A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1001MB2086.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(366004)(136003)(39860400002)(376002)(346002)(6666004)(2906002)(36756003)(2616005)(66946007)(66556008)(1076003)(66476007)(86362001)(38350700002)(4326008)(6486002)(83380400001)(316002)(956004)(55236004)(186003)(38100700002)(8676002)(103116003)(7696005)(52116002)(478600001)(8936002)(5660300002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?J7GBPuiBzYwrqLjwyFbX2hEnSd6JrjDP7qD64yBXiVhyBgZt3Ar6Hgkcfo0s?= =?us-ascii?Q?KZc1Vmew87b/Qu8ZsCMwFvZ8aphkulkrX/mnH8h3k1Eekk5VJxCAJKv1Yb8Y?= =?us-ascii?Q?AXU06ueg/dzqAB3WNoUH8qeMrsm+O0+P5z81hZ8d5O4smRI9IbIcX1JBiaa2?= =?us-ascii?Q?93SZy87tQRMoe1x83rWmk/YWaMKUEj+uSsud8hnCd8RhxoUYFhm6cYT+BaHS?= =?us-ascii?Q?ygoi8zBuS1w18K5mk5fb/XX7Gmtt1g+mw3ZqVXyPReZP+CYtx3LGocrVjUaJ?= =?us-ascii?Q?h+Q4NpH950N2gg23OQD1zjo0D7zkIQptT6lKrWDEldL8yKG1RmK6zvRW90Bn?= =?us-ascii?Q?eUJCVzv09cGFbj4deD6nRjtUKq5keb+dfF9dViHOT3l6+cj+KIh/lSCmbCC7?= =?us-ascii?Q?yOz960TykVw+QHNiSkWa7u3a238VB7/zbSSI7Few514dWcTEMLs8Y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8XavMrNHDjqp?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9aebda85-b98a-4679-f4ba-08d94530502b X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2086.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2021 12:26:45.7709 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MMgZVb2uPkqgvIcDRACg5CUGIrFxvt5A9MZ/XLVSm/hw3vBxFyDOwR/gKt1jDu8hKLJYnBbUL//sz+biZe/r61srAUCdqfwdmkhGh5L/B98= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2309 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10042 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107120097 X-Proofpoint-GUID: f9_f27Ticqkoiony8KGMuZWGIH7MHp9W X-Proofpoint-ORIG-GUID: f9_f27Ticqkoiony8KGMuZWGIH7MHp9W Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The lock cache_lock of struct ib_device is initialized in function ib_cache_setup_one(). This is much later than the device initialization in _ib_alloc_device(). This change shifts initialization of cache_lock in _ib_alloc_device(). Suggested-by: Haakon Bugge Signed-off-by: Anand Khoje --- drivers/infiniband/core/cache.c | 2 -- drivers/infiniband/core/device.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 929399e..0c98dd3 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -1621,8 +1621,6 @@ int ib_cache_setup_one(struct ib_device *device) u32 p; int err; - rwlock_init(&device->cache_lock); - err = gid_table_setup_one(device); if (err) return err; diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index fa20b18..ba0ad72 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -607,6 +607,8 @@ struct ib_device *_ib_alloc_device(size_t size) for (i = 0; i < ARRAY_SIZE(device->cq_pools); i++) INIT_LIST_HEAD(&device->cq_pools[i]); + rwlock_init(&device->cache_lock); + device->uverbs_cmd_mask = BIT_ULL(IB_USER_VERBS_CMD_ALLOC_MW) | BIT_ULL(IB_USER_VERBS_CMD_ALLOC_PD) | -- 1.8.3.1