diff mbox

[PATCHv2] libsas: Fixup transport protocol definition in sas_get_ata_info()

Message ID 1428396547-87814-1-git-send-email-hare@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Hannes Reinecke April 7, 2015, 8:49 a.m. UTC
'tproto' specifies the transport protocol, not the device type.
So use the correct definitions here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/libsas/sas_ata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig April 7, 2015, 3:45 p.m. UTC | #1
On Tue, Apr 07, 2015 at 10:49:07AM +0200, Hannes Reinecke wrote:
> 'tproto' specifies the transport protocol, not the device type.
> So use the correct definitions here.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>

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..
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
James Bottomley April 7, 2015, 3:59 p.m. UTC | #2
On Tue, 2015-04-07 at 17:45 +0200, Christoph Hellwig wrote:
> On Tue, Apr 07, 2015 at 10:49:07AM +0200, Hannes Reinecke wrote:
> > 'tproto' specifies the transport protocol, not the device type.
> > So use the correct definitions here.
> > 
> > Signed-off-by: Hannes Reinecke <hare@suse.de>
> 
> 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

>  - 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 9c706d8..83b182a 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -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;