From: Ian Rogers <irogers@google.com>
To: Jack Wang <jinpu.wang@cloud.ionos.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <mkp@kernel.org>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Elkin Cruz <elkin@google.com>,
Ian Rogers <irogers@google.com>
Subject: [PATCH] scsi: pm8001: Fix abort completion status in pm8001_mpi_task_abort_resp()
Date: Thu, 19 Nov 2026 09:09:05 -0800 [thread overview]
Message-ID: <20261119170905.1530613-1-irogers@google.com> (raw)
In pm8001_mpi_task_abort_resp(), the IO_NOT_VALID branch assigns
TMF_RESP_FUNC_FAILED (enum tmf_resp, 5) to ts->resp (enum
service_response) instead of ts->stat, leaving ts->stat at 0. In
addition, switch (status) has no default case, so any other non-zero
firmware abort failure status leaves both ts->resp and ts->stat at
their zero-initialized values (SAS_TASK_COMPLETE and
SAS_SAM_STAT_GOOD), causing sas_execute_internal_abort() to falsely
treat a failed abort as TMF_RESP_FUNC_COMPLETE.
Set ts->resp = SAS_TASK_COMPLETE and ts->stat = TMF_RESP_FUNC_FAILED
for both IO_NOT_VALID and default failure statuses, matching libsas
and hisi_sas expectations.
Found via Clang -Wassign-enum on an x86_64 allyesconfig build.
Verified by building drivers/scsi/pm8001/pm8001_hwi.o with LLVM=1 W=1
(-Werror) and -Wassign-enum, and with a standalone C reproducer under
ASan/UBSan; not runtime-tested on physical PM8001/PM80xx hardware.
Fixes: dbf9bfe61571 ("[SCSI] pm8001: add SAS/SATA HBA driver")
Signed-off-by: Ian Rogers <irogers@google.com>
---
drivers/scsi/pm8001/pm8001_hwi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 55a01e533fd1..b8c59c152d89 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -3478,7 +3478,12 @@ int pm8001_mpi_task_abort_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
break;
case IO_NOT_VALID:
pm8001_dbg(pm8001_ha, FAIL, "IO_NOT_VALID for tag %#x\n", tag);
- ts->resp = TMF_RESP_FUNC_FAILED;
+ ts->resp = SAS_TASK_COMPLETE;
+ ts->stat = TMF_RESP_FUNC_FAILED;
+ break;
+ default:
+ ts->resp = SAS_TASK_COMPLETE;
+ ts->stat = TMF_RESP_FUNC_FAILED;
break;
}
spin_lock_irqsave(&t->task_state_lock, flags);
--
2.56.1.708.g77570a6a1d-goog
next reply other threads:[~2026-11-19 17:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 17:09 Ian Rogers [this message]
2026-11-21 2:02 ` [PATCH] scsi: pm8001: Fix abort completion status in pm8001_mpi_task_abort_resp() Martin K. Petersen
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=20261119170905.1530613-1-irogers@google.com \
--to=irogers@google.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=elkin@google.com \
--cc=jinpu.wang@cloud.ionos.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mkp@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.