Commit 65a29c16 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.1.7: Misc Fixes

Misc Fixes:
 - Fix some sparse warnings - casts of address space
 - Fix handling of the adapter registration string. Each invocation
   was byteswapping, so every other adapter init attempt failed.
 - Correct comments and default value for the lpfc_max_luns parameter
Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent b4c02652
...@@ -706,12 +706,12 @@ LPFC_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands " ...@@ -706,12 +706,12 @@ LPFC_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands "
"during discovery"); "during discovery");
/* /*
# lpfc_max_luns: maximum number of LUNs per target driver will support # lpfc_max_luns: maximum allowed LUN.
# Value range is [1,32768]. Default value is 256. # Value range is [0,65535]. Default value is 255.
# NOTE: The SCSI layer will scan each target for this many luns # NOTE: The SCSI layer might probe all allowed LUN on some old targets.
*/ */
LPFC_ATTR_R(max_luns, 256, 1, 32768, LPFC_ATTR_R(max_luns, 255, 0, 65535,
"Maximum number of LUNs per target driver will support"); "Maximum allowed LUN");
/* /*
# lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring. # lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring.
......
...@@ -71,6 +71,7 @@ lpfc_config_port_prep(struct lpfc_hba * phba) ...@@ -71,6 +71,7 @@ lpfc_config_port_prep(struct lpfc_hba * phba)
uint16_t offset = 0; uint16_t offset = 0;
static char licensed[56] = static char licensed[56] =
"key unlock for use with gnu public licensed code only\0"; "key unlock for use with gnu public licensed code only\0";
static int init_key = 1;
pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb) { if (!pmb) {
...@@ -82,10 +83,13 @@ lpfc_config_port_prep(struct lpfc_hba * phba) ...@@ -82,10 +83,13 @@ lpfc_config_port_prep(struct lpfc_hba * phba)
phba->hba_state = LPFC_INIT_MBX_CMDS; phba->hba_state = LPFC_INIT_MBX_CMDS;
if (lpfc_is_LC_HBA(phba->pcidev->device)) { if (lpfc_is_LC_HBA(phba->pcidev->device)) {
if (init_key) {
uint32_t *ptext = (uint32_t *) licensed; uint32_t *ptext = (uint32_t *) licensed;
for (i = 0; i < 56; i += sizeof (uint32_t), ptext++) for (i = 0; i < 56; i += sizeof (uint32_t), ptext++)
*ptext = cpu_to_be32(*ptext); *ptext = cpu_to_be32(*ptext);
init_key = 0;
}
lpfc_read_nv(phba, pmb); lpfc_read_nv(phba, pmb);
memset((char*)mb->un.varRDnvp.rsvd3, 0, memset((char*)mb->un.varRDnvp.rsvd3, 0,
......
...@@ -1547,8 +1547,8 @@ lpfc_sli_brdready(struct lpfc_hba * phba, uint32_t mask) ...@@ -1547,8 +1547,8 @@ lpfc_sli_brdready(struct lpfc_hba * phba, uint32_t mask)
void lpfc_reset_barrier(struct lpfc_hba * phba) void lpfc_reset_barrier(struct lpfc_hba * phba)
{ {
uint32_t * resp_buf; uint32_t __iomem *resp_buf;
uint32_t * mbox_buf; uint32_t __iomem *mbox_buf;
volatile uint32_t mbox; volatile uint32_t mbox;
uint32_t hc_copy; uint32_t hc_copy;
int i; int i;
...@@ -1564,7 +1564,7 @@ void lpfc_reset_barrier(struct lpfc_hba * phba) ...@@ -1564,7 +1564,7 @@ void lpfc_reset_barrier(struct lpfc_hba * phba)
* Tell the other part of the chip to suspend temporarily all * Tell the other part of the chip to suspend temporarily all
* its DMA activity. * its DMA activity.
*/ */
resp_buf = (uint32_t *)phba->MBslimaddr; resp_buf = phba->MBslimaddr;
/* Disable the error attention */ /* Disable the error attention */
hc_copy = readl(phba->HCregaddr); hc_copy = readl(phba->HCregaddr);
...@@ -1582,7 +1582,7 @@ void lpfc_reset_barrier(struct lpfc_hba * phba) ...@@ -1582,7 +1582,7 @@ void lpfc_reset_barrier(struct lpfc_hba * phba)
((MAILBOX_t *)&mbox)->mbxOwner = OWN_CHIP; ((MAILBOX_t *)&mbox)->mbxOwner = OWN_CHIP;
writel(BARRIER_TEST_PATTERN, (resp_buf + 1)); writel(BARRIER_TEST_PATTERN, (resp_buf + 1));
mbox_buf = (uint32_t *)phba->MBslimaddr; mbox_buf = phba->MBslimaddr;
writel(mbox, mbox_buf); writel(mbox, mbox_buf);
for (i = 0; for (i = 0;
...@@ -1782,7 +1782,7 @@ lpfc_sli_brdrestart(struct lpfc_hba * phba) ...@@ -1782,7 +1782,7 @@ lpfc_sli_brdrestart(struct lpfc_hba * phba)
skip_post = 0; skip_post = 0;
word0 = 0; /* This is really setting up word1 */ word0 = 0; /* This is really setting up word1 */
} }
to_slim = (uint8_t *) phba->MBslimaddr + sizeof (uint32_t); to_slim = phba->MBslimaddr + sizeof (uint32_t);
writel(*(uint32_t *) mb, to_slim); writel(*(uint32_t *) mb, to_slim);
readl(to_slim); /* flush */ readl(to_slim); /* flush */
......
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