@@ -1025,14 +1025,15 @@ static int stex_common_handshake(struct
struct handshake_frame *h;
dma_addr_t status_phys;
u32 data;
- unsigned long before;
+ unsigned long before, timeout;
if (readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE) {
writel(MU_INBOUND_DOORBELL_HANDSHAKE, base + IDBL);
readl(base + IDBL);
before = jiffies;
while (readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE) {
- if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
+ timeout = before + MU_MAX_DELAY * HZ;
+ if (time_after(jiffies, timeout)) {
printk(KERN_ERR DRV_NAME
"(%s): no handshake signature\n",
pci_name(hba->pdev));
@@ -1082,7 +1083,8 @@ static int stex_common_handshake(struct
udelay(10);
before = jiffies;
while (readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE) {
- if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
+ timeout = before + MU_MAX_DELAY * HZ;
+ if (time_after(jiffies, timeout)) {
printk(KERN_ERR DRV_NAME
"(%s): no signature after handshake frame\n",
pci_name(hba->pdev));
@@ -1110,7 +1112,7 @@ static int stex_ss_handshake(struct st_h
struct handshake_frame *h;
__le32 *scratch;
u32 data, scratch_size, mailboxdata, operationaldata;
- unsigned long before;
+ unsigned long before, timeout;
int ret = 0;
before = jiffies;
@@ -1118,7 +1120,8 @@ static int stex_ss_handshake(struct st_h
if (hba->cardtype == st_yel) {
operationaldata = readl(base + YIOA_STATUS);
while (operationaldata != SS_MU_OPERATIONAL) {
- if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
+ timeout = before + MU_MAX_DELAY * HZ;
+ if (time_after(jiffies, timeout)) {
printk(KERN_ERR DRV_NAME
"(%s): firmware not operational\n",
pci_name(hba->pdev));
@@ -1130,7 +1133,8 @@ static int stex_ss_handshake(struct st_h
} else {
operationaldata = readl(base + PSCRATCH3);
while (operationaldata != SS_MU_OPERATIONAL) {
- if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
+ timeout = before + MU_MAX_DELAY * HZ;
+ if (time_after(jiffies, timeout)) {
printk(KERN_ERR DRV_NAME
"(%s): firmware not operational\n",
pci_name(hba->pdev));
@@ -1183,7 +1187,8 @@ static int stex_ss_handshake(struct st_h
scratch = hba->scratch;
if (hba->cardtype == st_yel) {
while (!(le32_to_cpu(*scratch) & SS_STS_HANDSHAKE)) {
- if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
+ timeout = before + MU_MAX_DELAY * HZ;
+ if (time_after(jiffies, timeout)) {
printk(KERN_ERR DRV_NAME
"(%s): no signature after handshake frame\n",
pci_name(hba->pdev));
@@ -1196,7 +1201,8 @@ static int stex_ss_handshake(struct st_h
} else {
mailboxdata = readl(base + MAILBOX_BASE + MAILBOX_HNDSHK_STS);
while (mailboxdata != SS_STS_HANDSHAKE) {
- if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
+ timeout = before + MU_MAX_DELAY * HZ;
+ if (time_after(jiffies, timeout)) {
printk(KERN_ERR DRV_NAME
"(%s): no signature after handshake frame\n",
pci_name(hba->pdev));
@@ -1344,7 +1350,7 @@ static void stex_hard_reset(struct st_hb
static int stex_yos_reset(struct st_hba *hba)
{
void __iomem *base;
- unsigned long flags, before;
+ unsigned long flags, before, timeout;
int ret = 0;
base = hba->mmio_base;
@@ -1352,7 +1358,8 @@ static int stex_yos_reset(struct st_hba
readl(base + IDBL); /* flush */
before = jiffies;
while (hba->out_req_cnt > 0) {
- if (time_after(jiffies, before + ST_INTERNAL_TIMEOUT * HZ)) {
+ timeout = before + ST_INTERNAL_TIMEOUT * HZ;
+ if (time_after(jiffies, timeout)) {
printk(KERN_WARNING DRV_NAME
"(%s): reset timeout\n", pci_name(hba->pdev));
ret = -1;
@@ -1852,7 +1859,7 @@ static void stex_hba_stop(struct st_hba
struct req_msg *req;
struct st_msg_header *msg_h;
unsigned long flags;
- unsigned long before;
+ unsigned long before, timeout;
u16 tag = 0;
spin_lock_irqsave(hba->host->host_lock, flags);
@@ -1899,7 +1906,8 @@ static void stex_hba_stop(struct st_hba
spin_unlock_irqrestore(hba->host->host_lock, flags);
before = jiffies;
while (hba->ccb[tag].req_type & PASSTHRU_REQ_TYPE) {
- if (time_after(jiffies, before + ST_INTERNAL_TIMEOUT * HZ)) {
+ timeout = before + ST_INTERNAL_TIMEOUT * HZ;
+ if (time_after(jiffies, timeout)) {
hba->ccb[tag].req_type = 0;
hba->mu_status = MU_STATE_STOP;
return;