All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] libsas: Fixup transport protocol definition in sas_get_ata_info()
@ 2015-04-07  8:49 Hannes Reinecke
  2015-04-07 15:45 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Reinecke @ 2015-04-07  8:49 UTC (permalink / raw)
  To: James Bottomley; +Cc: Christoph Hellwig, linux-scsi, Hannes Reinecke

'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(-)

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;
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] libsas: Fixup transport protocol definition in sas_get_ata_info()
  2015-04-07  8:49 [PATCHv2] libsas: Fixup transport protocol definition in sas_get_ata_info() Hannes Reinecke
@ 2015-04-07 15:45 ` Christoph Hellwig
  2015-04-07 15:59   ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2015-04-07 15:45 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: James Bottomley, Christoph Hellwig, linux-scsi

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..

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] libsas: Fixup transport protocol definition in sas_get_ata_info()
  2015-04-07 15:45 ` Christoph Hellwig
@ 2015-04-07 15:59   ` James Bottomley
  0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2015-04-07 15:59 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Hannes Reinecke, linux-scsi

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
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-07 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07  8:49 [PATCHv2] libsas: Fixup transport protocol definition in sas_get_ata_info() Hannes Reinecke
2015-04-07 15:45 ` Christoph Hellwig
2015-04-07 15:59   ` James Bottomley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.