Skip to content

Commit

Permalink
fix for "[MSTFLINT] Bug SW #4143961: [mstflint kernel]: Failed to run…
Browse files Browse the repository at this point in the history
… mstflint tools over devices after load mstflint_access.ko module"

Description: the recovery space in VSC is supported only in ConnectX8, Quantum3 and above, so in get_space_support_status function the check whether its supported should be after SS_ALL_SPACES_SUPPORTED is set, as this space is only for recovery and SS_ALL_SPACES_SUPPORTED is relevant only for functional devices.

Tested OS: linux
Tested devices: ConnectX4
Tested flows:
insmod mstflint_access.ko
mstdlint -d 44:00.0 q

Known gaps (with RM ticket):n/a

Issue:4143961
  • Loading branch information
shellysela219 authored and ogalbxela committed Nov 6, 2024
1 parent 3446f45 commit a5c3426
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions kernel/mst_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,13 @@ int check_syndrome(struct mst_dev_data* dev)
static int _update_vsc_type(struct mst_dev_data* dev)
{
unsigned int vsc_first_dword;
u_int8_t vsc_type = 0;
int ret = pci_read_config_dword(dev->pci_dev, dev->functional_vsc_offset, &vsc_first_dword);
if (ret)
{
return ret;
}
u_int8_t vsc_type = EXTRACT(vsc_first_dword, MLX_VSC_TYPE_OFFSET, MLX_VSC_TYPE_LEN);
vsc_type = EXTRACT(vsc_first_dword, MLX_VSC_TYPE_OFFSET, MLX_VSC_TYPE_LEN);
if (vsc_type == RECOVERY_VSC)
{
dev->recovery_vsc_offset = dev->functional_vsc_offset;
Expand Down Expand Up @@ -561,13 +562,13 @@ static int read4_block_vsec(struct mst_dev_data* dev, int address_space, unsigne

static int get_space_support_status(struct mst_dev_data* dev)
{
int ret = 0;
// If VSC is of type RECOVERY, all the spaces are not supported
if (dev->functional_vsc_offset == RECOVERY_VSC)
{
dev->spaces_support_status = SS_NOT_ALL_SPACES_SUPPORTED;
return 0;
}
int ret;
// printk("[MST] Checking if the Vendor CAP %d supports the SPACES in devices\n", vend_cap);
if ((!dev->functional_vsc_offset) || (!dev->pci_dev))
return 0;
Expand All @@ -581,10 +582,6 @@ static int get_space_support_status(struct mst_dev_data* dev)
return 1;
}

if (_set_addr_space(dev, AS_RECOVERY))
{
capability_support_info_message(dev, RECOVERY); // this space is supported only for ConnectX8, Quantum3 and above. For recovery from Zombiefish mode.
}
else if (_set_addr_space(dev, AS_CR_SPACE))
{
capability_support_info_message(dev, CR_SPACE);
Expand All @@ -604,6 +601,10 @@ static int get_space_support_status(struct mst_dev_data* dev)
{
dev->spaces_support_status = SS_ALL_SPACES_SUPPORTED;
}
if (_set_addr_space(dev, AS_RECOVERY))
{
capability_support_info_message(dev, RECOVERY); // this space is supported only for ConnectX8, Quantum3 and above. For recovery from Zombiefish mode.
}
if (!_set_addr_space(dev, AS_PCI_CRSPACE) && !_set_addr_space(dev, AS_PCI_ICMD) && !_set_addr_space(dev, AS_PCI_SEMAPHORE))
{
dev->pci_vsec_space_fully_supported = 1; // Support PCI space
Expand Down
1 change: 1 addition & 0 deletions mtcr_ul/mtcr_ul_com.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,7 @@ static int mtcr_pciconf_open(mfile* mf, const char* name, u_int32_t adv_opt)
get_space_support_status(mf, AS_PCI_ALL_ICMD);
get_space_support_status(mf, AS_PCI_SCAN_CRSPACE);
get_space_support_status(mf, AS_PCI_GLOBAL_SEMAPHORE);
get_space_support_status(mf, AS_RECOVERY);
mf->vsec_cap_mask |= (1 << VCC_INITIALIZED);

mtcr_pciconf_cap9_sem(mf, 0);
Expand Down

0 comments on commit a5c3426

Please sign in to comment.