Skip to contentSkip to conversation

libsas: Fixup transport protocol definition in sas_get_ata_info()

PATCH In review Hannes Reinecke 3 participants 3 messages Apr 7, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libsas: Fixup transport protocol definition in sas_get_ata_info()

'tproto' specifies the transport protocol, not the device type. So use the correct definitions here.

---
 drivers/scsi/libsas/sas_ata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libsas/sas_ata.c +1 -1
index 9c706d8..83b182a 100644
@@ -279,7 +279,7 @@ int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
 	if (phy->attached_tproto & SAS_PROTOCOL_STP)
 		dev->tproto = phy->attached_tproto;
 	if (phy->attached_sata_dev)
-		dev->tproto |= SAS_SATA_DEV;
+		dev->tproto |= SAS_PROTOCOL_SATA;
 
 	if (phy->attached_dev_type == SAS_SATA_PENDING)
 		dev->dev_type = SAS_SATA_PENDING;
Signature · 1 line
1.8.5.2
#1 lore raw
Quoted 4 lines · Hannes Reinecke

'tproto' specifies the transport protocol, not the device type. So use the correct definitions here.

This looks correct, but opens up questions:

- how did you find this?
- why didn't we notice earlier?

Also I wonder if we should move to more __bitwise types for these kinds of things..

maintainer
#2 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Hannes Reinecke

'tproto' specifies the transport protocol, not the device type. So use the correct definitions here.

This looks correct, but opens up questions:

I'm not entirely convinced it is. I think the correct value might be SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP which is the same numeric value as SAS_SATA_DEV.

STP is the SATA Tunnelling Protocol. It's what you use to talk to an expander with a directly attached SATA device on one of its ports. SAS_PROTOCOL_SATA means talk directly to the device using SATA (not SAS tunnelled SATA) and is only appropriate for a SATA device directly attached to the SAS initiator.

This function is examining an expander phy, so the initiator will always have to speak STP to it, regardless of what the actual value is.

James

Quoted 10 lines

- how did you find this?
- why didn't we notice earlier?

Also I wonder if we should move to more __bitwise types for these kinds of things..
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html