diff options
| author | Ewan D. Milne <emilne@redhat.com> | 2013-08-08 15:07:48 -0400 |
|---|---|---|
| committer | James Bottomley <JBottomley@Parallels.com> | 2013-08-26 10:52:27 -0400 |
| commit | 279afdfe78a020b4b1a68bffd0009b961b12982e (patch) | |
| tree | c6562e5d1b0292a4b59764ad7feccb47e48088a5 /include/scsi | |
| parent | f8813d260eebb8c5d046ba4950a134c2283606a7 (diff) | |
[SCSI] Generate uevents on certain unit attention codes
Generate a uevent when the following Unit Attention ASC/ASCQ
codes are received:
2A/01 MODE PARAMETERS CHANGED
2A/09 CAPACITY DATA HAS CHANGED
38/07 THIN PROVISIONING SOFT THRESHOLD REACHED
3F/03 INQUIRY DATA HAS CHANGED
3F/0E REPORTED LUNS DATA HAS CHANGED
Log kernel messages when the following Unit Attention ASC/ASCQ
codes are received that are not as specific as those above:
2A/xx PARAMETERS CHANGED
3F/xx TARGET OPERATING CONDITIONS HAVE CHANGED
Added logic to set expecting_lun_change for other LUNs on the target
after REPORTED LUNS DATA HAS CHANGED is received, so that duplicate
uevents are not generated, and clear expecting_lun_change when a
REPORT LUNS command completes, in accordance with the SPC-3
specification regarding reporting of the 3F 0E ASC/ASCQ UA.
[jejb: remove SPC3 test in scsi_report_lun_change and some docbook fixes and
unused variable fix, both reported by Fengguang Wu]
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
| -rw-r--r-- | include/scsi/scsi_device.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index a44954c7cdc2..d65fbec2533d 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -52,8 +52,15 @@ enum scsi_device_state { | |||
| 52 | 52 | ||
| 53 | enum scsi_device_event { | 53 | enum scsi_device_event { |
| 54 | SDEV_EVT_MEDIA_CHANGE = 1, /* media has changed */ | 54 | SDEV_EVT_MEDIA_CHANGE = 1, /* media has changed */ |
| 55 | SDEV_EVT_INQUIRY_CHANGE_REPORTED, /* 3F 03 UA reported */ | ||
| 56 | SDEV_EVT_CAPACITY_CHANGE_REPORTED, /* 2A 09 UA reported */ | ||
| 57 | SDEV_EVT_SOFT_THRESHOLD_REACHED_REPORTED, /* 38 07 UA reported */ | ||
| 58 | SDEV_EVT_MODE_PARAMETER_CHANGE_REPORTED, /* 2A 01 UA reported */ | ||
| 59 | SDEV_EVT_LUN_CHANGE_REPORTED, /* 3F 0E UA reported */ | ||
| 60 | |||
| 61 | SDEV_EVT_FIRST = SDEV_EVT_MEDIA_CHANGE, | ||
| 62 | SDEV_EVT_LAST = SDEV_EVT_LUN_CHANGE_REPORTED, | ||
| 55 | 63 | ||
| 56 | SDEV_EVT_LAST = SDEV_EVT_MEDIA_CHANGE, | ||
| 57 | SDEV_EVT_MAXBITS = SDEV_EVT_LAST + 1 | 64 | SDEV_EVT_MAXBITS = SDEV_EVT_LAST + 1 |
| 58 | }; | 65 | }; |
| 59 | 66 | ||
| @@ -164,6 +171,7 @@ struct scsi_device { | |||
| 164 | atomic_t disk_events_disable_depth; /* disable depth for disk events */ | 171 | atomic_t disk_events_disable_depth; /* disable depth for disk events */ |
| 165 | 172 | ||
| 166 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ | 173 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ |
| 174 | DECLARE_BITMAP(pending_events, SDEV_EVT_MAXBITS); /* pending events */ | ||
| 167 | struct list_head event_list; /* asserted events */ | 175 | struct list_head event_list; /* asserted events */ |
| 168 | struct work_struct event_work; | 176 | struct work_struct event_work; |
| 169 | 177 | ||
| @@ -261,6 +269,9 @@ struct scsi_target { | |||
| 261 | * means no lun present. */ | 269 | * means no lun present. */ |
| 262 | unsigned int no_report_luns:1; /* Don't use | 270 | unsigned int no_report_luns:1; /* Don't use |
| 263 | * REPORT LUNS for scanning. */ | 271 | * REPORT LUNS for scanning. */ |
| 272 | unsigned int expecting_lun_change:1; /* A device has reported | ||
| 273 | * a 3F/0E UA, other devices on | ||
| 274 | * the same target will also. */ | ||
| 264 | /* commands actually active on LLD. protected by host lock. */ | 275 | /* commands actually active on LLD. protected by host lock. */ |
| 265 | unsigned int target_busy; | 276 | unsigned int target_busy; |
| 266 | /* | 277 | /* |
