Page MenuHomeFreeBSD

Port some changes from mpr to the mps driver.
ClosedPublic

Authored by slm on Jun 16 2016, 7:11 PM.

Details

Summary
  • No log bit in IOCStatus and endian-safe changes.

Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and
make a few more things endian-safe.

  • Fix possible use of invalid pointer.

It was possible to use an invalid pointer to get the target ID value. To fix
this, initialize a local Target ID variable to an invalid value and change that
variable to a valid value only if the pointer to the Target ID is not NULL.

  • No need to set the MPSSAS_SHUTDOWN flag because it's never used.
  • done_ccb pointer can be used if it is NULL.

To prevent this, move check for done_ccb == NULL to before done_ccb is used in
mpssas_stop_unit_done().

  • Disks can go missing until a reboot is done in some cases.

This is due to the DevHandle not being released, which causes the Firmware to
not allow that disk to be re-added.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

slm updated this revision to Diff 17642.Jun 16 2016, 7:11 PM
slm retitled this revision from to Port some changes from mpr to the mps driver..
slm updated this object.
slm edited the test plan for this revision. (Show Details)
slm added reviewers: scottl, ken, asomers, ambrisko.
slm set the repository for this revision to rS FreeBSD src repository.
ken edited edge metadata.Jun 16 2016, 7:18 PM

One question (see inline comments), otherwise this looks good.

sys/dev/mps/mps_sas.c
382 ↗(On Diff #17642)

Looks like the mpssas_free_tm() and return were removed here. Is that intentional?

slm added inline comments.Jun 16 2016, 7:27 PM
sys/dev/mps/mps_sas.c
382 ↗(On Diff #17642)

Yes, because sometimes it's possible to have an IOCStatus come back and that doesn't mean that we should stop processing the removal. This is for a volume, so it's not as bad, but when we stop processing the removal for a disk, the disk will disappear until a Diag Reset or a Reboot. For a volume, we'll just continue on for a few more lines with this change, but that still includes freeing the reply.

ken accepted this revision.Jun 16 2016, 7:37 PM
ken edited edge metadata.

Okay, thanks, looks good!

This revision is now accepted and ready to land.Jun 16 2016, 7:37 PM
This revision was automatically updated to reflect the committed changes.