Received: by 10.213.65.68 with SMTP id h4csp2114311imn; Sun, 8 Apr 2018 20:04:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ZVpg0dJE1Kk3276NKu8SJl1Vn7RazdkrLFRC+vcm+r7IocLv24Ljh8PbeT2gKtQe2ppGq X-Received: by 10.98.245.156 with SMTP id b28mr27159681pfm.90.1523243071697; Sun, 08 Apr 2018 20:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243071; cv=none; d=google.com; s=arc-20160816; b=NZLxuhH9QZojCRvqIlKhzKDFAfYW1aAvzy2mAQEH/uR5Ky/gq85klZE30CVFe5F8MG bMinLrJgr54sadRhLzj8GFXGoinAfDOeE9MPa2VzmPh4LX28dnATntrHNIpYnIrZ+3yL WXBDwQ8C5iiMPfNg8Haapbn2Sur27YMkyArixz+KSgcZxSxbANy8o7jexo+e77rNAxFL 78FaAONVI6vB6dfi/fnJZBr7XhuXJIiy5rGh7nm0iVwBl5Ebsd4rdniBmCXfQXqsM3rC q2rM5t2+7ZtzACbbI1ei49f3GyJXj+rEoLKi8eSW5fQgrHzXVdSFpz4JroyEmX6hvmyC pCXQ== 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=Rgif/5t24peR0hMieAoeNq6NwDO/Svq30odsXpRror0=; b=It+57Ugf4s0vPtYrHI2yKOZDbllB5C9lgohwj4fOWwpFyCfKJX0dBlIzw0mo8Kg13k kPoQhDFNu6eFThhNJ8MafTZVbTmMkVr8a/weMJl4z+QJPGtAK32k2URCgYH972mH+Jda /VKqT5i9vUJ3V40X4OTjYrxa1MNg413GtF6bxuK8RkT2hr2U1BR9u/1BjKQldAbEGSA7 Hk42dwt3R7nPU94ryv/mvZ38qbMaAa/x0JX5+BR8kOHWpdF3ktAIRs0ffmGnFkl5Oi0D YeBxPuLUw5aS4+SINsN0hZEZ6bdDJO9q4hZMWUQDoeUGqMbXZpTl2GEnVuIYClknbWju tP2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=FnoWUnBn; 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 s10si10543973pgc.129.2018.04.08.20.03.54; Sun, 08 Apr 2018 20:04:31 -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=FnoWUnBn; 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 S932451AbeDIAeK (ORCPT + 99 others); Sun, 8 Apr 2018 20:34:10 -0400 Received: from mail-bl2nam02on0114.outbound.protection.outlook.com ([104.47.38.114]:2685 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932425AbeDIAeE (ORCPT ); Sun, 8 Apr 2018 20:34:04 -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=Rgif/5t24peR0hMieAoeNq6NwDO/Svq30odsXpRror0=; b=FnoWUnBnHFMOgDCCLs13zyQQVkG1dAeG450v0m0D9q/tUZRHmTTvvKnQsdv/9c3so9zJ22qCkVpDE1eqx9c826DLyTl1C/qtL/HZUWpb3ldftVmgZCCSl1cm7jFUgN4sp/mnE0qWlXmh+PKDqi86bYAzTBO6eXHTZRmVcTwQH3Q= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0984.namprd21.prod.outlook.com (52.132.133.30) 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:34:00 +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:34:00 +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.9 265/293] IB/ipoib: Fix for potential no-carrier state Thread-Topic: [PATCH AUTOSEL for 4.9 265/293] IB/ipoib: Fix for potential no-carrier state Thread-Index: AQHTz5liy9DqsAehuE2WTGShZGlLvA== Date: Mon, 9 Apr 2018 00:26:21 +0000 Message-ID: <20180409002239.163177-265-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0984;7:m1Emag/Mb8FYm5oNeb3xzQT7YihBFfMj9MOM2jVOmOmvpQCIJSSNx4GM7rWCCPFqfafYHnmdi+QxVTIzCB4HkbXRpgPCFjToYseWAqFh6HxEbsdCMjcjtTYT/26DzCaySD1RYihcyCvYOi/R6qHDFFMJm+f94BsRr8SyGt1qKChzt5OXscOeD1c5jhIIomvLSVAg+MZ+bHDw+NjqiRtfmqSd32DTyndVcGRJrxhcM1DMfaxqqEif3Vi8Nxd7Pd8p;20:xa7IHsj2zREkZRtVI2xmYN2j/iqELOKdYKU0rpxVVc/tiMBQv4hr8P875uHBXqrlxtRYbwi3mcz81R0Hp/UwwhPXj2Hy4T6+eHNE2rj1vYp+xl9zc0pzVljm8l7ky+LT6yQx+uTQu7tG4iBPwWFJB4zy0Gzke/CX4PY/qBJGK6c= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: ab16fb03-3db9-45a5-55d6-08d59db1967f x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0984; x-ms-traffictypediagnostic: DM5PR2101MB0984: 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:DM5PR2101MB0984;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0984; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(366004)(39380400002)(346002)(376002)(199004)(189003)(26005)(99286004)(2906002)(14454004)(97736004)(59450400001)(8676002)(81156014)(81166006)(8936002)(6512007)(106356001)(76176011)(186003)(3280700002)(10090500001)(36756003)(6506007)(66066001)(3660700001)(72206003)(478600001)(6666003)(53936002)(2900100001)(105586002)(102836004)(2501003)(110136005)(54906003)(5250100002)(486006)(1076002)(25786009)(6116002)(6436002)(11346002)(6486002)(22452003)(4326008)(446003)(7736002)(86362001)(305945005)(2616005)(476003)(68736007)(3846002)(86612001)(5660300001)(10290500003)(107886003)(316002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0984;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: zAiImUJTqH7K4ayz9+JcPLC6R29plWVpTBsKeqBM7RgSWlZDKNh3v1ROAMaO9xzAa5VrerRS+QPHbR5jwpmvb2IWfUF+kn2Du1RlBhb1uFGdnWKcwHM/TBIRh2I86WHEJ8CWFHftA1dITgtb5nvJiDlv24TJyJhNwYDrL99n5/5jvZZ074qjtdjR1KpcFE3dkHuFmlQdDnfwAahNdzHNOj1UPFGtHzd/OfVuAfd/RrXVwmZuXOuol+44+rvhgmAGh6SLoZfsjEyjRywrLW07IwKWM3sQZE0kgoHhzngElzKKTrRKDRQv5SAS4XW+LoJazhcidZFNDXCabU3rYIkixqewuHdPucOH+WZ5lVdH7Xqi2bmSAkMfNSfVzcO/0r6tXxfaCV/HGFTiSJoyjzNy/NjX7JrikWy+M1ESRAybSIs= 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: ab16fb03-3db9-45a5-55d6-08d59db1967f X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:26:21.6757 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0984 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 0df7d4504c06..17c5bc7e8957 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -2119,6 +2119,9 @@ static struct net_device *ipoib_add_port(const char *= format, goto event_failed; } =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