Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] libsas: fixup target_port_protocols for expanders that don't report sata

If discovery returns 0 for target_port_protocols but shows an attached
sata device, just report SAS_PROTOCOL_SATA in the identify data so
userspace can reliably search for sata devices in the domain.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Dan Williams and committed by
James Bottomley
77c309f3 899fcf40

+2
+2
drivers/scsi/libsas/sas_expander.c
··· 251 251 phy->phy->identify.device_type = dr->attached_dev_type; 252 252 phy->phy->identify.initiator_port_protocols = phy->attached_iproto; 253 253 phy->phy->identify.target_port_protocols = phy->attached_tproto; 254 + if (!phy->attached_tproto && dr->attached_sata_dev) 255 + phy->phy->identify.target_port_protocols = SAS_PROTOCOL_SATA; 254 256 phy->phy->identify.phy_identifier = phy_id; 255 257 phy->phy->minimum_linkrate_hw = dr->hmin_linkrate; 256 258 phy->phy->maximum_linkrate_hw = dr->hmax_linkrate;