Received: by 10.192.165.148 with SMTP id m20csp549356imm; Wed, 25 Apr 2018 04:06:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx49cfRBxn9qWs9Kw1zvSxG0tAi6Cy5Ca+ttwrMvd6nZDHmOA5K6mOCKXhButAIeWrGf50cVQ X-Received: by 10.99.4.88 with SMTP id 85mr23680603pge.156.1524654362831; Wed, 25 Apr 2018 04:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524654362; cv=none; d=google.com; s=arc-20160816; b=srCD8DUJ1d40FYpfGCBHoD6TMDAS/9/Ey4xAJOeznXxsPq+YD2EwxypxN1QkgMLMOt QFPOymUAN0MKKN++gPFqBlKnA5bBbBtSET5VnPdxkzfW6mQXBKLZdgAVtnnUYxvt9mJK 3M3gS408WeBjtfQ9o0/ce6NHhFdZsw60Lj14/OMLNexbOF4RoWxfPsuecQZ4kOaKZRue taS1MJAr5+WYTtQlQ3QNdhMnX4hI/D3uJiZ3dIr32E5jqYdajWF6VIe0KDfQRuEjSGmh d4UKjzvRB31POgo5GWmwP8yytKVp6CABG5b8uM5F2XNhhRao/VHZ9N5B6s3KFu5wu6Cv eCDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=00wPiMhpP52CDYQa9NPW/bYWZfL4n5fnl73yioSg1as=; b=fpLc+u5aXTO/N62mkhJ8PIXECg1ICGP6VLgrHI6AoeqMT6DcWR0BtGTAYd/pKopAxu uyZ2Olw4odnOd1HlyHSxKtSsEagcLPF+sAp4ZG+d9BaegB1M6LB15j5fmGF6dp7StIrS woZM8gEADvuYobRLYikYPmq04iaNgg+lRx/LugPL+Y59rGljIOXWpR6uzZWM5jo2eEbQ MbiMtNFXLd3oy0bPhzBqENF0fcdRSoa3J3Ja/0PtFJ4GbKO41rEhJK2HTc09I3EGL1Bn teB6j/7ZeJn04bvHFwYtwQvplj7xaTRjkQ9bw7JFbHWomOARIO6R4IjE47QPknf0Q0Ue fcQw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92-v6si15857140pli.354.2018.04.25.04.05.48; Wed, 25 Apr 2018 04:06:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754252AbeDYLEq (ORCPT + 99 others); Wed, 25 Apr 2018 07:04:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52568 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487AbeDYKmJ (ORCPT ); Wed, 25 Apr 2018 06:42:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9308A272; Wed, 25 Apr 2018 10:42:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Marciniszyn , Ira Weiny , Alex Estrin , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 122/183] IB/ipoib: Fix for potential no-carrier state Date: Wed, 25 Apr 2018 12:35:42 +0200 Message-Id: <20180425103247.334573052@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +++ 1 file changed, 3 insertions(+) --- 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 priv->ca, ipoib_event); ib_register_event_handler(&priv->event_handler); + /* call event handler to ensure pkey in sync */ + queue_work(ipoib_workqueue, &priv->flush_heavy); + result = register_netdev(priv->dev); if (result) { printk(KERN_WARNING "%s: couldn't register ipoib port %d; error %d\n",