Received: by 10.213.65.68 with SMTP id h4csp2112198imn; Sun, 8 Apr 2018 20:01:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+fl3YB5/60lFbz20Aog1YrIItE7nqaX136sniQS+mywK4wc8qzAkaYVP26QEadYTJc9mWl X-Received: by 10.99.95.78 with SMTP id t75mr23964198pgb.330.1523242910085; Sun, 08 Apr 2018 20:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523242910; cv=none; d=google.com; s=arc-20160816; b=RXbNoyAA5gv3gsYeTNsRRQL02ML5MbNO7aRCRV28lK24tw4eABMZzy0bGhPX91lDba y09S9fwElrrsocyF0AHpReiG3k1LlX6AyocUAvej4Noaj2JME1SR9oRySe4k4cUfw/Jv V93ZvrG7RYrKDgaAun6dCxJSiObYzPsZl35zhiVNuSFahSmddFpN7pE7Qlm2Szw8NRIR JmqDuCY46YR/3t0iUydnsFzGEmImQgUCfPI35mJlcsm39QlOih1HRbP2IrduIZaXgHif 2RTwvDi4ttv+f2Bc1UarVW1NIFh5lua63M7qYj+7wFTERcOjuaVDI3bfNgGcTetjfDY0 ap8w== 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=zxpmbro55t4js5agZPcVhJ4AarrviDEZpS01YWP7Sf0=; b=qBvEwP3e03SDhWFv6S5dpP4vRYW5PZtJ7qU/vFPIG+0ccYleM8iWahMuL/vfM9MT58 TNrcPj3Q6SA9VlTs7s6vLFLX2vmRFzN02GeLehxKkWNQx/g21pixaUb7uWVqulKx2PL5 HmoN8KfHCLKryJen25a9fDdjpzQVPmPrbwZHfDdMoT719CC/p065QVY0EqnNpBBloPy+ /8GFmNWT2MwmCAhdiIrTTwhHkFP1t/NiCGF6/tm1k3qI643Q2WGqTmrODgzYOa0CM/Aw cVJuohSfjEXm6M/djXsfMOLmW+ISb5VGDz5LL5VPtuqL8kmilzTH2GVOQExwZKJOpRci WajQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=iZkR1l0c; 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 n11-v6si13533188plg.565.2018.04.08.20.01.13; Sun, 08 Apr 2018 20:01:50 -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=iZkR1l0c; 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 S1755126AbeDIAY5 (ORCPT + 99 others); Sun, 8 Apr 2018 20:24:57 -0400 Received: from mail-sn1nam02on0128.outbound.protection.outlook.com ([104.47.36.128]:23328 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755105AbeDIAYy (ORCPT ); Sun, 8 Apr 2018 20:24:54 -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=zxpmbro55t4js5agZPcVhJ4AarrviDEZpS01YWP7Sf0=; b=iZkR1l0cCAYl1Kkv1Tw3HPf+rmVDUnz27HI8ik1CZOAwDW0DAr8//tw1BVNDd+2VgY7qDw/OJa0+vraZKZa/QVG3UOgTdyMul7zklkQ6ZUsmWy8et39QCK1PPNsMvpqOjo5TxYKNM+9tulDDfiDVH2Dl3tyJOIYQv48vPDuAmqw= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0983.namprd21.prod.outlook.com (52.132.133.29) 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:24:48 +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:24:48 +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.14 110/161] IB/ipoib: Fix for potential no-carrier state Thread-Topic: [PATCH AUTOSEL for 4.14 110/161] IB/ipoib: Fix for potential no-carrier state Thread-Index: AQHTz5iwNWI6wOkZp0ehajj9vGv+LA== Date: Mon, 9 Apr 2018 00:21:22 +0000 Message-ID: <20180409001936.162706-110-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB0983;7:3Hs3AXIIvl+bh2LrnLwSAMkE72ZiR7v6r0hVlr2im+KzfrMzG4NQ5gss0APccqivdm87zXZfkUySfVOpDHoNzn4Eb7JVMiFo/tZb2o+iZb/IF+tkhqKXzKXCv5htJPKNYySLAuoxQCr1w1DvsNd0q2XdC/CoL+yNoIaHcfh8jA5LbwAGAiB8wgwjMIiJzS/4oq67kxJ27mL+p+VRiFOonjK4dar3BhoGVNz85ZbaOzmK/U8h2tzmKrnr/lUdohXJ;20:9q71y28ahHzaWa5GUcTCIxfrA74Hf33alfmHdsqKBoFspbODOyNhb/yVVVsZFiZNDAr9BHFxko4InNERpaKK5Qi8PStnqicLO1YoWkmdSfOk8J/EMFlbbXU+RsIOhg5IRHi6QQmApNJCLZItBaJ6SXJUAqk+BjnAaA71c5I/ehU= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 596ea7e3-ab8c-416a-e146-08d59db04d90 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0983; x-ms-traffictypediagnostic: DM5PR2101MB0983: 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)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0983;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0983; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(346002)(376002)(39380400002)(366004)(199004)(189003)(478600001)(59450400001)(72206003)(10290500003)(3846002)(102836004)(6506007)(6116002)(25786009)(6436002)(66066001)(99286004)(54906003)(86612001)(6666003)(105586002)(53936002)(76176011)(316002)(486006)(7736002)(22452003)(3660700001)(86362001)(97736004)(106356001)(8936002)(110136005)(5660300001)(11346002)(446003)(81166006)(81156014)(2906002)(8676002)(2900100001)(1076002)(476003)(2616005)(10090500001)(6486002)(107886003)(36756003)(4326008)(2501003)(68736007)(186003)(305945005)(3280700002)(5250100002)(6512007)(26005)(14454004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0983;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: MYNiJTkaILg8tZYAgqpcRl0+EBVIVN3hOUEuhvIjuPh2f702dE0KtiRJvrQ+LxC8Z4b1Wdp3AauKXLziBYxXfGKu93ojjAwqFQkCB3W7PXHLDAVhChzZR1VOuycL/VapKDZu/7nzty8EX08SGomP8OVN72tlwiHOYE2JG092U7EUTIAD/Kez7OUjHSAT3wPD6ZzGKYazAzM+waQd1EnL0IJYD4bmKplLgtC1zRDIHuroTc0NDA7PgEFvEciZ79rLs2Rdd0GfEtLLbvkQLXjR0NEwpeVBzOIGHQKtV0UO7o+fRSHfmLlIDKqAB5ntVIWrGUoB/a7xAsz20A0V7n7xjXsQqQWquzvv3O8SA0cai9ouDXrQ2cRgcyIEoJSEKXk6xIipK9f2ZkoZEUibYGFrxhtR2+Jj+1Vi9D4RPxXdYpk= 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: 596ea7e3-ab8c-416a-e146-08d59db04d90 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:21:22.3156 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0983 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 a009e943362a..6bc9a768f721 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -2273,6 +2273,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