From: Darrick J. Wong Date: Tue, 30 Jan 2007 20:07:27 +0000 (-0800) Subject: [SCSI] libsas: Don't BUG when connecting two expanders via wide port X-Git-Tag: v2.6.21-rc1~274^2~230^2~19 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=423f7cf467045eab616f97309aed87a54b5e351d;p=pandora-kernel.git [SCSI] libsas: Don't BUG when connecting two expanders via wide port 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. Signed-off-by: Darrick J. Wong Signed-off-by: James Bottomley --- Reading git-diff-tree failed