From patchwork Wed Jan 3 17:08:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10142655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA6836034B for ; Wed, 3 Jan 2018 17:08:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9513528D0E for ; Wed, 3 Jan 2018 17:08:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89F5A291A5; Wed, 3 Jan 2018 17:08:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C44C28D0E for ; Wed, 3 Jan 2018 17:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750865AbeACRIy (ORCPT ); Wed, 3 Jan 2018 12:08:54 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:27087 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbeACRIx (ORCPT ); Wed, 3 Jan 2018 12:08:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1514999334; x=1546535334; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=NfpPbCzeX5LROVHGVll1fYXX4EXRS0huA5a8kpvW5to=; b=k163SmX/hs4zTyN9qH/uoJJazEDoidb6Zy4bbOP1ofaepqRNoALDUq89 C6mzeFBkLSb1fUhlnS4AA+hgA4ncEfgqGD4Wi6/zUQFvJCy5nw3GPcJrL 6eqqCV2Hkbn1v94LcgySip2UnY+MdfIo/P4h0fhuVdE+PD/24ezAaynZU DVD8EoFhEZhKzAraV+eJCqSjcO/sf1EKK67ymLEa+ApkKZs9Cexpqcp/M a1q4S1N9vPZoZWsaDrLuU8RyllmAMp7MvmfqWjQnx++SQtaT1uEzeC2n9 ++ohysnel6Ztb+ttiUY+17Lm9qwZeGGEYT4eYCvLo4816+1y0+C4p2RTk g==; X-IronPort-AV: E=Sophos;i="5.45,501,1508774400"; d="scan'208";a="67973866" Received: from mail-by2nam03lp0049.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([216.32.180.49]) by ob1.hgst.iphmx.com with ESMTP; 04 Jan 2018 01:08:53 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NfpPbCzeX5LROVHGVll1fYXX4EXRS0huA5a8kpvW5to=; b=Lx6O0GH8+WxPtgN3bbQYmx0zKiO/VIeKt4a2vEqFdP/4frKcSAU1LwIY5dfW1dTTJoJLornJKrWwzdFLx/IGIDuQYpb2MDUG8WWWEzWDYMujXVXL9T46CvNZe8Q9CWwh3Mrp4tUMcr3njaT8UULXGWtV3Zu8FFGQ0/7tsvzxFL0= Received: from CY1PR0401MB1536.namprd04.prod.outlook.com (10.163.19.154) by CY1PR0401MB1534.namprd04.prod.outlook.com (10.163.19.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 3 Jan 2018 17:08:51 +0000 Received: from CY1PR0401MB1536.namprd04.prod.outlook.com ([10.163.19.154]) by CY1PR0401MB1536.namprd04.prod.outlook.com ([10.163.19.154]) with mapi id 15.20.0386.005; Wed, 3 Jan 2018 17:08:51 +0000 From: Bart Van Assche To: "jgg@ziepe.ca" , "leon@kernel.org" CC: "linux-rdma@vger.kernel.org" , "stable@vger.kernel.org" , "dledford@redhat.com" Subject: Re: [PATCH] IB/core: Fix two kernel warnings triggered by rxe registration Thread-Topic: [PATCH] IB/core: Fix two kernel warnings triggered by rxe registration Thread-Index: AQHTe21E6Ut6K+HliUyPJSgCdgMYf6NT32eAgAP1sICACp8aAA== Date: Wed, 3 Jan 2018 17:08:51 +0000 Message-ID: <1514999330.2582.8.camel@wdc.com> References: <20171222213852.3481-1-bart.vanassche@wdc.com> <20171225102839.GD2942@mtr-leonro.local> <20171227225647.GJ25436@ziepe.ca> In-Reply-To: <20171227225647.GJ25436@ziepe.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; x-originating-ip: [199.255.44.172] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY1PR0401MB1534; 7:c//SWtaSPcZ8kwACCY4RI3RSynrROtI+RbzEd4vHZpjCRDVlFrnFb5P00izpfd/PcwFtpFJCLq5cQAD7PfH05f8/99JXSos6pMnLDMdznBfNUskoyfLcwL3ICaCrKH1uSAm5t/oHRz0KK8Cy+lZmv86UGRpnItHg4df3ojXo9MmoEomWVNIVceVA7FC9lqAfI+sPqRC6lPAlrAIBLpnImjE6t8dI+BEK0O61e0dHnF+sn6T3nh7pFRtQR5DwPiJX; 20:fHZMQC7fg7YhTB71F7h6tQ/hTS9mFau0uVMQUWcgKAqFTEyCW0ncViZCg5qCErjk4zMTUHh0Jle22Dsijs+pFT8KhdaN/7D7eHfXbP6vAiSafjGVY+qXOM3wYjxEPs8hZjUp/Ys4gIkKMpt5dZljoc5xjYC+78aocmjOWSaAC28= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5b5149f0-89c8-4b1a-9c18-08d552cca9a1 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060); SRVR:CY1PR0401MB1534; x-ms-traffictypediagnostic: CY1PR0401MB1534: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(944501075)(3002001)(10201501046)(6055026)(6041268)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY1PR0401MB1534; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR0401MB1534; x-forefront-prvs: 0541031FF6 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39380400002)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(377424004)(76104003)(24454002)(229853002)(478600001)(4001150100001)(2501003)(5660300001)(81166006)(6506007)(8936002)(3280700002)(7520500002)(3660700001)(103116003)(14454004)(2900100001)(2950100002)(2906002)(6436002)(97736004)(316002)(72206003)(6486002)(77096006)(86362001)(6246003)(53936002)(6512007)(54906003)(110136005)(3846002)(6116002)(36756003)(76176011)(81156014)(68736007)(305945005)(7736002)(106356001)(25786009)(8676002)(99286004)(4326008)(102836004)(66066001)(105586002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0401MB1534; H:CY1PR0401MB1536.namprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-microsoft-antispam-message-info: ryl3kdZG1zy4Sqm5FaQPKv5Yovo1x1U3BRacosAQlfn2zWWf8iVcZ0VapQknNtV/8qbcVEolKGezZNVr6uY9lg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b5149f0-89c8-4b1a-9c18-08d552cca9a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2018 17:08:51.4758 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1534 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 2017-12-27 at 15:56 -0700, Jason Gunthorpe wrote: > I'm a little more worried about the ib_device_register_sysfs - why was > the WARN_ON ever there? That WARN_ON() statement was introduced by commit 97a9ea848016 ("IB/core: Initialize ib_device.dev.parent earlier"): [ ... ] [ ... ] Since ib_device_register_sysfs() does not use the parent pointer in any way I think it is sufficient to check the parent pointer in ib_register_device() and to leave out any parent pointer checks from ib_device_register_sysfs(). > What do you think about this as a clarification Bart? > [ ... ] OK, I will add a parent pointer check in the code paths that dereference that pointer. Bart. diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index c1fb545e8d78..daadf3130c9f 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c @@ -1258,7 +1258,7 @@ int ib_device_register_sysfs(struct ib_device *device, int ret; int i; - device->dev.parent = device->dma_device; + WARN_ON_ONCE(!device->dev.parent); ret = dev_set_name(class_dev, "%s", device->name); if (ret) return ret;