Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2527548imm; Mon, 28 May 2018 09:47:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqlJMw93Nqku/PiIbhFDJ0pu4bGlJYnYUoeAwd5/fC6uzj6BY9i069pV+rZ3LFWrtBZY3XO X-Received: by 2002:a63:6dc3:: with SMTP id i186-v6mr11402564pgc.316.1527526036613; Mon, 28 May 2018 09:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527526036; cv=none; d=google.com; s=arc-20160816; b=eJV1c+kTDxqzDZ7o+uOmTmxoJQGeLTHF5C8+GxuvWRlTt9UhKZenTw1uz57v6pkdwt zXyPFyvzUXeBzb/R6px5T+0EzU5nxSkxko3YbAeHx7Jk5Xqd8FiOdOO1Y9JPvD6DcBBR REGPXplsXDqmai59blL2eaXw8dimgAZV5AhOb8CUlLE6rvfFHb0VptzUaNSioEE5IcSq 7WpIGGE/ISceMU44AGevhZ8+n6m+VZdG8VhfvQqtRq1BbykdaSxRSQ7rBs2nwAvdYqKr /8MVpSpcVlDnCCIEcTXNe/aMxfy1szlaQE+LuCRTZuNnETs+eA+bTRyCNPR3QcVC9Ngy Ch8A== 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:dkim-signature :arc-authentication-results; bh=EPaM1iBqWsVEJLPeTsU14Tz/mZkD1Hj3s2FZT4mo420=; b=SXL4NURY6UoVuf0rGEZoC3YPg9NYmfTSpoKtHlDFF9nlc4atMOmM6A+w2g9vkreJNE Riuk0sPiGiXAbFrimnTSnyW3CyBRS3wdOUhP4PuAHjkQgLMxhi3ZpXDGlbWp5gxaFC3F NmN23Mm0C4IiXoGlciPUFihim1AxbIuG+Du++6R4Gcwpvh5YtootBF9xZGCaEDlFlN/y BcH8+9wbCg8GLnI1Tr+f3H/68qsIaWUTn9i4vhZ2aTUAohLIZlft1MikJnN1UTQiUdCb LdSBaB37i86z+Z5KOi4mY7JxgncavAqq+I/HJ4R4fHJUsemniTjG3iawa+Bx9zsG2eYp fPtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VNy3sGl6; 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 a23-v6si29834425pfe.364.2018.05.28.09.47.01; Mon, 28 May 2018 09:47:16 -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=@kernel.org header.s=default header.b=VNy3sGl6; 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 S940411AbeE1Qpm (ORCPT + 99 others); Mon, 28 May 2018 12:45:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:55186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932247AbeE1KHI (ORCPT ); Mon, 28 May 2018 06:07:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C44E7208AE; Mon, 28 May 2018 10:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502027; bh=byvSTJfyyd/h/xv9wv2daB95yGDYftUZzI29ZCmH+kQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VNy3sGl6hNoUNdQpyO8xJcv8NhWo1WWjPhOBJqKCc0HR0nS/efPLYaNbbCfz9G0Sf 98j+VknCmVzsNUqDWe1sziMsa1m6uzyFAymNdby4RV3VdBDPshKOQf6muy2efEB9Hn Kwb24ofArilR++GJyajdtHh0kkp3uqGC+YByHx20= 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 3.18 033/185] IB/ipoib: Fix for potential no-carrier state Date: Mon, 28 May 2018 12:01:14 +0200 Message-Id: <20180528100052.639353896@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-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 @@ -1644,6 +1644,9 @@ static struct net_device *ipoib_add_port goto event_failed; } + /* 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",