From: Dan Williams Date: Thu, 9 Feb 2012 07:20:41 +0000 (-0800) Subject: [SCSI] libsas: fixup target_port_protocols for expanders that don't report sata X-Git-Tag: upstream/snapshot3+hdmi~7783^2~81 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77c309f3cdf9e217032dfe330f5881d352bb0436;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [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 Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 14e3244..05acd9e 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -251,6 +251,8 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) phy->phy->identify.device_type = dr->attached_dev_type; phy->phy->identify.initiator_port_protocols = phy->attached_iproto; phy->phy->identify.target_port_protocols = phy->attached_tproto; + if (!phy->attached_tproto && dr->attached_sata_dev) + phy->phy->identify.target_port_protocols = SAS_PROTOCOL_SATA; phy->phy->identify.phy_identifier = phy_id; phy->phy->minimum_linkrate_hw = dr->hmin_linkrate; phy->phy->maximum_linkrate_hw = dr->hmax_linkrate;