[openib-general] error in mthca_reset?

Arkady Kanevsky arkady at netapp.com
Mon May 8 08:12:22 PDT 2006


There seems to be an error in mthca_reset.

First,
we store 64 double words (256 bytes) for both HCA and HCA bridge:

  for (i = 0; i < 64; ++i) {
                if (i == 22 || i == 23)
                        continue;
                if (pci_read_config_dword(mdev->pdev, i * 4, hca_header + i)) 
{
                        err = -ENODEV;
                        mthca_err(mdev, "Couldn't save HCA "
                                  "PCI header, aborting.\n");
                        goto out;
                }
}

And we avoid storing 22 and 23 double word.

Yet, when we restore we only restore first 16 double words:

       for (i = 0; i < 16; ++i) {
                if (i * 4 == PCI_COMMAND)
                        continue;

                if (pci_write_config_dword(mdev->pdev, i * 4, hca_header[i])) 
{
                        err = -ENODEV;
                        mthca_err(mdev, "Couldn't restore HCA reg %x, "
                                  "aborting.\n", i);
                        goto out;
                }
        }

So,
1. Do we need to restore the whole 64 double words? If not, just store 16 
double words that need to be restored instead of 64.

2.. Why do we bother with not storing double words 22 and 23 when we do not 
restore them?
Are 22 and 23, we do not want to store, are not reallly double words but 
bytes, or words, or something else?

Thanks,
Arkady



More information about the general mailing list