linux/drivers/scsi/pm8001
Niklas Cassel bfaa56caca scsi: pm80xx: Fix pm8001_abort_task() for chip_8006 when using an expander
[ Upstream commit ad70c6bc77 ]

For a direct attached device, attached_phy contains the local phy id.
For a device behind an expander, attached_phy contains the remote phy
id, not the local phy id.

The pm8001_ha->phy array only contains the phys of the HBA.  It does not
contain the phys of the expander.

Thus, you cannot use attached_phy to index the pm8001_ha->phy array,
without first verifying that the device is directly attached.

Use the pm80xx_get_local_phy_id() helper to make sure that we use the
local phy id to index the array, regardless if the device is directly
attached or not.

Fixes: 869ddbdcae ("scsi: pm80xx: corrected SATA abort handling sequence.")
Reviewed-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20250814173215.1765055-21-cassel@kernel.org
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-15 12:03:44 +02:00
..
Makefile scsi: pm80xx: Add tracepoints 2021-11-18 22:26:58 -05:00
pm80xx_hwi.c scsi: pm80xx: Add helper function to get the local phy id 2025-10-15 12:03:44 +02:00
pm80xx_hwi.h scsi: pm80xx: Set RETFIS when requested by libsas 2023-08-21 17:11:41 -04:00
pm80xx_tracepoints.c scsi: pm80xx: Add tracepoints 2021-11-18 22:26:58 -05:00
pm80xx_tracepoints.h scsi: pm80xx: Add pm80xx_mpi_build_cmd() tracepoint 2021-11-18 22:26:58 -05:00
pm8001_chips.h [SCSI] pm8001: fix endian issue with code optimization. 2012-02-29 16:54:09 -06:00
pm8001_ctl.c scsi: pm80xx: Add __nonstring annotations for unterminated strings 2025-04-11 21:54:59 -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 reserved tags from 8 to 128 2024-12-04 14:46:58 -05:00
pm8001_hwi.c scsi: pm80xx: Add helper function to get the local phy id 2025-10-15 12:03:44 +02:00
pm8001_hwi.h scsi: pm80xx: Set RETFIS when requested by libsas 2023-08-21 17:11:41 -04:00
pm8001_init.c Mainly individually changelogged singleton patches. The patch series in 2025-01-26 17:50:53 -08:00
pm8001_sas.c scsi: pm80xx: Fix pm8001_abort_task() for chip_8006 when using an expander 2025-10-15 12:03:44 +02:00
pm8001_sas.h scsi: pm80xx: Add helper function to get the local phy id 2025-10-15 12:03:44 +02:00