Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bnx2x: semi-Semantic changes

This patch includes a few changes that change the driver's flow without truly
changing anything in its functionality - use usleep_range for short sleeps
instead of msleep and initialize Tx consumer during initialization for better
information during errors.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yuval Mintz and committed by
David S. Miller
639d65b8 6bf07b8e

+8 -6
+8 -6
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 1954 1954 if (lock_status & resource_bit) 1955 1955 return 0; 1956 1956 1957 - msleep(5); 1957 + usleep_range(5000, 10000); 1958 1958 } 1959 1959 BNX2X_ERR("Timeout\n"); 1960 1960 return -EAGAIN; ··· 3640 3640 if (val & MCPR_ACCESS_LOCK_LOCK) 3641 3641 break; 3642 3642 3643 - msleep(5); 3643 + usleep_range(5000, 10000); 3644 3644 } 3645 3645 if (!(val & MCPR_ACCESS_LOCK_LOCK)) { 3646 3646 BNX2X_ERR("Cannot acquire MCP access lock register\n"); ··· 6078 6078 BCM_PAGE_SIZE*(i % NUM_TX_RINGS))); 6079 6079 } 6080 6080 6081 + *txdata->tx_cons_sb = cpu_to_le16(0); 6082 + 6081 6083 SET_FLAG(txdata->tx_db.data.header.header, DOORBELL_HDR_DB_TYPE, 1); 6082 6084 txdata->tx_db.data.zero_fill1 = 0; 6083 6085 txdata->tx_db.data.prod = 0; ··· 6331 6329 if (val == 0x10) 6332 6330 break; 6333 6331 6334 - msleep(10); 6332 + usleep_range(10000, 20000); 6335 6333 count--; 6336 6334 } 6337 6335 if (val != 0x10) { ··· 6346 6344 if (val == 1) 6347 6345 break; 6348 6346 6349 - msleep(10); 6347 + usleep_range(10000, 20000); 6350 6348 count--; 6351 6349 } 6352 6350 if (val != 0x1) { ··· 6387 6385 if (val == 0xb0) 6388 6386 break; 6389 6387 6390 - msleep(10); 6388 + usleep_range(10000, 20000); 6391 6389 count--; 6392 6390 } 6393 6391 if (val != 0xb0) { ··· 8502 8500 * scan to complete 8503 8501 */ 8504 8502 for (i = 0; i < 200; i++) { 8505 - msleep(10); 8503 + usleep_range(10000, 20000); 8506 8504 if (!REG_RD(bp, TM_REG_LIN0_SCAN_ON + port*4)) 8507 8505 break; 8508 8506 }