Lines 6252-6283
lpfc_sli_enable_intr(struct lpfc_hba *ph
Link Here
|
6252 |
uint32_t intr_mode = LPFC_INTR_ERROR; |
6252 |
uint32_t intr_mode = LPFC_INTR_ERROR; |
6253 |
int retval; |
6253 |
int retval; |
6254 |
|
6254 |
|
|
|
6255 |
printk(KERN_INFO "Got into lpfc_sli_enable_intr, which is for sli-3.\n"); |
6255 |
if (cfg_mode == 2) { |
6256 |
if (cfg_mode == 2) { |
6256 |
/* Need to issue conf_port mbox cmd before conf_msi mbox cmd */ |
6257 |
/* Need to issue conf_port mbox cmd before conf_msi mbox cmd */ |
6257 |
retval = lpfc_sli_config_port(phba, LPFC_SLI_REV3); |
6258 |
printk(KERN_INFO "MSI-X setup.\n"); |
|
|
6259 |
retval = lpfc_sli_config_port(phba, LPFC_SLI_REV3); |
6260 |
if (!retval) { |
6261 |
/* Now, try to enable MSI-X interrupt mode */ |
6262 |
retval = lpfc_sli_enable_msix(phba); |
6258 |
if (!retval) { |
6263 |
if (!retval) { |
6259 |
/* Now, try to enable MSI-X interrupt mode */ |
6264 |
/* Indicate initialization to MSI-X mode */ |
6260 |
retval = lpfc_sli_enable_msix(phba); |
6265 |
phba->intr_type = MSIX; |
6261 |
if (!retval) { |
6266 |
intr_mode = 2; |
6262 |
/* Indicate initialization to MSI-X mode */ |
|
|
6263 |
phba->intr_type = MSIX; |
6264 |
intr_mode = 2; |
6265 |
} |
6266 |
} |
6267 |
} |
|
|
6268 |
} |
6267 |
} |
6269 |
} |
6268 |
|
6270 |
|
6269 |
/* Fallback to MSI if MSI-X initialization failed */ |
6271 |
/* Fallback to MSI if MSI-X initialization failed */ |
6270 |
if (cfg_mode >= 1 && phba->intr_type == NONE) { |
6272 |
if (cfg_mode >= 1 && phba->intr_type == NONE) { |
6271 |
retval = lpfc_sli_enable_msi(phba); |
6273 |
printk(KERN_INFO "MSI setup.\n"); |
6272 |
if (!retval) { |
6274 |
retval = lpfc_sli_enable_msi(phba); |
6273 |
/* Indicate initialization to MSI mode */ |
6275 |
if (!retval) { |
6274 |
phba->intr_type = MSI; |
6276 |
/* Indicate initialization to MSI mode */ |
6275 |
intr_mode = 1; |
6277 |
phba->intr_type = MSI; |
6276 |
} |
6278 |
intr_mode = 1; |
|
|
6279 |
} |
6277 |
} |
6280 |
} |
6278 |
|
6281 |
|
|
|
6282 |
printk(KERN_INFO "Finished with MSI. Going into INTx in lpfc_sli_enable_intr()\n"); |
6279 |
/* Fallback to INTx if both MSI-X/MSI initalization failed */ |
6283 |
/* Fallback to INTx if both MSI-X/MSI initalization failed */ |
6280 |
if (phba->intr_type == NONE) { |
6284 |
if (phba->intr_type == NONE) { |
|
|
6285 |
printk(KERN_INFO "INTx setup.\n"); |
6281 |
retval = request_irq(phba->pcidev->irq, lpfc_sli_intr_handler, |
6286 |
retval = request_irq(phba->pcidev->irq, lpfc_sli_intr_handler, |
6282 |
IRQF_SHARED, LPFC_DRIVER_NAME, phba); |
6287 |
IRQF_SHARED, LPFC_DRIVER_NAME, phba); |
6283 |
if (!retval) { |
6288 |
if (!retval) { |
Lines 6517-6524
lpfc_sli4_enable_intr(struct lpfc_hba *p
Link Here
|
6517 |
uint32_t intr_mode = LPFC_INTR_ERROR; |
6522 |
uint32_t intr_mode = LPFC_INTR_ERROR; |
6518 |
int retval, index; |
6523 |
int retval, index; |
6519 |
|
6524 |
|
|
|
6525 |
printk(KERN_INFO "Got into lpfc_sli4_enable_intr(). MSI shit starting.\n"); |
6526 |
|
6520 |
if (cfg_mode == 2) { |
6527 |
if (cfg_mode == 2) { |
6521 |
/* Preparation before conf_msi mbox cmd */ |
6528 |
/* Preparation before conf_msi mbox cmd */ |
|
|
6529 |
printk(KERN_INFO "MSI-X setup.\n"); |
6522 |
retval = 0; |
6530 |
retval = 0; |
6523 |
if (!retval) { |
6531 |
if (!retval) { |
6524 |
/* Now, try to enable MSI-X interrupt mode */ |
6532 |
/* Now, try to enable MSI-X interrupt mode */ |
Lines 6533-6538
lpfc_sli4_enable_intr(struct lpfc_hba *p
Link Here
|
6533 |
|
6541 |
|
6534 |
/* Fallback to MSI if MSI-X initialization failed */ |
6542 |
/* Fallback to MSI if MSI-X initialization failed */ |
6535 |
if (cfg_mode >= 1 && phba->intr_type == NONE) { |
6543 |
if (cfg_mode >= 1 && phba->intr_type == NONE) { |
|
|
6544 |
printk(KERN_INFO "MSI setup.\n"); |
6536 |
retval = lpfc_sli4_enable_msi(phba); |
6545 |
retval = lpfc_sli4_enable_msi(phba); |
6537 |
if (!retval) { |
6546 |
if (!retval) { |
6538 |
/* Indicate initialization to MSI mode */ |
6547 |
/* Indicate initialization to MSI mode */ |
Lines 6541-6548
lpfc_sli4_enable_intr(struct lpfc_hba *p
Link Here
|
6541 |
} |
6550 |
} |
6542 |
} |
6551 |
} |
6543 |
|
6552 |
|
|
|
6553 |
printk(KERN_INFO "Finished MSI stuff. Getting into INTx, in lpfc_sli4_enable_intr()\n"); |
6544 |
/* Fallback to INTx if both MSI-X/MSI initalization failed */ |
6554 |
/* Fallback to INTx if both MSI-X/MSI initalization failed */ |
6545 |
if (phba->intr_type == NONE) { |
6555 |
if (phba->intr_type == NONE) { |
|
|
6556 |
printk(KERN_INFO "INTx setup.\n"); |
6546 |
retval = request_irq(phba->pcidev->irq, lpfc_sli4_intr_handler, |
6557 |
retval = request_irq(phba->pcidev->irq, lpfc_sli4_intr_handler, |
6547 |
IRQF_SHARED, LPFC_DRIVER_NAME, phba); |
6558 |
IRQF_SHARED, LPFC_DRIVER_NAME, phba); |
6548 |
if (!retval) { |
6559 |
if (!retval) { |
Lines 6725-6730
lpfc_pci_probe_one_s3(struct pci_dev *pd
Link Here
|
6725 |
int error; |
6736 |
int error; |
6726 |
uint32_t cfg_mode, intr_mode; |
6737 |
uint32_t cfg_mode, intr_mode; |
6727 |
|
6738 |
|
|
|
6739 |
printk(KERN_INFO "Well inside lpfc_pci_probe_one_s3()\n"); |
6728 |
/* Allocate memory for HBA structure */ |
6740 |
/* Allocate memory for HBA structure */ |
6729 |
phba = lpfc_hba_alloc(pdev); |
6741 |
phba = lpfc_hba_alloc(pdev); |
6730 |
if (!phba) |
6742 |
if (!phba) |
Lines 6828-6833
lpfc_pci_probe_one_s3(struct pci_dev *pd
Link Here
|
6828 |
phba->sli.slistat.sli_intr > LPFC_MSIX_VECTORS) { |
6840 |
phba->sli.slistat.sli_intr > LPFC_MSIX_VECTORS) { |
6829 |
/* Log the current active interrupt mode */ |
6841 |
/* Log the current active interrupt mode */ |
6830 |
phba->intr_mode = intr_mode; |
6842 |
phba->intr_mode = intr_mode; |
|
|
6843 |
printk(KERN_INFO "intr_mode is %d and we are into the interrupt if, in lpfc_pci_probe_one_s3()\n", intr_mode); |
6831 |
lpfc_log_intr_mode(phba, intr_mode); |
6844 |
lpfc_log_intr_mode(phba, intr_mode); |
6832 |
break; |
6845 |
break; |
6833 |
} else { |
6846 |
} else { |
Lines 6842-6847
lpfc_pci_probe_one_s3(struct pci_dev *pd
Link Here
|
6842 |
} |
6855 |
} |
6843 |
} |
6856 |
} |
6844 |
|
6857 |
|
|
|
6858 |
printk(KERN_INFO "Left setup in lpfc_pci_probe_one_s3\n"); |
6845 |
/* Perform post initialization setup */ |
6859 |
/* Perform post initialization setup */ |
6846 |
lpfc_post_init_setup(phba); |
6860 |
lpfc_post_init_setup(phba); |
6847 |
|
6861 |
|
Lines 7253-7258
lpfc_pci_probe_one_s4(struct pci_dev *pd
Link Here
|
7253 |
uint32_t cfg_mode, intr_mode; |
7267 |
uint32_t cfg_mode, intr_mode; |
7254 |
int mcnt; |
7268 |
int mcnt; |
7255 |
|
7269 |
|
|
|
7270 |
printk(KERN_INFO "Entering lpfc_pci_probe_one_s4()\n"); |
7256 |
/* Allocate memory for HBA structure */ |
7271 |
/* Allocate memory for HBA structure */ |
7257 |
phba = lpfc_hba_alloc(pdev); |
7272 |
phba = lpfc_hba_alloc(pdev); |
7258 |
if (!phba) |
7273 |
if (!phba) |
Lines 7330-7335
lpfc_pci_probe_one_s4(struct pci_dev *pd
Link Here
|
7330 |
} |
7345 |
} |
7331 |
|
7346 |
|
7332 |
/* Now, trying to enable interrupt and bring up the device */ |
7347 |
/* Now, trying to enable interrupt and bring up the device */ |
|
|
7348 |
printk(KERN_INFO "Starting interrupt stuff inside lpfc_pci_probe_one_s4()\n"); |
7333 |
cfg_mode = phba->cfg_use_msi; |
7349 |
cfg_mode = phba->cfg_use_msi; |
7334 |
while (true) { |
7350 |
while (true) { |
7335 |
/* Put device to a known state before enabling interrupt */ |
7351 |
/* Put device to a known state before enabling interrupt */ |
Lines 7360-7365
lpfc_pci_probe_one_s4(struct pci_dev *pd
Link Here
|
7360 |
phba->sli.slistat.sli_intr >= LPFC_ACT_INTR_CNT) { |
7376 |
phba->sli.slistat.sli_intr >= LPFC_ACT_INTR_CNT) { |
7361 |
/* Log the current active interrupt mode */ |
7377 |
/* Log the current active interrupt mode */ |
7362 |
phba->intr_mode = intr_mode; |
7378 |
phba->intr_mode = intr_mode; |
|
|
7379 |
printk(KERN_INFO "intr_mode is: %d and we are into the interrupt if, always in lpfc_pci_probe_one_s4()\n"); |
7363 |
lpfc_log_intr_mode(phba, intr_mode); |
7380 |
lpfc_log_intr_mode(phba, intr_mode); |
7364 |
break; |
7381 |
break; |
7365 |
} |
7382 |
} |
Lines 7373-7378
lpfc_pci_probe_one_s4(struct pci_dev *pd
Link Here
|
7373 |
cfg_mode = --intr_mode; |
7390 |
cfg_mode = --intr_mode; |
7374 |
} |
7391 |
} |
7375 |
|
7392 |
|
|
|
7393 |
printk(KERN_INFO "finished setup in lpfc_pci_probe_one_s4()\n"); |
7376 |
/* Perform post initialization setup */ |
7394 |
/* Perform post initialization setup */ |
7377 |
lpfc_post_init_setup(phba); |
7395 |
lpfc_post_init_setup(phba); |
7378 |
|
7396 |
|
Lines 7670-7675
lpfc_pci_probe_one(struct pci_dev *pdev,
Link Here
|
7670 |
int rc; |
7688 |
int rc; |
7671 |
struct lpfc_sli_intf intf; |
7689 |
struct lpfc_sli_intf intf; |
7672 |
|
7690 |
|
|
|
7691 |
printk(KERN_INFO "Entering lpfc_pci_probe_one()\n"); |
7673 |
if (pci_read_config_dword(pdev, LPFC_SLIREV_CONF_WORD, &intf.word0)) |
7692 |
if (pci_read_config_dword(pdev, LPFC_SLIREV_CONF_WORD, &intf.word0)) |
7674 |
return -ENODEV; |
7693 |
return -ENODEV; |
7675 |
|
7694 |
|