OpenCloudOS-Kernel/drivers/scsi/pm8001
Igor Pylypiv d712d3fb48 scsi: pm80xx: Fix TMF task completion race condition
The TMF timeout timer may trigger at the same time when the response from a
controller is being handled. When this happens the SAS task may get freed
before the response processing is finished.

Fix this by calling complete() only when SAS_TASK_STATE_DONE is not set.

A similar race condition was fixed in commit b90cd6f2b9 ("scsi: libsas:
fix a race condition when smp task timeout")

Link: https://lore.kernel.org/r/20210707185945.35559-1-ipylypiv@google.com
Reviewed-by: Vishakha Channapattan <vishakhavc@google.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-07-28 23:29:09 -04:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pm80xx_hwi.c scsi: pm8001: Clean up kernel-doc and comments 2021-07-12 21:54:07 -04:00
pm80xx_hwi.h scsi: pm80xx: Completing pending I/O after fatal error 2021-04-15 22:28:59 -04:00
pm8001_chips.h [SCSI] pm8001: fix endian issue with code optimization. 2012-02-29 16:54:09 -06:00
pm8001_ctl.c scsi: pm8001: Clean up kernel-doc and comments 2021-07-12 21:54:07 -04:00
pm8001_ctl.h scsi: pm8001: Clean up white space 2021-04-12 23:21:26 -04:00
pm8001_defs.h scsi: pm80xx: Increase the number of outstanding I/O supported to 1024 2020-10-07 23:50:04 -04:00
pm8001_hwi.c scsi: pm8001: Clean up kernel-doc and comments 2021-07-12 21:54:07 -04:00
pm8001_hwi.h scsi: pm80xx: Completing pending I/O after fatal error 2021-04-15 22:28:59 -04:00
pm8001_init.c scsi: pm8001: Clean up kernel-doc and comments 2021-07-12 21:54:07 -04:00
pm8001_sas.c scsi: pm80xx: Fix TMF task completion race condition 2021-07-28 23:29:09 -04:00
pm8001_sas.h scsi: pm80xx: Remove global lock from outbound queue processing 2021-04-15 22:29:00 -04:00