Skip to content

Commit

Permalink
[SCSI] mpt2sas: Fix to use sas device list instead of enclosure list …
Browse files Browse the repository at this point in the history
…for _transpor_get_enclosure_identifier.

Enclosure_identifier not being returned by mpt2sas
The driver exports callback function to the sas transport layer
for obtaining the enclosure logical id.  This function is called
_transport_get_enclosure_identifier.  The driver was searching
the wrong list for the enclosure_identifier.  The driver should be
searching the sas device list instead of enclosure list.  The
sas address that is passed to the driver is for the end device, not
enclosure.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Jul 27, 2010
1 parent 593d572 commit ab6ce92
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/scsi/mpt2sas/mpt2sas_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,18 +1007,18 @@ static int
_transport_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier)
{
struct MPT2SAS_ADAPTER *ioc = rphy_to_ioc(rphy);
struct _sas_node *sas_expander;
struct _sas_device *sas_device;
unsigned long flags;

spin_lock_irqsave(&ioc->sas_node_lock, flags);
sas_expander = mpt2sas_scsih_expander_find_by_sas_address(ioc,
spin_lock_irqsave(&ioc->sas_device_lock, flags);
sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
rphy->identify.sas_address);
spin_unlock_irqrestore(&ioc->sas_node_lock, flags);
spin_unlock_irqrestore(&ioc->sas_device_lock, flags);

if (!sas_expander)
if (!sas_device)
return -ENXIO;

*identifier = sas_expander->enclosure_logical_id;
*identifier = sas_device->enclosure_logical_id;
return 0;
}

Expand Down

0 comments on commit ab6ce92

Please sign in to comment.