diff options
author | Dan Williams <dan.j.williams@intel.com> | 2012-02-10 04:05:43 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2012-05-17 15:27:11 -0400 |
commit | 14e99b4a3f5323bb961754de5024daff79e59b98 (patch) | |
tree | 379c3f28a33865d135969981862eed44e2aba243 /drivers/scsi/isci/host.c | |
parent | 36be50515fe2aef61533b516fa2576a2c7fe7664 (diff) |
isci: improve 'invalid state' warnings
Convert controller state machine warnings to emit the state number (it
missed the number to string conversion, but since these error rarely
happen not much motivation to go further).
Fix up the rnc warnings to use the state name.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r-- | drivers/scsi/isci/host.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index d4bf9c12ecd4..3822ffb71caf 100644 --- a/drivers/scsi/isci/host.c +++ b/drivers/scsi/isci/host.c | |||
@@ -987,9 +987,8 @@ static enum sci_status sci_controller_start(struct isci_host *ihost, | |||
987 | u16 index; | 987 | u16 index; |
988 | 988 | ||
989 | if (ihost->sm.current_state_id != SCIC_INITIALIZED) { | 989 | if (ihost->sm.current_state_id != SCIC_INITIALIZED) { |
990 | dev_warn(&ihost->pdev->dev, | 990 | dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", |
991 | "SCIC Controller start operation requested in " | 991 | __func__, ihost->sm.current_state_id); |
992 | "invalid state\n"); | ||
993 | return SCI_FAILURE_INVALID_STATE; | 992 | return SCI_FAILURE_INVALID_STATE; |
994 | } | 993 | } |
995 | 994 | ||
@@ -1213,9 +1212,8 @@ static void isci_host_completion_routine(unsigned long data) | |||
1213 | static enum sci_status sci_controller_stop(struct isci_host *ihost, u32 timeout) | 1212 | static enum sci_status sci_controller_stop(struct isci_host *ihost, u32 timeout) |
1214 | { | 1213 | { |
1215 | if (ihost->sm.current_state_id != SCIC_READY) { | 1214 | if (ihost->sm.current_state_id != SCIC_READY) { |
1216 | dev_warn(&ihost->pdev->dev, | 1215 | dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", |
1217 | "SCIC Controller stop operation requested in " | 1216 | __func__, ihost->sm.current_state_id); |
1218 | "invalid state\n"); | ||
1219 | return SCI_FAILURE_INVALID_STATE; | 1217 | return SCI_FAILURE_INVALID_STATE; |
1220 | } | 1218 | } |
1221 | 1219 | ||
@@ -1250,9 +1248,8 @@ static enum sci_status sci_controller_reset(struct isci_host *ihost) | |||
1250 | sci_change_state(&ihost->sm, SCIC_RESETTING); | 1248 | sci_change_state(&ihost->sm, SCIC_RESETTING); |
1251 | return SCI_SUCCESS; | 1249 | return SCI_SUCCESS; |
1252 | default: | 1250 | default: |
1253 | dev_warn(&ihost->pdev->dev, | 1251 | dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", |
1254 | "SCIC Controller reset operation requested in " | 1252 | __func__, ihost->sm.current_state_id); |
1255 | "invalid state\n"); | ||
1256 | return SCI_FAILURE_INVALID_STATE; | 1253 | return SCI_FAILURE_INVALID_STATE; |
1257 | } | 1254 | } |
1258 | } | 1255 | } |
@@ -2279,9 +2276,8 @@ static enum sci_status sci_controller_initialize(struct isci_host *ihost) | |||
2279 | unsigned long i, state, val; | 2276 | unsigned long i, state, val; |
2280 | 2277 | ||
2281 | if (ihost->sm.current_state_id != SCIC_RESET) { | 2278 | if (ihost->sm.current_state_id != SCIC_RESET) { |
2282 | dev_warn(&ihost->pdev->dev, | 2279 | dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", |
2283 | "SCIC Controller initialize operation requested " | 2280 | __func__, ihost->sm.current_state_id); |
2284 | "in invalid state\n"); | ||
2285 | return SCI_FAILURE_INVALID_STATE; | 2281 | return SCI_FAILURE_INVALID_STATE; |
2286 | } | 2282 | } |
2287 | 2283 | ||
@@ -2842,7 +2838,8 @@ enum sci_status sci_controller_start_io(struct isci_host *ihost, | |||
2842 | enum sci_status status; | 2838 | enum sci_status status; |
2843 | 2839 | ||
2844 | if (ihost->sm.current_state_id != SCIC_READY) { | 2840 | if (ihost->sm.current_state_id != SCIC_READY) { |
2845 | dev_warn(&ihost->pdev->dev, "invalid state to start I/O"); | 2841 | dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", |
2842 | __func__, ihost->sm.current_state_id); | ||
2846 | return SCI_FAILURE_INVALID_STATE; | 2843 | return SCI_FAILURE_INVALID_STATE; |
2847 | } | 2844 | } |
2848 | 2845 | ||
@@ -2866,8 +2863,8 @@ enum sci_status sci_controller_terminate_request(struct isci_host *ihost, | |||
2866 | enum sci_status status; | 2863 | enum sci_status status; |
2867 | 2864 | ||
2868 | if (ihost->sm.current_state_id != SCIC_READY) { | 2865 | if (ihost->sm.current_state_id != SCIC_READY) { |
2869 | dev_warn(&ihost->pdev->dev, | 2866 | dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", |
2870 | "invalid state to terminate request\n"); | 2867 | __func__, ihost->sm.current_state_id); |
2871 | return SCI_FAILURE_INVALID_STATE; | 2868 | return SCI_FAILURE_INVALID_STATE; |
2872 | } | 2869 | } |
2873 | 2870 | ||
@@ -2915,7 +2912,8 @@ enum sci_status sci_controller_complete_io(struct isci_host *ihost, | |||
2915 | clear_bit(IREQ_ACTIVE, &ireq->flags); | 2912 | clear_bit(IREQ_ACTIVE, &ireq->flags); |
2916 | return SCI_SUCCESS; | 2913 | return SCI_SUCCESS; |
2917 | default: | 2914 | default: |
2918 | dev_warn(&ihost->pdev->dev, "invalid state to complete I/O"); | 2915 | dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", |
2916 | __func__, ihost->sm.current_state_id); | ||
2919 | return SCI_FAILURE_INVALID_STATE; | 2917 | return SCI_FAILURE_INVALID_STATE; |
2920 | } | 2918 | } |
2921 | 2919 | ||
@@ -2926,7 +2924,8 @@ enum sci_status sci_controller_continue_io(struct isci_request *ireq) | |||
2926 | struct isci_host *ihost = ireq->owning_controller; | 2924 | struct isci_host *ihost = ireq->owning_controller; |
2927 | 2925 | ||
2928 | if (ihost->sm.current_state_id != SCIC_READY) { | 2926 | if (ihost->sm.current_state_id != SCIC_READY) { |
2929 | dev_warn(&ihost->pdev->dev, "invalid state to continue I/O"); | 2927 | dev_warn(&ihost->pdev->dev, "%s invalid state: %d\n", |
2928 | __func__, ihost->sm.current_state_id); | ||
2930 | return SCI_FAILURE_INVALID_STATE; | 2929 | return SCI_FAILURE_INVALID_STATE; |
2931 | } | 2930 | } |
2932 | 2931 | ||