From 7027c01c56667344a46fb1bd9216383e794f9171 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Tue, 29 Nov 2016 13:48:36 +0000 Subject: [PATCH] Make SES status updates more aggressive. - On control request update all status pages, since they may also be affected if user enables/disables enclosure slots. - Periodically update element descriptors too, since there is some hardware where they are changed dynamically. MFC after: 2 weeks Sponsored by: iXsystems, Inc. --- sys/cam/scsi/scsi_enc_ses.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index 4c46738c198..7f931b4bbb1 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -550,6 +550,7 @@ static int ses_set_timed_completion(enc_softc_t *, uint8_t); static int ses_putstatus(enc_softc_t *, int, struct ses_comstat *); #endif +static void ses_poll_status(enc_softc_t *); static void ses_print_addl_data(enc_softc_t *, enc_element_t *); /*=========================== SES cleanup routines ===========================*/ @@ -1475,11 +1476,7 @@ ses_process_config(enc_softc_t *enc, struct enc_fsm_state *state, if (err) ses_cache_free(enc, enc_cache); else { - enc_update_request(enc, SES_UPDATE_GETSTATUS); - if (ses->ses_flags & SES_FLAG_DESC) - enc_update_request(enc, SES_UPDATE_GETELMDESCS); - if (ses->ses_flags & SES_FLAG_ADDLSTATUS) - enc_update_request(enc, SES_UPDATE_GETELMADDLSTATUS); + ses_poll_status(enc); enc_update_request(enc, SES_PUBLISH_CACHE); } ENC_DLOG(enc, "%s: exiting with err %d\n", __func__, err); @@ -1869,7 +1866,7 @@ ses_process_control_request(enc_softc_t *enc, struct enc_fsm_state *state, * o Some SCSI status error. */ ses_terminate_control_requests(&ses->ses_pending_requests, error); - enc_update_request(enc, SES_UPDATE_GETSTATUS); + ses_poll_status(enc); return (0); } @@ -2801,6 +2798,8 @@ ses_poll_status(enc_softc_t *enc) ses = enc->enc_private; enc_update_request(enc, SES_UPDATE_GETSTATUS); + if (ses->ses_flags & SES_FLAG_DESC) + enc_update_request(enc, SES_UPDATE_GETELMDESCS); if (ses->ses_flags & SES_FLAG_ADDLSTATUS) enc_update_request(enc, SES_UPDATE_GETELMADDLSTATUS); } -- 2.45.2