All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: "Darrick J. Wong" <djwong@us.ibm.com>
Cc: linux-scsi@vger.kernel.org, alexisb@us.ibm.com
Subject: SAS illegal toplogies [was Re: [PATCH 1/4 v2] libsas: Don't BUG when connecting two expanders via wide port]
Date: Tue, 30 Jan 2007 17:26:19 -0500	[thread overview]
Message-ID: <45BFC60B.10809@torque.net> (raw)
In-Reply-To: <45BFA57F.5020408@us.ibm.com>

Darrick J. Wong wrote:
> libsas: Don't BUG when connecting two expanders via wide port
> 
> When a device is connected to an expander, the discovery process goes through
> sas_ex_discover_dev to figure out what's attached to the phy.  If it is the
> case that the phy being discovered happens to be the second phy of a wide link
> to an expander, that discover_dev function will incorrectly call
> sas_ex_discover_expander, which creates another sas_port and tries to attach the
> other sas_phys to the new port, thus triggering a BUG.  The correct thing to do is
> to check the other ex_phys of the expander to see if there's a sas_port for this
> sas_phy, and attach the sas_phy to the existing sas_port.
> 
> This is easily triggered if one enables the phys of a wide port between
> expanders one by one.
> 
> This second version of the patch fixes a small regression in the case where
> all the phys show up at once and we accidentally try to attach to a port
> that hasn't been created yet.

Darrick,
Okay.

Now I'm wondering what the discovery algorithm in libsas
does if it finds truly illegal connections between expanders.
The spec defines what is illegal but says it is vendor specific
what will be done.

One approach is to use the SMP PHY CONTROL function to disable
the phy (or the phys at both ends of the illegal link). The
next trick is how to tell the user who just connected a cable
between expanders that "you can't do that!". Tools like my
smp_discover could alert a user to a disabled phy but
without turning it back on (and causing the libsas discovery
algorithm another headache) my SMP utilities don't know what
it is connected to.

Another question is which link to disable. Imagine three
expanders interconnected with 3 links which is illegal.
Breaking any one link makes it legal, but which one
to break? Last seen, or perhaps the link which has
the largest SAS address sum ...

Doug Gilbert

  reply	other threads:[~2007-01-30 22:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070130074810.7612.31980.stgit@elm3a70.beaverton.ibm.com>
2007-01-30  7:48 ` [PATCH 1/4] libsas: Don't BUG when connecting two expanders via wide port Darrick J. Wong
2007-01-30 20:07   ` [PATCH 1/4 v2] " Darrick J. Wong
2007-01-30 22:26     ` Douglas Gilbert [this message]
2007-01-30  7:48 ` [PATCH 2/4] libsas: Add an LU reset mechanism to the error handler Darrick J. Wong
2007-01-30  7:48 ` [PATCH 3/4] aic94xx: Remove TMF result code munging Darrick J. Wong
2007-01-30  7:48 ` [PATCH 4/4] aic94xx: Add default bus reset handler Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45BFC60B.10809@torque.net \
    --to=dougg@torque.net \
    --cc=alexisb@us.ibm.com \
    --cc=djwong@us.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.