]> Gentwo Git Trees - linux/.git/commit
scsi: pm80xx: Fix pm8001_abort_task() for chip_8006 when using an expander
authorNiklas Cassel <cassel@kernel.org>
Thu, 14 Aug 2025 17:32:24 +0000 (19:32 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 19 Aug 2025 02:08:31 +0000 (22:08 -0400)
commitad70c6bc776b53e61c8db6533c833aff0ff5da8b
tree58d2e4003f88b54bd2eb4f8204e154fba702fe9b
parentb4ec98303f9fc9b1da0053106716db6a7e002d8b
scsi: pm80xx: Fix pm8001_abort_task() for chip_8006 when using an expander

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: 869ddbdcae3b ("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>
drivers/scsi/pm8001/pm8001_sas.c