Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3700783pxk; Tue, 29 Sep 2020 04:11:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1mQ7+w0rcjaGrau/lawXQuBrmhAf9PHSLShwSWqEgBIbgknmP0TzD16dFfJWbGQS4kLuW X-Received: by 2002:a17:906:f9d3:: with SMTP id lj19mr3242805ejb.346.1601377889862; Tue, 29 Sep 2020 04:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601377889; cv=none; d=google.com; s=arc-20160816; b=wN4iksTrXqJTf6+x/a4VKA1pGKO8F1KBZKHBaUx25EB56KTDvfQPf7rLH+f7G2Ryhp 2fbFhH77VwuN/dlt31qfApEDdn0rjPrUjfSSk4QHlwC8UQ58fz/eRdIkHyyFD5eq0Hyz Rx0LBJNFtXEG/cYHQDI3oMGlchIObQIMzqQ6fzpBDtGu9JMW5ccUxpc9vlaFpPiJJeDA RELM7HSOtM2EdBRSuV+D/fWGwCb0BJJXm/viQTZf924Pn9KyO94TV/p5Ym4u7CnKgo0+ EIbxp8+T7Wipp7E2bYlHQuuYWv5UBZ7v1PWWSUBmntxsLED3ghAg29Zh5Lb5K3NqwmxD Rvqw== 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=ABHL6SaxnYzk6zvg/3GBxE+Bw96PiB9Fsd/ocU7WT1Q=; b=yh4sml7VU6LxcDXki7YGWBhTaiIIn/PDoFi+yYUlbUebDFiTRFLeP1Cv3kXxvsOmp0 hL8KZqfvvuHAKBFzZfLPvW4Q/yvBDHNi39hXgZanPTgGhgkSJ7wFEdHOTP+lpCwwzICi XRmz5HJ2isT0/4DavsRDv1XBCmz+laT5wlz5BmS49fgpreyRWjGA+upcF9m07/9gZcrP NzjQJyz96ecSbbCLmKYteji3SFM5uF1nPvDs2dnCTvDV7U/fzpSgfWphF3HTMSdxarFu suQf3A4N4d+fNDPNPBH1r3c3m/6/J2AsgqvXkfv+rTb93dRHXVMPfkc79+7jXs8QgmGr H2Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RWJh9YIc; 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 f11si2576478edq.528.2020.09.29.04.11.06; Tue, 29 Sep 2020 04:11:29 -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=RWJh9YIc; 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 S1729034AbgI2LJA (ORCPT + 99 others); Tue, 29 Sep 2020 07:09:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728705AbgI2LIl (ORCPT ); Tue, 29 Sep 2020 07:08:41 -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 C575421941; Tue, 29 Sep 2020 11:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377720; bh=eH1u8TpVEA7pBTbGwYva86pxUFXVAZaJOjMrT6pM4/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RWJh9YIcpijQ5/2xH1Qv+6jFFlncn/Jv/k4J88DLOFVtJfv+MRooD7jMkek8HTOdd Zn+6kGfc4cBFuO+BpKVJ416mwYpMi8ZOQ87JzkkUj3NqJhRFOkCbJAJDMtP4aZBbXV tdik8haXWsjAEUXqRxJTKmL+3cJg1fxUi2+adwS8= 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.9 047/121] scsi: lpfc: Fix RQ buffer leakage when no IOCBs available Date: Tue, 29 Sep 2020 12:59:51 +0200 Message-Id: <20200929105932.523273967@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105930.172747117@linuxfoundation.org> References: <20200929105930.172747117@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 1c34dc3355498..08c76c361e8dc 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -15648,6 +15648,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