linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH 1/4] sas: add flag for locally attached PHYs
@ 2005-10-20 15:25 Moore, Eric Dean
  2005-10-20 15:55 ` Luben Tuikov
                   ` (2 more replies)
  0 siblings, 3 replies; 93+ messages in thread
From: Moore, Eric Dean @ 2005-10-20 15:25 UTC (permalink / raw)
  To: Luben Tuikov, Moore, Eric Dean; +Cc: Christoph Hellwig, jejb, linux-scsi

On Wednesday, October 19, 2005 3:00 PM, Luben Tuikov wrote: 

> 
> On 10/19/05 16:08, Moore, Eric Dean wrote:
> > Luben:  He is adding support for linkerrors and link/phy reset;
> > these for for CSMI/SDI API.
> > 
> > Can you in your driver retreive link errors for the links 
> on the expanders?
> 
> Yes. (offloaded to user space)
> 

I had a very good discussion with Luben over the 
phone last night.

Luben clarified this for me in regards to expanders:

http://www.t10.org/drafts.htm#sas2 
The linkerrors can be done by issuing a SMP passthru
sending SMP_REPORT_ERROR_LOG. Section 10.4.3.6

The link/phy reset can be done by issuing a SMP passthru
sending SMP_PHY_CONTROL. Section 10.4.3.10

The mpt fusion f/w supports smp passthru, and we could for
these attributes do SMP passthru if we wanted to return
this data for expanders.  Our f/w only provides a easy special 
wrapper config page for hba phys. For expanders, we
are going to have to do smp passthru.

So Christoph what should we do in driver?  Ignore returning
data for expanders?  

Luben suggestion(correct me if I'm wrong) is this should be 
done thru user space, instead of exporting this in the 
/sys/class/sas_phy attributes.  Thus we need to export a 
SMP_PASSTHRU mechanism.  I believe there is discussion
by Christoph ( and I believe Luben backs this idea) of doing 
all this thru the /dev/sg interface.


> 
> > What and where can I get this?
> 
> http://linux.adaptec.com/sas/
> Also see my sig.

Thanks. I will check it out.

Eric Moore

^ permalink raw reply	[flat|nested] 93+ messages in thread
* RE: [PATCH 1/4] sas: add flag for locally attached PHYs
@ 2005-10-20 15:45 Moore, Eric Dean
  2005-10-20 16:16 ` Luben Tuikov
  0 siblings, 1 reply; 93+ messages in thread
From: Moore, Eric Dean @ 2005-10-20 15:45 UTC (permalink / raw)
  To: Luben Tuikov, Christoph Hellwig; +Cc: jejb, linux-scsi

On Thursday, October 20, 2005 9:29 AM,  Luben Tuikov wrote:
 
> >  That's why I need the local_attached flag as an internal
> > helper - it's not actually exposed to userland so the implementation
> 
> 1) LSI does have SMP pass through.
> 2) You absolutely do not need to represent all phys on the domain,
> which is, as I said, a completely _crazy_ idea.  Look, even 
> SDI doesn't
> want you to do that.  What SDI wants you to do is issue SMP out.
> LSI does have SMP pass through in FW so use that.
> 3) All you care about is SDI, and SDI has a _spec_.  Your job is
> twofold:
> 	- implement drivers/scsi/sdi.c so we can all use it,
> 	- implement the implementation/hw dependent way to
> 	access SDI functionality for Fusion as described above
> 	where I mention that this would be implementation dependent
> 	(dispatching to).
> 

Thanks Luben - My concern is converting our SDI/CSMI ioctls
into what is acceptable in mainstream kernel.  Agreed with Luben,
all the expander data gathering, and configuration can be done 
in user space, which is what is being done by the HP application
folks which are currently using our internal CSMI enabled drivers.
 
I added expander support a couple rev's back since none of the 
non-direct attached sas/sata devices were not scanned and reported
to the block layer above.  This was a problem when our sas driver 
was converted to work with sas_transport.

Best Regards,
Eric Moore


^ permalink raw reply	[flat|nested] 93+ messages in thread
* RE: [PATCH 1/4] sas: add flag for locally attached PHYs
@ 2005-10-19 20:08 Moore, Eric Dean
  2005-10-19 21:00 ` Luben Tuikov
  0 siblings, 1 reply; 93+ messages in thread
From: Moore, Eric Dean @ 2005-10-19 20:08 UTC (permalink / raw)
  To: Luben Tuikov, Christoph Hellwig; +Cc: jejb, linux-scsi

On Wednesday, October 19, 2005 1:24 PM, Luben Tuikov wrote: 

> On 10/19/05 14:01, Christoph Hellwig wrote:
> > Add a flag to mark a PHY as attached to the HBA as opposed 
> to beeing on
> > an expander.  This is needed because various features are 
> only supported
> > on those.  This is a crude hack, the proper fix would be to use
> > different classes for host-attached vs expander phys.  I'm 
> looking into
> > that.
> 
> The phy isn't quite "attached" -- i.e. at software level you do not
> care about that.  At least I've never heard anyone (not of 
> "the community")
> say that a phy is "attached".
> 

Luben:  He is adding support for linkerrors and link/phy reset;
these for for CSMI/SDI API.

Can you in your driver retreive link errors for the links on the expanders?

Same question for sending link and phy resets for expander phys? 
If so, then perhaps that check should be removed, and lets let the lld
decide whether these attibutes should return -EINVAL.

For fusion, these new attributes only work for the phys on the hba.
The problem is the firmware implmentation for `link errors and 
link/phy reset` is addressed only by the phy identifier for the phys
attacted directly on the host adapter.  Doesn't work for phys on
the expander. 

> You don't need to represent that.  While you can, you 
> completely do not
> need to do it.  All you should care about is the _port_.  Take a look
> at SAS section 4.
> 
> Also take a look at:
> drivers/scsi/sas/sas_phy.c,
> drivers/scsi/sas/sas_port.c and
> drivers/scsi/sas/sas_discover.c .

What and where can I get this?

Best regards,
Eric Moore

^ permalink raw reply	[flat|nested] 93+ messages in thread
* [PATCH 1/4] sas: add flag for locally attached PHYs
@ 2005-10-19 18:01 Christoph Hellwig
  2005-10-19 19:24 ` Luben Tuikov
  0 siblings, 1 reply; 93+ messages in thread
From: Christoph Hellwig @ 2005-10-19 18:01 UTC (permalink / raw)
  To: jejb, Eric.Moore; +Cc: linux-scsi

Add a flag to mark a PHY as attached to the HBA as opposed to beeing on
an expander.  This is needed because various features are only supported
on those.  This is a crude hack, the proper fix would be to use
different classes for host-attached vs expander phys.  I'm looking into
that.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/drivers/message/fusion/mptsas.c
===================================================================
--- linux-2.6.orig/drivers/message/fusion/mptsas.c	2005-10-19 15:30:29.000000000 +0200
+++ linux-2.6/drivers/message/fusion/mptsas.c	2005-10-19 19:49:35.000000000 +0200
@@ -760,7 +760,7 @@
 }
 
 static int mptsas_probe_one_phy(struct device *dev,
-		struct mptsas_phyinfo *phy_info, int index)
+		struct mptsas_phyinfo *phy_info, int index, int local)
 {
 	struct sas_phy *port;
 	int error;
@@ -853,6 +853,9 @@
 		break;
 	}
 
+	if (local)
+		port->local_attached = 1;
+
 	error = sas_phy_add(port);
 	if (error) {
 		sas_phy_free(port);
@@ -918,7 +921,7 @@
 		}
 
 		mptsas_probe_one_phy(&ioc->sh->shost_gendev,
-				     &port_info->phy_info[i], *index);
+				     &port_info->phy_info[i], *index, 1);
 		(*index)++;
 	}
 
@@ -989,7 +992,8 @@
 			}
 		}
 
-		mptsas_probe_one_phy(parent, &port_info->phy_info[i], *index);
+		mptsas_probe_one_phy(parent, &port_info->phy_info[i],
+				     *index, 0);
 		(*index)++;
 	}
 
Index: linux-2.6/include/scsi/scsi_transport_sas.h
===================================================================
--- linux-2.6.orig/include/scsi/scsi_transport_sas.h	2005-10-19 15:30:29.000000000 +0200
+++ linux-2.6/include/scsi/scsi_transport_sas.h	2005-10-19 19:49:35.000000000 +0200
@@ -56,6 +56,9 @@
 	enum sas_linkrate	maximum_linkrate;
 	u8			port_identifier;
 
+	/* internal state */
+	unsigned int		local_attached : 1;
+
 	/* link error statistics */
 	u32			invalid_dword_count;
 	u32			running_disparity_error_count;
Index: linux-2.6/drivers/scsi/scsi_transport_sas.c
===================================================================
--- linux-2.6.orig/drivers/scsi/scsi_transport_sas.c	2005-10-19 19:49:35.000000000 +0200
+++ linux-2.6/drivers/scsi/scsi_transport_sas.c	2005-10-19 19:50:55.000000000 +0200
@@ -266,6 +266,9 @@
 	struct sas_internal *i = to_sas_internal(shost->transportt);	\
 	int error;							\
 									\
+	if (!phy->local_attached)					\
+		return -EINVAL;						\
+									\
 	error = i->f->get_linkerrors(phy);				\
 	if (error)							\
 		return error;						\

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

end of thread, other threads:[~2005-10-24 23:11 UTC | newest]

Thread overview: 93+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-20 15:25 [PATCH 1/4] sas: add flag for locally attached PHYs Moore, Eric Dean
2005-10-20 15:55 ` Luben Tuikov
2005-10-20 16:01 ` Christoph Hellwig
2005-10-20 16:51   ` Luben Tuikov
2005-10-20 17:03     ` Christoph Hellwig
2005-10-20 17:22       ` Arjan van de Ven
2005-10-20 20:10         ` Luben Tuikov
2005-10-21  8:16           ` Arjan van de Ven
2005-10-20 20:02       ` Luben Tuikov
2005-10-21  0:01         ` Andrew Patterson
2005-10-21  0:46           ` ioctls, etc. (was Re: [PATCH 1/4] sas: add flag for locally attached PHYs) Jeff Garzik
2005-10-21  5:09             ` Mike Christie
2005-10-21  5:41             ` Douglas Gilbert
2005-10-21  6:19               ` Jeff Garzik
2005-10-21 18:37                 ` Luben Tuikov
2005-10-21 17:48             ` Luben Tuikov
2005-10-21 18:04               ` Christoph Hellwig
2005-10-21 18:12                 ` Luben Tuikov
2005-10-21 18:20                   ` Matthew Wilcox
2005-10-22  2:30                     ` Douglas Gilbert
2005-10-22  2:54                       ` Jeff Garzik
2005-10-22  3:53                         ` Jeff Garzik
2005-10-22 17:14                           ` Luben Tuikov
2005-10-22 17:49                             ` Francois Romieu
2005-10-22 16:51                         ` Luben Tuikov
2005-10-21 18:18               ` Jeff Garzik
2005-10-21 18:50                 ` Luben Tuikov
2005-10-21 18:54                   ` Jeff Garzik
2005-10-21 19:13                     ` Luben Tuikov
2005-10-21 19:23                       ` Jeff Garzik
2005-10-21 22:20                         ` Stefan Richter
2005-10-21 19:22                     ` Luben Tuikov
2005-10-21 19:39                       ` Jeff Garzik
2005-10-21 20:41                         ` Luben Tuikov
2005-10-21 21:12                           ` Jeff Garzik
2005-10-21 21:24                             ` Luben Tuikov
2005-10-21 21:41                               ` Jeff Garzik
2005-10-21 22:14                                 ` Luben Tuikov
2005-10-21 22:43                                   ` Jeff Garzik
2005-10-22  9:26                                     ` Stefan Richter
2005-10-22 17:23                                       ` Luben Tuikov
2005-10-22 10:42                                     ` Stefan Richter
2005-10-22 10:58                                       ` Christoph Hellwig
2005-10-22 15:28                                         ` Sergey Panov
2005-10-22 17:19                                           ` Christoph Hellwig
2005-10-22 17:38                                             ` Sergey Panov
2005-10-24 15:18                                               ` Luben Tuikov
2005-10-22 18:27                                             ` Alan Cox
2005-10-24 13:51                                             ` Luben Tuikov
2005-10-24 15:41                                               ` Alan Cox
2005-10-24 15:14                                                 ` Luben Tuikov
2005-10-24 16:03                                                   ` Regala
2005-10-24 16:13                                                     ` Luben Tuikov
2005-10-24 16:04                                                   ` Regala
2005-10-22 17:30                                         ` Luben Tuikov
2005-10-22 18:19                                           ` Jeff Garzik
2005-10-22 17:49                                         ` Stefan Richter
2005-10-24 22:09                                           ` ioctls, etc. (was Re: [PATCH 1/4] sas: add flag for locally attachedPHYs) David Lang
2005-10-24 23:09                                             ` Stefan Richter
2005-10-22 11:12                                       ` David Lang
2005-10-22 17:39                                         ` Luben Tuikov
2005-10-22 17:41                                         ` Stefan Richter
2005-10-22 17:51                                           ` Christoph Hellwig
2005-10-22 18:21                                             ` Stefan Richter
2005-10-22 18:39                                             ` Sergey Panov
2005-10-22 13:27                                       ` ioctls, etc. (was Re: [PATCH 1/4] sas: add flag for locally attached PHYs) Stefan Richter
2005-10-22 16:09                                     ` Luben Tuikov
2005-10-21 19:41                       ` Matthew Wilcox
2005-10-21 19:48                         ` Luben Tuikov
2005-10-21 19:54                           ` Matthew Wilcox
2005-10-21 20:05                             ` Luben Tuikov
2005-10-21 19:46                       ` Arjan van de Ven
2005-10-21 19:50                         ` Luben Tuikov
2005-10-21  9:06           ` [PATCH 1/4] sas: add flag for locally attached PHYs Arjan van de Ven
2005-10-21 17:05             ` Andrew Patterson
2005-10-21 17:18               ` Arjan van de Ven
2005-10-21 18:57               ` Luben Tuikov
2005-10-21 17:32           ` Luben Tuikov
2005-10-21  1:50 ` Douglas Gilbert
2005-10-21  2:16   ` Jeff Garzik
2005-10-21  3:25     ` Douglas Gilbert
2005-10-21 18:04   ` Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2005-10-20 15:45 Moore, Eric Dean
2005-10-20 16:16 ` Luben Tuikov
2005-10-19 20:08 Moore, Eric Dean
2005-10-19 21:00 ` Luben Tuikov
2005-10-20 14:11   ` Christoph Hellwig
2005-10-20 15:29     ` Luben Tuikov
2005-10-20 15:49       ` Christoph Hellwig
2005-10-20 16:08         ` Luben Tuikov
2005-10-19 18:01 Christoph Hellwig
2005-10-19 19:24 ` Luben Tuikov
2005-10-19 19:37   ` Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).