Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3478406imu; Sun, 11 Nov 2018 16:02:10 -0800 (PST) X-Google-Smtp-Source: AJdET5eR3DrdtdYKh5ggg8oElR1g5zIyja/zsXz92/4nReDi5+fErMdTuFI5AYzbrWJ5CUJ4fEAI X-Received: by 2002:a62:1bd6:: with SMTP id b205-v6mr1263594pfb.178.1541980930402; Sun, 11 Nov 2018 16:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980930; cv=none; d=google.com; s=arc-20160816; b=Qo15/pPI2GKYfvcXnf1xPnJpnHIGo19fuAbBmIdqVimZGTHpgKJGe2LIUnIo0BtLm4 WSqZdU5XxrEd9m/r5P/gW3zesvmdR5oZvFhhyEshCpNi61zsDJf4eZeZC+GPBJa5WtNg BqrTuXzB4zpbXZae2mbb/8YIZTFrICyQI57bMIzBSU5c5NvWAar6oIRW3J6EBkOYc7sD GdsXxx642d6lM4HyBymxqbhCqGpmGgIacsl+qtnwFYdKdEIcl/FlISGFc9lieUn11qdE 5hoM174QXdHls8kSwEO0ONxeEjIgqkLk9JrYYPl3xk67ZLnRIwarAHP9hro/aaVSEhOw vcIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UlPct0SYdUMOfyUL/sMFjD1RAPvK3KZEnrjUNj2brL8=; b=rPj+rXf/GhQzDbF2YLyDfTKiD02KUXEHDWER2zeTE+loI2+7mQSQGRXHGAD1c5xYKr EldcyBNHWItA68bKNYl6BrtIN/5L4GkoevYHPimlj3+vDbFkq/Y86A24x3RF3nB5i+/l 2AOzpAGNEdjEXK8MSCbcFvF6xulKNncR7tbcMXTkwIDYHx9tLl0pGBqn2oK87HwpiZzE OxJ49DTGoVEZ7SXjupFq4GzJvbzoaOfAEU5p0NHw9xpvO4731gKhOGRPX+3DPC6ptfby dKOPyLAUmwRGnH7XD5+P4Zp2ctLvx4stTifuQQuPHEzdlCncsQ2ZdZZENLN3HvVjMNjv 72IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BfmqabT1; 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 b24-v6si13136996pgb.50.2018.11.11.16.01.55; Sun, 11 Nov 2018 16:02:10 -0800 (PST) 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=BfmqabT1; 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 S1732326AbeKLISB (ORCPT + 99 others); Mon, 12 Nov 2018 03:18:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:35400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732301AbeKLISA (ORCPT ); Mon, 12 Nov 2018 03:18:00 -0500 Received: from localhost (unknown [206.108.79.134]) (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 9E8A12154B; Sun, 11 Nov 2018 22:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975284; bh=dErEsMI3IKu091BW8mxPdoqnmg9ocM3AYVtPoWVrMtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BfmqabT1syqPWyRfsSVWy6PtYvbmstnyz260y+l9eEeTPd/CIMd3CXBR1YhKwRSKd /rsa4Y2pXH7lmWmP82781s3MVQ93dLLFjbAM5g+JqePSSX9/t/mKo/S2L2bab4mnL1 5iuqa+J4hR0aJyc3F2V2RAnC1qHZXV3vXzBkJf1A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Moni Shoua , Artemy Kovalyov , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 179/361] IB/mlx5: Allow transition of DCI QP to reset Date: Sun, 11 Nov 2018 14:18:46 -0800 Message-Id: <20181111221645.321058753@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Moni Shoua [ Upstream commit 99ed748e878a99c6c7b87bbec063eefd9e47cb42 ] The transition is allowed from any state and the atrribute mask must be IB_QP_STATE. Fixes: c32a4f296e1d ("IB/mlx5: Add support for DC Initiator QP") Signed-off-by: Moni Shoua Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/qp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -3243,7 +3243,9 @@ static bool modify_dci_qp_is_ok(enum ib_ int req = IB_QP_STATE; int opt = 0; - if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) { + if (new_state == IB_QPS_RESET) { + return is_valid_mask(attr_mask, req, opt); + } else if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) { req |= IB_QP_PKEY_INDEX | IB_QP_PORT; return is_valid_mask(attr_mask, req, opt); } else if (cur_state == IB_QPS_INIT && new_state == IB_QPS_INIT) {