Skip to content

Commit ec504b2

Browse files
Murthy Bhatmartinkpetersen
authored andcommitted
scsi: smartpqi: Add phy ID support for the physical drives
Display topology using PHY numbers. PHY (both local and remote) numbers corresponding to physical drives are read from BMIC_IDENTIFY_PHYSICAL_DEVICE. Link: https://lore.kernel.org/r/161549383947.25025.16977895345376485056.stgit@brunhilda Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com> Reviewed-by: Martin Wilck <mwilck@suse.com> Signed-off-by: Murthy Bhat <Murthy.Bhat@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent a425625 commit ec504b2

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

drivers/scsi/smartpqi/smartpqi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ struct pqi_scsi_dev {
10891089
u8 phy_connected_dev_type;
10901090
u8 box[8];
10911091
u16 phys_connector[8];
1092+
u8 phy_id;
10921093
bool raid_bypass_configured; /* RAID bypass configured */
10931094
bool raid_bypass_enabled; /* RAID bypass enabled */
10941095
u32 next_bypass_group;

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,8 @@ static void pqi_get_volume_status(struct pqi_ctrl_info *ctrl_info,
14341434
device->volume_offline = volume_offline;
14351435
}
14361436

1437+
#define PQI_DEVICE_PHY_MAP_SUPPORTED 0x10
1438+
14371439
static int pqi_get_physical_device_info(struct pqi_ctrl_info *ctrl_info,
14381440
struct pqi_scsi_dev *device,
14391441
struct bmic_identify_physical_device *id_phys)
@@ -1473,6 +1475,13 @@ static int pqi_get_physical_device_info(struct pqi_ctrl_info *ctrl_info,
14731475
memcpy(&device->page_83_identifier, &id_phys->page_83_identifier,
14741476
sizeof(device->page_83_identifier));
14751477

1478+
if ((id_phys->even_more_flags & PQI_DEVICE_PHY_MAP_SUPPORTED) &&
1479+
id_phys->phy_count)
1480+
device->phy_id =
1481+
id_phys->phy_to_phy_map[device->active_path_index];
1482+
else
1483+
device->phy_id = 0xFF;
1484+
14761485
return 0;
14771486
}
14781487

@@ -1839,6 +1848,7 @@ static void pqi_scsi_update_device(struct pqi_scsi_dev *existing_device,
18391848
existing_device->aio_handle = new_device->aio_handle;
18401849
existing_device->volume_status = new_device->volume_status;
18411850
existing_device->active_path_index = new_device->active_path_index;
1851+
existing_device->phy_id = new_device->phy_id;
18421852
existing_device->path_map = new_device->path_map;
18431853
existing_device->bay = new_device->bay;
18441854
existing_device->box_index = new_device->box_index;

drivers/scsi/smartpqi/smartpqi_sas_transport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ static int pqi_sas_port_add_rphy(struct pqi_sas_port *pqi_sas_port,
9292

9393
identify = &rphy->identify;
9494
identify->sas_address = pqi_sas_port->sas_address;
95+
identify->phy_identifier = pqi_sas_port->device->phy_id;
9596

9697
if (pqi_sas_port->device &&
9798
pqi_sas_port->device->is_expander_smp_device) {

0 commit comments

Comments
 (0)