Commit b506ade9 authored by Eric Moore's avatar Eric Moore Committed by James Bottomley

[SCSI] fusion - inactive raid support, and raid event bug fix's

inactive raid support, e.g. exposing hidden raid components
belonging to a volume that are inactive.  Also misc bug fix's for
various raid asyn events.
Signed-off-by: default avatarEric Moore <Eric.Moore@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent c6c727a1
This diff is collapsed.
...@@ -485,10 +485,24 @@ typedef struct _SasCfgData { ...@@ -485,10 +485,24 @@ typedef struct _SasCfgData {
*/ */
}SasCfgData; }SasCfgData;
/*
* Inactive volume link list of raid component data
* @inactive_list
*/
struct inactive_raid_component_info {
struct list_head list;
u8 volumeID; /* volume target id */
u8 volumeBus; /* volume channel */
IOC_3_PHYS_DISK d; /* phys disk info */
};
typedef struct _RaidCfgData { typedef struct _RaidCfgData {
IOCPage2_t *pIocPg2; /* table of Raid Volumes */ IOCPage2_t *pIocPg2; /* table of Raid Volumes */
IOCPage3_t *pIocPg3; /* table of physical disks */ IOCPage3_t *pIocPg3; /* table of physical disks */
int isRaid; /* bit field, 1 if RAID */ struct semaphore inactive_list_mutex;
struct list_head inactive_list; /* link list for physical
disk that belong in
inactive volumes */
}RaidCfgData; }RaidCfgData;
typedef struct _FcCfgData { typedef struct _FcCfgData {
...@@ -611,6 +625,8 @@ typedef struct _MPT_ADAPTER ...@@ -611,6 +625,8 @@ typedef struct _MPT_ADAPTER
u8 persist_reply_frame[MPT_DEFAULT_FRAME_SIZE]; /* persist reply */ u8 persist_reply_frame[MPT_DEFAULT_FRAME_SIZE]; /* persist reply */
LANPage0_t lan_cnfg_page0; LANPage0_t lan_cnfg_page0;
LANPage1_t lan_cnfg_page1; LANPage1_t lan_cnfg_page1;
u8 ir_firmware; /* =1 if IR firmware detected */
/* /*
* Description: errata_flag_1064 * Description: errata_flag_1064
* If a PCIX read occurs within 1 or 2 cycles after the chip receives * If a PCIX read occurs within 1 or 2 cycles after the chip receives
...@@ -1043,6 +1059,7 @@ extern void mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size); ...@@ -1043,6 +1059,7 @@ extern void mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size);
extern void mpt_free_fw_memory(MPT_ADAPTER *ioc); extern void mpt_free_fw_memory(MPT_ADAPTER *ioc);
extern int mpt_findImVolumes(MPT_ADAPTER *ioc); extern int mpt_findImVolumes(MPT_ADAPTER *ioc);
extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
extern int mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhysDiskPage0_t phys_disk);
/* /*
* Public data decl's... * Public data decl's...
......
This diff is collapsed.
...@@ -2244,6 +2244,7 @@ mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, ...@@ -2244,6 +2244,7 @@ mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev,
int int
mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id) mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id)
{ {
struct inactive_raid_component_info *component_info;
int i; int i;
int rc = 0; int rc = 0;
...@@ -2257,6 +2258,21 @@ mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id) ...@@ -2257,6 +2258,21 @@ mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id)
} }
} }
/*
* Check inactive list for matching phys disks
*/
if (list_empty(&ioc->raid_data.inactive_list))
goto out;
down(&ioc->raid_data.inactive_list_mutex);
list_for_each_entry(component_info, &ioc->raid_data.inactive_list,
list) {
if ((component_info->d.PhysDiskID == id) &&
(component_info->d.PhysDiskBus == channel))
rc = 1;
}
up(&ioc->raid_data.inactive_list_mutex);
out: out:
return rc; return rc;
} }
...@@ -2265,6 +2281,7 @@ EXPORT_SYMBOL(mptscsih_is_phys_disk); ...@@ -2265,6 +2281,7 @@ EXPORT_SYMBOL(mptscsih_is_phys_disk);
u8 u8
mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id) mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id)
{ {
struct inactive_raid_component_info *component_info;
int i; int i;
int rc = -ENXIO; int rc = -ENXIO;
...@@ -2278,6 +2295,21 @@ mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id) ...@@ -2278,6 +2295,21 @@ mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id)
} }
} }
/*
* Check inactive list for matching phys disks
*/
if (list_empty(&ioc->raid_data.inactive_list))
goto out;
down(&ioc->raid_data.inactive_list_mutex);
list_for_each_entry(component_info, &ioc->raid_data.inactive_list,
list) {
if ((component_info->d.PhysDiskID == id) &&
(component_info->d.PhysDiskBus == channel))
rc = component_info->d.PhysDiskNum;
}
up(&ioc->raid_data.inactive_list_mutex);
out: out:
return rc; return rc;
} }
......
...@@ -1363,8 +1363,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1363,8 +1363,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
/* /*
* If RAID Firmware Detected, setup virtual channel * If RAID Firmware Detected, setup virtual channel
*/ */
if ((ioc->facts.ProductID & MPI_FW_HEADER_PID_PROD_MASK) if (ioc->ir_firmware)
> MPI_FW_HEADER_PID_PROD_TARGET_SCSI)
sh->max_channel = 1; sh->max_channel = 1;
else else
sh->max_channel = 0; sh->max_channel = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment