isci: fix oem parameter validation on single controller skus
authorDan Williams <dan.j.williams@intel.com>
Mon, 30 Apr 2012 18:57:44 +0000 (11:57 -0700)
committerDan Williams <dan.j.williams@intel.com>
Thu, 17 May 2012 19:27:29 +0000 (12:27 -0700)
OEM parameters [1] are parsed from the platform option-rom / efi
driver.  By default the driver was validating the parameters for the
dual-controller case, but in single-controller case only the first set
of parameters may be valid.

Limit the validation to the number of actual controllers detected
otherwise the driver may fail to parse the valid parameters leading to
driver-load or runtime failures.

[1] the platform specific set of phy address, configuration,and analog
    tuning values

[stable v3.0+]
Cc: <stable@vger.kernel.org>
Reported-by: Dave Jiang <dave.jiang@intel.com>
Tested-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/scsi/isci/init.c

index fdae42f572b6ebffd2a7e3d67bc3b3f6ed982531..9e1c83e425edd30de0f8ee3b2c9a55743fc976be 100644 (file)
@@ -639,7 +639,7 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
        if (!orom)
                orom = isci_request_oprom(pdev);
 
-       for (i = 0; orom && i < ARRAY_SIZE(orom->ctrl); i++) {
+       for (i = 0; orom && i < num_controllers(pdev); i++) {
                if (sci_oem_parameters_validate(&orom->ctrl[i],
                                                orom->hdr.version)) {
                        dev_warn(&pdev->dev,
This page took 0.025431 seconds and 5 git commands to generate.