Received: by 10.213.65.68 with SMTP id h4csp2111880imn; Sun, 8 Apr 2018 20:01:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Nh/6m9MKq5SIJ53a7SoxMUu24AhkdQkyM8K+9Ao95m6LeVPjV00CfZAI8fCwrNdT5jnZw X-Received: by 10.167.130.76 with SMTP id e12mr27810250pfn.192.1523242881697; Sun, 08 Apr 2018 20:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523242881; cv=none; d=google.com; s=arc-20160816; b=XRlPCQMkx8P7mqb0p6ljtG4Rr/GFEXmgW6G8Nzu0s6vt/JNYzgfbU4dXU2uKQyO+ED 4YyHbcNBXxqMp1lxoxiYjzR1yrT48RiBp4PyrO8Sx7g4KFuDqJXgN/JIHO8fFDY6Xja9 pnZ6wGCoKyR6sJJxOi/N5X5yNQUkGiorO5Bm34Wqx/Ss80BuuTC5quoP68NPhcnEBwkO e8MhBHp6o/5p2owDZK9xIRfgy3PAbrq3RT/9QtmD3LMqmUbT8xEQ6D4hrzPnGozOlMtY AF7a2M0g0OjP2qwnMvn8K1xP+3w2KG0eg+rLFGf2Dn6B6son/4CJlOWNTKZSbosyi4MP bxgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=rMklTFOLG02uQ6r+vxstth6xIrmsUAT90vlR4ABaOFw=; b=sXEoaymnIvsks8eU56nHR5CAeh8yXODyq4XWtnzLn7heemX/sW7hnNgpsOQqfQmIK7 8TpscjJNZEVCLkhxEu+rEp7O4KiLdQhD5rm0h1EftJmn27x5pVjiGEFb5Ngy35V9NRAW 4pv5F+jAr78KMIx55dCYi0txeA324G11oQj6VeyV3GYocSyMpBWOZvQ56s8PKUCWXoFp Czw1eNykMh8HfMse5jtifxW2Atq3ASLpPYZqDeZzgjLv/gJKD9MeH3ABP6Zm3XThwJ3C HGuCtcQ3raon2nk4aMExNNMjG9FV421PjvB7ZVwk2tiu9m4wzHX7aEzB/dS8CjvjexaC Nr7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=UEHx+mIu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97-v6si13774297plb.383.2018.04.08.20.00.45; Sun, 08 Apr 2018 20:01:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=UEHx+mIu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754223AbeDIAUY (ORCPT + 99 others); Sun, 8 Apr 2018 20:20:24 -0400 Received: from mail-cys01nam02on0123.outbound.protection.outlook.com ([104.47.37.123]:10471 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754208AbeDIAUT (ORCPT ); Sun, 8 Apr 2018 20:20:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rMklTFOLG02uQ6r+vxstth6xIrmsUAT90vlR4ABaOFw=; b=UEHx+mIuaCCaKtwqRgkqY2nLX97aPc3ESnXywWA2t6lv5HAP2QhBiine4x6pyhqoX3WObD1XHmuKD0orlfpZTyRW8VdCcqmDX2pI/F2y55xOMdP+Z1n3Xs35+M6/3JTnFVm1sfgaI2iIcO+w7S4Dl6xzEVe3pP33FcKNQG74mc4= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1110.namprd21.prod.outlook.com (52.132.131.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:20:12 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:20:12 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Alex Estrin , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 133/189] IB/ipoib: Fix for potential no-carrier state Thread-Topic: [PATCH AUTOSEL for 4.15 133/189] IB/ipoib: Fix for potential no-carrier state Thread-Index: AQHTz5hLbz1Ug7clKU2PxT0lc+eMDA== Date: Mon, 9 Apr 2018 00:18:33 +0000 Message-ID: <20180409001637.162453-133-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1110;7:yhkqQjmNmBoaj0cogo3TGK3a3f8ffdwyRMtUyILCpvOEYPDZk5QkRe1SrC7eRG3sXgdECWmLQx2R77gMSeNO23IR1bw/2+qljUTfVJqprTYg5Y2KETXTOLds1l+95RtJ4YGGtGLShUnhnGq7tvZqTEe2qMK/1Xuv0eyH3eltXPS/EASToOIVEgXbcatKGXut0/pzE/WtkWOYC9h64I12RHw1rXbKFbabt0e/Sf2RNF4EPcMgl0PW/y4w5JVraRG8;20:RuLl250qYQQ7R3PfAyhN9U3ARSlAIxaa7LkxMBrzAQC++35Nj59dkQ9zA4+bOO3z7sZHiOLtyaf6UPe9ZCKRUi0XhOMxkHZVvCqit0IzOjpKEr9wRNGOKuCIKqGJ8KTWQT3Lk+BpRW7ohqcUtKXc7FW73ngH8VEyCDbvINWgCWw= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: cd0c6705-881b-41a8-826b-08d59dafa913 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1110; x-ms-traffictypediagnostic: DM5PR2101MB1110: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1110;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1110; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(346002)(396003)(39380400002)(39860400002)(199004)(189003)(5660300001)(478600001)(86612001)(3846002)(6116002)(106356001)(6486002)(72206003)(25786009)(10290500003)(8936002)(6436002)(76176011)(2616005)(6506007)(2900100001)(97736004)(486006)(26005)(36756003)(10090500001)(81166006)(8676002)(81156014)(59450400001)(102836004)(2906002)(99286004)(11346002)(476003)(3660700001)(66066001)(6512007)(86362001)(53936002)(105586002)(186003)(5250100002)(14454004)(22452003)(6666003)(2501003)(446003)(7736002)(316002)(1076002)(110136005)(3280700002)(54906003)(68736007)(107886003)(4326008)(305945005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1110;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 8bDb5Q8Npmr8TvAY18rm+ufA+bRh8IrRZvJ5u9fP0i0uTNOXZAzntXLaSSvaEtIdd6cIGkdL/ibszm7Qi9JvyWHBbSWe6+chK8dlMLrq5pC31prOpLw5QVNHaF/ZfpLqWn4gQxhitlm17Af+e1Sk+jO1QlUZM9scS2yzQxtxHULHZh94DdShHuIxlq3pMX248MKGsuNnY2+2hTq0c1ZNt2OoFR5Gx4AAbDQqfpcb6ctPrMSKJ0ipvARLylFso92j7jLXWGGosv0BS6EOwLTjPAB2+oEpnMmOYQTY42eVUz9KBmN3WpX2Tlj0ySV12MHRpJas819eM/VvBoIqiyM9EvKNAfapjUoRLF8qRA0uhqzIJGFV8YzKuebAWnZ7/cJGiXP8imXfBAlyfuETKXiCeViACBjWEmnFyKimAU+lbs0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd0c6705-881b-41a8-826b-08d59dafa913 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:18:33.7068 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Estrin [ Upstream commit 1029361084d18cc270f64dfd39529fafa10cfe01 ] On reboot SM can program port pkey table before ipoib registered its event handler, which could result in missing pkey event and leave root interface with initial pkey value from index 0. Since OPA port starts with invalid pkey in index 0, root interface will fail to initialize and stay down with no-carrier flag. For IB ipoib interface may end up with pkey different from value opensm put in pkey table idx 0, resulting in connectivity issues (different mcast groups, for example). Close the window by calling event handler after registration to make sure ipoib pkey is in sync with port pkey table. Reviewed-by: Mike Marciniszyn Reviewed-by: Ira Weiny Signed-off-by: Alex Estrin Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband= /ulp/ipoib/ipoib_main.c index 160c5d9bca4c..4e75848f7a35 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -2287,6 +2287,9 @@ static struct net_device *ipoib_add_port(const char *= format, priv->ca, ipoib_event); ib_register_event_handler(&priv->event_handler); =20 + /* call event handler to ensure pkey in sync */ + queue_work(ipoib_workqueue, &priv->flush_heavy); + result =3D register_netdev(priv->dev); if (result) { printk(KERN_WARNING "%s: couldn't register ipoib port %d; error %d\n", --=20 2.15.1