linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Murthy Bhat <Murthy.Bhat@microchip.com>,
	Scott Teel <scott.teel@microchip.com>,
	Scott Benesh <scott.benesh@microchip.com>,
	Kevin Barnett <kevin.barnett@microchip.com>,
	Don Brace <don.brace@microchip.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	storagedev@microchip.com, linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 30/57] scsi: smartpqi: Correct request leakage during reset operations
Date: Mon,  3 May 2021 12:39:14 -0400	[thread overview]
Message-ID: <20210503163941.2853291-30-sashal@kernel.org> (raw)
In-Reply-To: <20210503163941.2853291-1-sashal@kernel.org>

From: Murthy Bhat <Murthy.Bhat@microchip.com>

[ 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 <scott.teel@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Murthy Bhat <Murthy.Bhat@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 093ed5d1eef2..3480a0a66771 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -5513,6 +5513,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);
 			}
 
@@ -5549,6 +5551,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


  parent reply	other threads:[~2021-05-03 16:52 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 16:38 [PATCH AUTOSEL 5.4 01/57] drm: Added orientation quirk for OneGX1 Pro Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 02/57] drm/qxl: release shadow on shutdown Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 03/57] drm/amd/display: Check for DSC support instead of ASIC revision Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 04/57] drm/amd/display: Don't optimize bandwidth before disabling planes Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 05/57] scsi: lpfc: Fix incorrect dbde assignment when building target abts wqe Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 06/57] scsi: lpfc: Fix pt2pt connection does not recover after LOGO Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 07/57] scsi: target: pscsi: Fix warning in pscsi_complete_cmd() Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 08/57] media: ite-cir: check for receive overflow Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 09/57] media: drivers: media: pci: sta2x11: fix Kconfig dependency on GPIOLIB Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 10/57] media: imx: capture: Return -EPIPE from __capture_legacy_try_fmt() Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 11/57] power: supply: bq27xxx: fix power_avg for newer ICs Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 12/57] extcon: arizona: Fix some issues when HPDET IRQ fires after the jack has been unplugged Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 13/57] extcon: arizona: Fix various races on driver unbind Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 14/57] media: media/saa7164: fix saa7164_encoder_register() memory leak bugs Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 15/57] media: gspca/sq905.c: fix uninitialized variable Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 16/57] media: pci: saa7164: Rudimentary spelling fixes in the file saa7164-types.h Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 17/57] power: supply: Use IRQF_ONESHOT Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 18/57] drm/bridge/analogix/anx78xx: Setup encoder before registering connector Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 19/57] drm/bridge/analogix/anx78xx: Cleanup on error in anx78xx_bridge_attach() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 20/57] drm/amdgpu: mask the xgmi number of hops reported from psp to kfd Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 21/57] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 22/57] drm/amdgpu : Fix asic reset regression issue introduce by 8f211fe8ac7c4f Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 23/57] drm/amd/display: Fix UBSAN warning for not a valid value for type '_Bool' Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 24/57] drm/amd/display: fix dml prefetch validation Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 25/57] scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 26/57] drm/vkms: fix misuse of WARN_ON Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 27/57] scsi: qla2xxx: Fix use after free in bsg Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 28/57] mmc: sdhci-pci: Add PCI IDs for Intel LKF Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 29/57] ata: ahci: Disable SXS for Hisilicon Kunpeng920 Sasha Levin
2021-05-03 16:39 ` Sasha Levin [this message]
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 31/57] scsi: smartpqi: Add new PCI IDs Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 32/57] scsi: scsi_dh_alua: Remove check for ASC 24h in alua_rtpg() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 33/57] media: em28xx: fix memory leak Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 34/57] media: vivid: update EDID Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 35/57] clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 36/57] power: supply: generic-adc-battery: fix possible use-after-free in gab_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 37/57] power: supply: s3c_adc_battery: fix possible use-after-free in s3c_adc_bat_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 38/57] media: tc358743: fix possible use-after-free in tc358743_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 39/57] media: adv7604: fix possible use-after-free in adv76xx_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 40/57] media: i2c: adv7511-v4l2: fix possible use-after-free in adv7511_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 41/57] media: i2c: tda1997: Fix possible use-after-free in tda1997x_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 42/57] media: i2c: adv7842: fix possible use-after-free in adv7842_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 43/57] media: platform: sti: Fix runtime PM imbalance in regs_show Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 44/57] media: dvb-usb: fix memory leak in dvb_usb_adapter_init Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 45/57] media: gscpa/stv06xx: fix memory leak Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 46/57] sched/fair: Ignore percpu threads for imbalance pulls Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 47/57] drm/msm/mdp5: Configure PP_SYNC_HEIGHT to double the vtotal Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 48/57] drm/msm/mdp5: Do not multiply vclk line count by 100 Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 49/57] drm/amdkfd: Fix cat debugfs hang_hws file causes system crash bug Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 50/57] amdgpu: avoid incorrect %hu format string Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 51/57] drm/amdgpu: fix NULL pointer dereference Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 52/57] scsi: lpfc: Fix crash when a REG_RPI mailbox fails triggering a LOGO response Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 53/57] scsi: lpfc: Fix error handling for mailboxes completed in MBX_POLL mode Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 54/57] scsi: lpfc: Remove unsupported mbox PORT_CAPABILITIES logic Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 55/57] mfd: arizona: Fix rumtime PM imbalance on error Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 56/57] scsi: libfc: Fix a format specifier Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 57/57] s390/archrandom: add parameter check for s390_arch_random_generate Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210503163941.2853291-30-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Murthy.Bhat@microchip.com \
    --cc=don.brace@microchip.com \
    --cc=kevin.barnett@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=scott.benesh@microchip.com \
    --cc=scott.teel@microchip.com \
    --cc=stable@vger.kernel.org \
    --cc=storagedev@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).