Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3758408pxk; Tue, 29 Sep 2020 05:41:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5KYHpik01WLD7UBMhVXhtXuQehCEgocwpL7+4tRcrO6KIHnIdg8oLnZUYFUvTIo90R3Yl X-Received: by 2002:a17:906:d7a2:: with SMTP id pk2mr3562548ejb.149.1601383260367; Tue, 29 Sep 2020 05:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601383260; cv=none; d=google.com; s=arc-20160816; b=lCPJwSe5DWExJqnLxUw1BaCYkpFxVVz3shZH/CpP79BSHuxKMI/BQfFxrRVWyFihnP O3kzVoyw9pPURnfQUbk7gdqKR45TfvhYTB3NlK464yfWFJt+Yef0eqwIMG3QSE+2N0y8 D3iXjklvFB+TAKkz5ijl8tdH/wS2R6Drc20671/puLqxghnkW0/t3MFI/HI3lC+bQ6ic zmgh0JyM4kxluvlGjczDUdaIP9hVxJEUbmYAnzwzmeO8n6wIP/OWyRLvlVKbGkwmS6qB ihGZ3UQg+D47Z4PuwY6l+jpm8rNennXYZc+1+M7pRbEwd1r+ijI0p3zcx3UXSWteW/w7 hMGA== 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=8gQWAkfzD+Z+c8vt//4fZtMe0M2KcTI2HdeQfQj4Ows=; b=kMkmAIppBujKIxLN8VMhboyDSLF3fdYhwPKEWIH9crM9TmG5/+LDWBC/U68U1I7weH Y12XZ5qwiM9/N9Vx5kIKNb8+x+4p5mfxQP/b/WLphyte92Aa8W068rpPBQtJbbOqPFzl YsuHCzTpYeS+szrMJcs8neyWirRVXguvcxc1MjHeftDO5eDViG0tRtn4mgHyVgovSG6o 4VUgkz2wzYjgXkXhH7znUjIA2eT8l1CUPh/FTJ0AgiFer8lHQzyLljKiBytrNcNQvIIl KEZECBtPC0IbOBJDBptAkOoPpkLeSF3GLxIBRZ3N7YTtIrVFbF2G3FfK0raZBmEgYf6g 5hwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vXEPBm9k; 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 g10si2382568edv.47.2020.09.29.05.40.36; Tue, 29 Sep 2020 05:41:00 -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=vXEPBm9k; 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 S1733012AbgI2Mjq (ORCPT + 99 others); Tue, 29 Sep 2020 08:39:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:32974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729583AbgI2LQZ (ORCPT ); Tue, 29 Sep 2020 07:16:25 -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 3337B20848; Tue, 29 Sep 2020 11:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601378184; bh=gJt5tl5bFwD12yQeDxuwhK+rvQNS3vF57KVmKFCezj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vXEPBm9klggkYDMs5Kod4vLlq95HmqZPb01+J7T25crDC93sPZqDKJQjwrY3+8Spn bo7IF+gAsJKztBS8RgCCN9CgEg60ca423tYNLILi4wsZo8BhP7JdGfGJqQKuMpqaRt O05n4fwOVlMv5cg02sxHj0DsQDi6AocNnk4EEzP0= 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.14 062/166] scsi: lpfc: Fix RQ buffer leakage when no IOCBs available Date: Tue, 29 Sep 2020 12:59:34 +0200 Message-Id: <20200929105938.317360876@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105935.184737111@linuxfoundation.org> References: <20200929105935.184737111@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 480d2d467f7a6..45445dafc80cf 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -17038,6 +17038,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