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)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 May 2012 23:43:29 +0000 (00:43 +0100)
commitcec5997b4e3d58dbe2fa6d54da49065d21cf45e4
tree4e89b3264fa1184e8679ec4704051aaf52504052
parent559dd7d5b6fee151313910afbe3f19ceaf18dc9b
isci: fix oem parameter validation on single controller skus

commit fc25f79af321c01a739150ba2c09435cf977a63d upstream.

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+]
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>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/scsi/isci/init.c