)]}'
{
  "commit": "d3ed1731ba6bca32ac0ac96377cae8fd735e16e6",
  "tree": "d0d470c33b743c71ea39df269bcafe4feffe5b4c",
  "parents": [
    "7a4601c0bfde4ed50c54f30c32c5677e3daec4f9"
  ],
  "author": {
    "name": "James Bottomley",
    "email": "JBottomley@Parallels.com",
    "time": "Wed Jul 25 23:55:55 2012 +0400"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Fri Sep 14 10:00:32 2012 -0700"
  },
  "message": "SCSI: Fix \u0027Device not ready\u0027 issue on mpt2sas\n\ncommit 14216561e164671ce147458653b1fea06a4ada1e upstream.\n\nThis is a particularly nasty SCSI ATA Translation Layer (SATL) problem.\n\nSAT-2 says (section 8.12.2)\n\n        if the device is in the stopped state as the result of\n        processing a START STOP UNIT command (see 9.11), then the SATL\n        shall terminate the TEST UNIT READY command with CHECK CONDITION\n        status with the sense key set to NOT READY and the additional\n        sense code of LOGICAL UNIT NOT READY, INITIALIZING COMMAND\n        REQUIRED;\n\nmpt2sas internal SATL seems to implement this.  The result is very confusing\nstandby behaviour (using hdparm -y).  If you suspend a drive and then send\nanother command, usually it wakes up.  However, if the next command is a TEST\nUNIT READY, the SATL sees that the drive is suspended and proceeds to follow\nthe SATL rules for this, returning NOT READY to all subsequent commands.  This\nmeans that the ordering of TEST UNIT READY is crucial: if you send TUR and\nthen a command, you get a NOT READY to both back.  If you send a command and\nthen a TUR, you get GOOD status because the preceeding command woke the drive.\n\nThis bit us badly because\n\ncommit 85ef06d1d252f6a2e73b678591ab71caad4667bb\nAuthor: Tejun Heo \u003ctj@kernel.org\u003e\nDate:   Fri Jul 1 16:17:47 2011 +0200\n\n    block: flush MEDIA_CHANGE from drivers on close(2)\n\nChanged our ordering on TEST UNIT READY commands meaning that SATA drives\nconnected to an mpt2sas now suspend and refuse to wake (because the mpt2sas\nSATL sees the suspend *before* the drives get awoken by the next ATA command)\nresulting in lots of failed commands.\n\nThe standard is completely nuts forcing this inconsistent behaviour, but we\nhave to work around it.\n\nThe fix for this is twofold:\n\n   1. Set the allow_restart flag so we wake the drive when we see it has been\n      suspended\n\n   2. Return all TEST UNIT READY status directly to the mid layer without any\n      further error handling which prevents us causing error handling which\n      may offline the device just because of a media check TUR.\n\nReported-by: Matthias Prager \u003clinux@matthiasprager.de\u003e\nSigned-off-by: James Bottomley \u003cJBottomley@Parallels.com\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cc8dc8cc6d6ff86a2aa1342b0b9042a3364fa7cf",
      "old_mode": 33188,
      "old_path": "drivers/scsi/scsi_error.c",
      "new_id": "b3f0b0f6d44b043bb0139a7420bd30a8080c3fea",
      "new_mode": 33188,
      "new_path": "drivers/scsi/scsi_error.c"
    },
    {
      "type": "modify",
      "old_id": "8906557d2a248ae5cb53fca230a5436d85510c55",
      "old_mode": 33188,
      "old_path": "drivers/scsi/scsi_scan.c",
      "new_id": "348840e80921b0d9787e7ea84660f9b7bdcc749e",
      "new_mode": 33188,
      "new_path": "drivers/scsi/scsi_scan.c"
    }
  ]
}
