[SCSI] lpfc 8.3.26: Fix SYSFS interface issues
authorJames Smart <james.smart@emulex.com>
Mon, 22 Aug 2011 01:49:16 +0000 (21:49 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 29 Aug 2011 07:16:19 +0000 (00:16 -0700)
commitf7a919b4cd048f345c07c2235d0fb8ac93d24cca
tree2abd6930e878997db35dc57bf8374a3af6272a59
parent079b5c916d19e7533c060b32d4a31ce45c3552d2
[SCSI] lpfc 8.3.26: Fix SYSFS interface issues

Fix SYSFS interface issues.

- In the lpfc_sli4_pdev_status_reg_wait() routine, after initial 100ms delay
  following write to PHYSDEV_CONTROL register for the firmware reaction, check
  the RN bit and ERR bit of the SLIPORT_STATUS register. If none of them
  became 1, the previous PHYSDEV_CONTROL register should be considered failed
  due to lack of privilege and error for no permission should be returned
  immediately without getting into the wait for RDY bits on the SLIPORT_STATUS
  register.
- Remove the driver check on dev->is_physfn before proceed to perform the
  PHYSDEV_CONTROL register write, and let the PCI function's privilege
  setting and driver handling of PHYSDEV_CONTROL register write failure to
  handle the reset-ability through the SLI port.
- Added key to ctlreg_write to prevent unauthorized or unexpected write to
  the control register.
- Change return to EACCES for sysfs access that are failed because hba_reset
  is disabled.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_init.c