Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483092pxj; Mon, 10 May 2021 04:11:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGAIual/+EKuoDtwcIAfCLh6GWULF00aRwRfBtXH2ZzuUSEU8UCQoioWitQRTVG9PmclyQ X-Received: by 2002:a05:6e02:194b:: with SMTP id x11mr21958968ilu.213.1620645061149; Mon, 10 May 2021 04:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645061; cv=none; d=google.com; s=arc-20160816; b=x7u2nRTVKQeHi9tRDJOdDJW6BqhPGlv1VCyZ4eKTKQun6vlQ1X7NXB8biIYei2NoIm hfBztEQ7AD16iz7YB2oCOJWke0EBGG/Kkd1Te/+tcn2HZhWtjdOTwyN/mrySuOktp+dc efjy2tnfugPSz+woeNb71I+gM0MtbcSeB4l0fZX86rFYUDt75G9NHGzj0/fL5olzcz8R s8VUAHXCobH8c+cnsNr1TlgWiwcarC9NXQvJO2rQRO7ZYbGcNKys28nGkcgJA00GDaWJ pPtvGZVGAx2u7es0asKedBqTkPA9mlQHYiD9E/Nx/0atB35F+HnbvO0L67U6QMcKv28L Jd6g== 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=YPldyKMl7R0eqrAtl3VtJ6R+vMpBTJYrndaKSasQSPI=; b=wGWxXfas0wlhRWTUWOCtgQqwVpJ/0FgezLze69TrqE5EaBVFE7k38gfyJqAPkOHK58 uatrLiJvR3ZpSS9TXJawflJklIfVcQjavxjR/s491l5N4mPTuBOuq+Np4/1zdfomK5yA s7FOBjZnyWQHNP/V4vEB7JoLSUog8XhuIWMLSXq2piVnCsEr0On5QWC4MqBJ+xj8Lsoh 06nuKsHUxm10+f8RUgnZr+CT1havHaq1LqurWGbEVTuN21m5yS5S8tWvDPtLDJmwoMSW a+48tYFotfFDBfF6IfvNU/OGG75Fa8rbfhEYZlXVKwxNBmHoalmhmgLps5dGhd0khGf/ cHQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kFljlhu9; 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=pass (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 b3si3771852ilj.20.2021.05.10.04.10.48; Mon, 10 May 2021 04:11:01 -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=@linuxfoundation.org header.s=korg header.b=kFljlhu9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236568AbhEJLIS (ORCPT + 99 others); Mon, 10 May 2021 07:08:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:57152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232617AbhEJKrx (ORCPT ); Mon, 10 May 2021 06:47:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 97233619B1; Mon, 10 May 2021 10:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643072; bh=UZMSi0/2XoQo0EFNqXmGoDhMtaHFCOrzQywANksF0sU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kFljlhu9LWvXIFD/cXbBNlWHdMY5ol6zi3bf9Tz7oR7wW+J+QUwkU3DoZazpq1BZU mmB+e479vOhQ0/880tV8V0LWH6UH4MFz+MPjJeBuf3Te8bFwHGGME3BM4fI1Y7GAMM VIBzBlIk9mQu211VrwmHgFbIL+j9KbUZedmluymA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Scott Teel , Scott Benesh , Kevin Barnett , Murthy Bhat , Don Brace , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 167/299] scsi: smartpqi: Correct request leakage during reset operations Date: Mon, 10 May 2021 12:19:24 +0200 Message-Id: <20210510102010.470286510@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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: Murthy Bhat [ Upstream commit b622a601a13ae5974c5b0aeecb990c224b8db0d9 ] While failing queued I/Os in TMF path, there was a request leak and hence stale entries in request pool with ref count being non-zero. In shutdown path we have a BUG_ON to catch stuck I/O either in firmware or in the driver. The stale requests caused a system crash. The I/O request pool leakage also lead to a significant performance drop. Link: https://lore.kernel.org/r/161549370379.25025.12793264112620796062.stgit@brunhilda Reviewed-by: Scott Teel Reviewed-by: Scott Benesh Reviewed-by: Kevin Barnett Signed-off-by: Murthy Bhat Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/smartpqi/smartpqi_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 9300a677510d..afd004fdce76 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -5491,6 +5491,8 @@ static void pqi_fail_io_queued_for_device(struct pqi_ctrl_info *ctrl_info, list_del(&io_request->request_list_entry); set_host_byte(scmd, DID_RESET); + pqi_free_io_request(io_request); + scsi_dma_unmap(scmd); pqi_scsi_done(scmd); } @@ -5527,6 +5529,8 @@ static void pqi_fail_io_queued_for_all_devices(struct pqi_ctrl_info *ctrl_info) list_del(&io_request->request_list_entry); set_host_byte(scmd, DID_RESET); + pqi_free_io_request(io_request); + scsi_dma_unmap(scmd); pqi_scsi_done(scmd); } -- 2.30.2