Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3698754pxk; Tue, 29 Sep 2020 04:08:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzAIhI7vXHoWdkZEhPUOSwOlAOmVjrBQNtc3ccnRqPH64Z9SIIa48jWrxZsG7FWxPfVAsd X-Received: by 2002:a17:906:a093:: with SMTP id q19mr3065747ejy.295.1601377707416; Tue, 29 Sep 2020 04:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601377707; cv=none; d=google.com; s=arc-20160816; b=pGthw5nANA2bypVxjinCE81YubrTbrC4Usp5UkC/6GG2byf1FTbYcOIsubpEprV3MY AC/SOTqpWR8+CW3VJxrjRsmPk4WOYsOJroTistA14Ov1QFEbqHvr408zEQ4tBFTENMTd ctnuERfOE9JAlqI4tG3jWyHCsryiUAiTayU3VvU0bL7nShndQIRe9rrFZjjEvP9y2XzJ MoQo5H8/fu9lI1J3H5ETM+fFeiJDyKwQAOr9phEwdZhmu/OKNHw2lnU/u0XDKM/LwVRA U8i3qzHVKpkOQ84ObSV7E7/bZQhFtcnytl1rO9lEmJ9w0bavtT9ndAjxLaEC5UYrUiyE QxGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KJ71F+bXrT2vr1t2XZSRtL5XBZ60jUDyUbZOeyD3F1U=; b=bJ/Pvc4MWFi8/Cg4D06d63ED90KX9BvZtkAPxrwisdkAb5sHdJuggFf9bP7PELdXKt h68eMqSaK7LdRTEWrNYWfzll6T9bJ0/2NJPfxKF1gWTt6Ilyqow/LrJtWbogU8UZnd7D m9sd8xzdU0+6PpKsg5J64QQ7B/qEHdRXiUc8MJnT4IaEp2+hCvt1MbSuQQFMF9R2qFGh Ggy0EJnY79W+Usot5Zh0Ay6IQ1d1RrYk9v6Z8POCKoeS/ddDLOUI70hSgBXTcbKohHt+ 6d/Tsvgp/0Lurbn9NDrGJLsU4fDsyEjQpoPU2Ep765CMvOMTvJq5T6OR9Pg90WPtUMRQ eA7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dyCT9ZEP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si2477265eds.392.2020.09.29.04.08.04; Tue, 29 Sep 2020 04:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dyCT9ZEP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728760AbgI2LFg (ORCPT + 99 others); Tue, 29 Sep 2020 07:05:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:41716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728719AbgI2LFW (ORCPT ); Tue, 29 Sep 2020 07:05:22 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 1010021D46; Tue, 29 Sep 2020 11:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377521; bh=ucOmtZeITF/dY6mbGxmxz+56Hy8EPs5r8vwwvGxI0AI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dyCT9ZEPYPe75vBxrJB5DE6uep9ZlWumj0zl0lmckYzofkwYfNtB1cn7t9W1VBFbN iQWPxCFMjxmRY3auK5T4yCQTZGJ+xEbeU6TIiTgbK1fYgCB9UUeCj+Ueli68uzYqDR V3/ZsEokRf2xoBLLPYnfa6A4FZSP9x1CIvvgc+Is= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.4 35/85] scsi: lpfc: Fix RQ buffer leakage when no IOCBs available Date: Tue, 29 Sep 2020 13:00:02 +0200 Message-Id: <20200929105929.987181938@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105928.198942536@linuxfoundation.org> References: <20200929105928.198942536@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit 39c4f1a965a9244c3ba60695e8ff8da065ec6ac4 ] The driver is occasionally seeing the following SLI Port error, requiring reset and reinit: Port Status Event: ... error 1=0x52004a01, error 2=0x218 The failure means an RQ timeout. That is, the adapter had received asynchronous receive frames, ran out of buffer slots to place the frames, and the driver did not replenish the buffer slots before a timeout occurred. The driver should not be so slow in replenishing buffers that a timeout can occur. When the driver received all the frames of a sequence, it allocates an IOCB to put the frames in. In a situation where there was no IOCB available for the frame of a sequence, the RQ buffer corresponding to the first frame of the sequence was not returned to the FW. Eventually, with enough traffic encountering the situation, the timeout occurred. Fix by releasing the buffer back to firmware whenever there is no IOCB for the first frame. [mkp: typo] Link: https://lore.kernel.org/r/20200128002312.16346-2-jsmart2021@gmail.com Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_sli.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 7a94c2d352390..97c0d79a2601f 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -15445,6 +15445,10 @@ lpfc_prep_seq(struct lpfc_vport *vport, struct hbq_dmabuf *seq_dmabuf) list_add_tail(&iocbq->list, &first_iocbq->list); } } + /* Free the sequence's header buffer */ + if (!first_iocbq) + lpfc_in_buf_free(vport->phba, &seq_dmabuf->dbuf); + return first_iocbq; } -- 2.25.1