Commit ccb3368c authored by Xie XiuQi's avatar Xie XiuQi Committed by Linus Torvalds

ipmi: use USEC_PER_SEC instead of 1000000 for more meaningful

Use USEC_PER_SEC instead of 1000000, that making the later bugfix
more clearly.
Signed-off-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent aa5b2bab
...@@ -201,7 +201,7 @@ static unsigned int bt_init_data(struct si_sm_data *bt, struct si_sm_io *io) ...@@ -201,7 +201,7 @@ static unsigned int bt_init_data(struct si_sm_data *bt, struct si_sm_io *io)
} }
bt->state = BT_STATE_IDLE; /* start here */ bt->state = BT_STATE_IDLE; /* start here */
bt->complete = BT_STATE_IDLE; /* end here */ bt->complete = BT_STATE_IDLE; /* end here */
bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * 1000000; bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * USEC_PER_SEC;
bt->BT_CAP_retries = BT_NORMAL_RETRY_LIMIT; bt->BT_CAP_retries = BT_NORMAL_RETRY_LIMIT;
/* BT_CAP_outreqs == zero is a flag to read BT Capabilities */ /* BT_CAP_outreqs == zero is a flag to read BT Capabilities */
return 3; /* We claim 3 bytes of space; ought to check SPMI table */ return 3; /* We claim 3 bytes of space; ought to check SPMI table */
...@@ -613,7 +613,7 @@ static enum si_sm_result bt_event(struct si_sm_data *bt, long time) ...@@ -613,7 +613,7 @@ static enum si_sm_result bt_event(struct si_sm_data *bt, long time)
HOST2BMC(42); /* Sequence number */ HOST2BMC(42); /* Sequence number */
HOST2BMC(3); /* Cmd == Soft reset */ HOST2BMC(3); /* Cmd == Soft reset */
BT_CONTROL(BT_H2B_ATN); BT_CONTROL(BT_H2B_ATN);
bt->timeout = BT_RESET_DELAY * 1000000; bt->timeout = BT_RESET_DELAY * USEC_PER_SEC;
BT_STATE_CHANGE(BT_STATE_RESET3, BT_STATE_CHANGE(BT_STATE_RESET3,
SI_SM_CALL_WITH_DELAY); SI_SM_CALL_WITH_DELAY);
...@@ -651,14 +651,14 @@ static enum si_sm_result bt_event(struct si_sm_data *bt, long time) ...@@ -651,14 +651,14 @@ static enum si_sm_result bt_event(struct si_sm_data *bt, long time)
bt_init_data(bt, bt->io); bt_init_data(bt, bt->io);
if ((i == 8) && !BT_CAP[2]) { if ((i == 8) && !BT_CAP[2]) {
bt->BT_CAP_outreqs = BT_CAP[3]; bt->BT_CAP_outreqs = BT_CAP[3];
bt->BT_CAP_req2rsp = BT_CAP[6] * 1000000; bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC;
bt->BT_CAP_retries = BT_CAP[7]; bt->BT_CAP_retries = BT_CAP[7];
} else } else
printk(KERN_WARNING "IPMI BT: using default values\n"); printk(KERN_WARNING "IPMI BT: using default values\n");
if (!bt->BT_CAP_outreqs) if (!bt->BT_CAP_outreqs)
bt->BT_CAP_outreqs = 1; bt->BT_CAP_outreqs = 1;
printk(KERN_WARNING "IPMI BT: req2rsp=%ld secs retries=%d\n", printk(KERN_WARNING "IPMI BT: req2rsp=%ld secs retries=%d\n",
bt->BT_CAP_req2rsp / 1000000L, bt->BT_CAP_retries); bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries);
bt->timeout = bt->BT_CAP_req2rsp; bt->timeout = bt->BT_CAP_req2rsp;
return SI_SM_CALL_WITHOUT_DELAY; return SI_SM_CALL_WITHOUT_DELAY;
......
...@@ -118,8 +118,8 @@ enum kcs_states { ...@@ -118,8 +118,8 @@ enum kcs_states {
#define MAX_KCS_WRITE_SIZE IPMI_MAX_MSG_LENGTH #define MAX_KCS_WRITE_SIZE IPMI_MAX_MSG_LENGTH
/* Timeouts in microseconds. */ /* Timeouts in microseconds. */
#define IBF_RETRY_TIMEOUT 5000000 #define IBF_RETRY_TIMEOUT (5*USEC_PER_SEC)
#define OBF_RETRY_TIMEOUT 5000000 #define OBF_RETRY_TIMEOUT (5*USEC_PER_SEC)
#define MAX_ERROR_RETRIES 10 #define MAX_ERROR_RETRIES 10
#define ERROR0_OBF_WAIT_JIFFIES (2*HZ) #define ERROR0_OBF_WAIT_JIFFIES (2*HZ)
......
...@@ -80,7 +80,7 @@ enum smic_states { ...@@ -80,7 +80,7 @@ enum smic_states {
#define SMIC_MAX_ERROR_RETRIES 3 #define SMIC_MAX_ERROR_RETRIES 3
/* Timeouts in microseconds. */ /* Timeouts in microseconds. */
#define SMIC_RETRY_TIMEOUT 2000000 #define SMIC_RETRY_TIMEOUT (2*USEC_PER_SEC)
/* SMIC Flags Register Bits */ /* SMIC Flags Register Bits */
#define SMIC_RX_DATA_READY 0x80 #define SMIC_RX_DATA_READY 0x80
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment