Bug #6119

mptsas doesn't handle timeouts in mptsas_get_sata_guid()

Added by Hans Rosenfeld over 5 years ago. Updated over 5 years ago.

driver - device drivers
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


When a SATA device is connected to an mpt_sas device the driver will try to get the SATA GUID by sending an INQUIRY command. For this to work a temporary mptsas_target_t is created that is not inserted into the target refhash. As the timeout watchdog only scans the devices in the refhash for timed out commands it is essentially blind for timeouts of that certain INQUIRY command. As a result the event handling thread of mptsas gets stuck in scsi_transport() waiting forever for the command to complete.

We found this with a certain Toshiba SATA SSD which can take 17s or even more to reply an INQUIRY on hotplug.


Updated by Hans Rosenfeld over 5 years ago


I have introduced another refhash for the temporary targets and updated the watchdog to check this refhash, too. With this change the event handling thread doesn't hang anymore.

I noticed that the device was added twice, though -- first with the WWN generated by the SAS expander, and then again by a 2nd event with it's real WWN (SATA GUID). To resolve this I changed the code to explicitly stop processing the first event if getting the SATA GUID indicates a failure (as opposed to "no GUID", which is still valid).


Updated by Electric Monk over 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 39fd84a866206a99cbb6b6e63e0c38a367aaa88e

commit  39fd84a866206a99cbb6b6e63e0c38a367aaa88e
Author: Hans Rosenfeld <>
Date:   2015-09-16T08:40:55.000Z

    6119 mptsas doesn't handle timeouts in mptsas_get_sata_guid()
    Reviewed by: Josef 'Jeff' Sipek <>
    Reviewed by: Gordon Ross <>
    Reviewed by: Dan Fields <>
    Reviewed by: Yuri Pankov <>
    Reviewed by: Robert Mustacchi <>
    Reviewed by: Albert Lee <>
    Reviewed by: Garrett D'Amore <>
    Approved by: Dan McDonald <>

Also available in: Atom PDF