Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp838990ybi; Fri, 12 Jul 2019 05:30:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy06aAmX8eevlYq3fCZujVyFtskQpNtcK3TVQ4oucjXt1i8zUzZk0mt/kdIS9DSXt5l/VPG X-Received: by 2002:a17:90a:d80b:: with SMTP id a11mr10962792pjv.53.1562934630949; Fri, 12 Jul 2019 05:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934630; cv=none; d=google.com; s=arc-20160816; b=gLRhDE914RB0+KiXjCfOXeZ9f8EV9nbV1ppRPi7fNhulvLzOCe8GToOXhSk9YAscn3 xS7gt0wnBo41ppzxucZKtjAFD7Z8gb/xOLPdY1jWc7DeFnd90ntfiYwn0v8FjpSJcWLb HsQgHnrwQlOAVeS0ln5CY3CaH1DaVDtqxU8d3oC6IvTFW97Wq8Yag/LS+VDCOEtuknM4 jjBMB1OnIo6mABYp4397X+cTxfBOiUABU++gThVIfP3z/XG2nRcICFDIhfeDDA+Un9gA AeYmsjEyvb/maanLA+JxQbhUy5JClr4WFrMJN6XvPFrZjHAqA7vc9U+MGVi9LyBc9RvL vuwQ== 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=7yZVzoes2SE7vpn/oTKxC0cGJB12ekmPRYV0f9a8/AI=; b=leVqwzyOAxDmbjecHRkaGGyJX+vhSWe7IzexB0rnBJDxM5ne1B77z90V9j7CgaDbHN uRridZ5fV9/RTzlEFaH2qLwSd6RE9sckXmnm7KQRUHW000tgD7BP8OmNR5otHC4W37LK qkBG9f5vH84mr5yrudnkm6CZbvnLadmbgHG7GQ//P0gn4gDotroIRk8u/0+UVsVR5tCC yRGrBs2TGqFKLgFO1ckA4bOEQlH4dyDZE19Lb2hqZfzZgpmbWIcts4V2Kb33DWcCn3eS skVVfu701BaNeRd0ha7j/lmUY78RgiRr7fx//3abeGPyk7bRmySPJHhmWIvm716pKBrZ w9cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ISva7/9J"; 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 q191si8157971pfq.63.2019.07.12.05.30.15; Fri, 12 Jul 2019 05:30:30 -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="ISva7/9J"; 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 S1728567AbfGLM3O (ORCPT + 99 others); Fri, 12 Jul 2019 08:29:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:43872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728389AbfGLM3K (ORCPT ); Fri, 12 Jul 2019 08:29:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 35DCD208E4; Fri, 12 Jul 2019 12:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934549; bh=MQW6gcqWb9Ou1jl2cgKzV6NWp7OyOLckPyJ0EKuQCLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ISva7/9JSrYKq+/prpgavgUYB5GeE/cT+ZFmMdYi/iKx1CJ0iJ+kC0DFYJuQux1cW 0ZacZfrlpvrQfHEVGsc3ddaH4K/rmZpw4JwNV4sJq03qyTYep1ShwfrHNF1ayeuF7I gthRCrraMYQDYTnwtDOtFyJsN0AsV9Cp4T/2mr0s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dennis Dalessandro , Mike Marciniszyn , Doug Ledford , Sasha Levin Subject: [PATCH 5.1 075/138] IB/hfi1: Handle wakeup of orphaned QPs for pio Date: Fri, 12 Jul 2019 14:18:59 +0200 Message-Id: <20190712121631.570931948@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 099a884ba4c00145cef283d36e050726311c2e95 ] Once a send context is taken down due to a link failure, any QPs waiting for pio credits will stay on the waitlist indefinitely. Fix by wakeing up all QPs linked to piowait list. Fixes: 7724105686e7 ("IB/hfi1: add driver files") Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Doug Ledford Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hfi1/pio.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/infiniband/hw/hfi1/pio.c b/drivers/infiniband/hw/hfi1/pio.c index a1de566fe95e..1ee47838d4de 100644 --- a/drivers/infiniband/hw/hfi1/pio.c +++ b/drivers/infiniband/hw/hfi1/pio.c @@ -952,6 +952,22 @@ void sc_disable(struct send_context *sc) } } spin_unlock(&sc->release_lock); + + write_seqlock(&sc->waitlock); + while (!list_empty(&sc->piowait)) { + struct iowait *wait; + struct rvt_qp *qp; + struct hfi1_qp_priv *priv; + + wait = list_first_entry(&sc->piowait, struct iowait, list); + qp = iowait_to_qp(wait); + priv = qp->priv; + list_del_init(&priv->s_iowait.list); + priv->s_iowait.lock = NULL; + hfi1_qp_wakeup(qp, RVT_S_WAIT_PIO | HFI1_S_WAIT_PIO_DRAIN); + } + write_sequnlock(&sc->waitlock); + spin_unlock_irq(&sc->alloc_lock); } -- 2.20.1