Re: [PATCH v2 1/3] qla2xxx: Fix MPI failure AEN (8200) handling.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nilesh,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20200327]
[cannot apply to v5.6-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Nilesh-Javali/qla2xxx-Updates-for-the-driver/20200328-041450
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=9.2.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/scsi/qla2xxx/qla_isr.c: In function 'qla2x00_async_event':
>> drivers/scsi/qla2xxx/qla_isr.c:903:5: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
     903 |   } else
         |     ^~~~
   drivers/scsi/qla2xxx/qla_isr.c:908:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
     908 |    if ((IS_QLA27XX(ha) || IS_QLA28XX(ha)) &&
         |    ^~

vim +/else +903 drivers/scsi/qla2xxx/qla_isr.c

ff3a920efcdbfa Arun Easi           2020-03-27   792  
^1da177e4c3f41 Linus Torvalds      2005-04-16   793  /**
^1da177e4c3f41 Linus Torvalds      2005-04-16   794   * qla2x00_async_event() - Process aynchronous events.
2db6228d9cd13b Bart Van Assche     2018-01-23   795   * @vha: SCSI driver HA context
2db6228d9cd13b Bart Van Assche     2018-01-23   796   * @rsp: response queue
9a853f71804d80 Andrew Vasquez      2005-07-06   797   * @mb: Mailbox registers (0 - 3)
^1da177e4c3f41 Linus Torvalds      2005-04-16   798   */
2c3dfe3f6ad8da Seokmann Ju         2007-07-05   799  void
73208dfd7ab19f Anirban Chakraborty 2008-12-09   800  qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
^1da177e4c3f41 Linus Torvalds      2005-04-16   801  {
^1da177e4c3f41 Linus Torvalds      2005-04-16   802  	uint16_t	handle_cnt;
bdab23da71c369 Andrew Vasquez      2009-10-13   803  	uint16_t	cnt, mbx;
^1da177e4c3f41 Linus Torvalds      2005-04-16   804  	uint32_t	handles[5];
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   805  	struct qla_hw_data *ha = vha->hw;
3d71644cf952fd Andrew Vasquez      2005-07-06   806  	struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
bdab23da71c369 Andrew Vasquez      2009-10-13   807  	struct device_reg_24xx __iomem *reg24 = &ha->iobase->isp24;
bc5c2aad17b045 Andrew Vasquez      2010-12-21   808  	struct device_reg_82xx __iomem *reg82 = &ha->iobase->isp82;
52c82823cc686d Bart Van Assche     2015-07-09   809  	uint32_t	rscn_entry, host_pid;
4d4df1932b6b11 Harihara Kadayam    2008-04-03   810  	unsigned long	flags;
ef86cb2059a14b Chad Dupuis         2014-09-25   811  	fc_port_t	*fcport = NULL;
^1da177e4c3f41 Linus Torvalds      2005-04-16   812  
45235022da9925 Quinn Tran          2018-07-18   813  	if (!vha->hw->flags.fw_started)
45235022da9925 Quinn Tran          2018-07-18   814  		return;
45235022da9925 Quinn Tran          2018-07-18   815  
^1da177e4c3f41 Linus Torvalds      2005-04-16   816  	/* Setup to process RIO completion. */
^1da177e4c3f41 Linus Torvalds      2005-04-16   817  	handle_cnt = 0;
6246b8a1d26c7c Giridhar Malavali   2012-02-09   818  	if (IS_CNA_CAPABLE(ha))
3a03eb797ce76a Andrew Vasquez      2009-01-05   819  		goto skip_rio;
^1da177e4c3f41 Linus Torvalds      2005-04-16   820  	switch (mb[0]) {
^1da177e4c3f41 Linus Torvalds      2005-04-16   821  	case MBA_SCSI_COMPLETION:
9a853f71804d80 Andrew Vasquez      2005-07-06   822  		handles[0] = le32_to_cpu((uint32_t)((mb[2] << 16) | mb[1]));
^1da177e4c3f41 Linus Torvalds      2005-04-16   823  		handle_cnt = 1;
^1da177e4c3f41 Linus Torvalds      2005-04-16   824  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   825  	case MBA_CMPLT_1_16BIT:
9a853f71804d80 Andrew Vasquez      2005-07-06   826  		handles[0] = mb[1];
^1da177e4c3f41 Linus Torvalds      2005-04-16   827  		handle_cnt = 1;
^1da177e4c3f41 Linus Torvalds      2005-04-16   828  		mb[0] = MBA_SCSI_COMPLETION;
^1da177e4c3f41 Linus Torvalds      2005-04-16   829  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   830  	case MBA_CMPLT_2_16BIT:
9a853f71804d80 Andrew Vasquez      2005-07-06   831  		handles[0] = mb[1];
9a853f71804d80 Andrew Vasquez      2005-07-06   832  		handles[1] = mb[2];
^1da177e4c3f41 Linus Torvalds      2005-04-16   833  		handle_cnt = 2;
^1da177e4c3f41 Linus Torvalds      2005-04-16   834  		mb[0] = MBA_SCSI_COMPLETION;
^1da177e4c3f41 Linus Torvalds      2005-04-16   835  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   836  	case MBA_CMPLT_3_16BIT:
9a853f71804d80 Andrew Vasquez      2005-07-06   837  		handles[0] = mb[1];
9a853f71804d80 Andrew Vasquez      2005-07-06   838  		handles[1] = mb[2];
9a853f71804d80 Andrew Vasquez      2005-07-06   839  		handles[2] = mb[3];
^1da177e4c3f41 Linus Torvalds      2005-04-16   840  		handle_cnt = 3;
^1da177e4c3f41 Linus Torvalds      2005-04-16   841  		mb[0] = MBA_SCSI_COMPLETION;
^1da177e4c3f41 Linus Torvalds      2005-04-16   842  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   843  	case MBA_CMPLT_4_16BIT:
9a853f71804d80 Andrew Vasquez      2005-07-06   844  		handles[0] = mb[1];
9a853f71804d80 Andrew Vasquez      2005-07-06   845  		handles[1] = mb[2];
9a853f71804d80 Andrew Vasquez      2005-07-06   846  		handles[2] = mb[3];
^1da177e4c3f41 Linus Torvalds      2005-04-16   847  		handles[3] = (uint32_t)RD_MAILBOX_REG(ha, reg, 6);
^1da177e4c3f41 Linus Torvalds      2005-04-16   848  		handle_cnt = 4;
^1da177e4c3f41 Linus Torvalds      2005-04-16   849  		mb[0] = MBA_SCSI_COMPLETION;
^1da177e4c3f41 Linus Torvalds      2005-04-16   850  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   851  	case MBA_CMPLT_5_16BIT:
9a853f71804d80 Andrew Vasquez      2005-07-06   852  		handles[0] = mb[1];
9a853f71804d80 Andrew Vasquez      2005-07-06   853  		handles[1] = mb[2];
9a853f71804d80 Andrew Vasquez      2005-07-06   854  		handles[2] = mb[3];
^1da177e4c3f41 Linus Torvalds      2005-04-16   855  		handles[3] = (uint32_t)RD_MAILBOX_REG(ha, reg, 6);
^1da177e4c3f41 Linus Torvalds      2005-04-16   856  		handles[4] = (uint32_t)RD_MAILBOX_REG(ha, reg, 7);
^1da177e4c3f41 Linus Torvalds      2005-04-16   857  		handle_cnt = 5;
^1da177e4c3f41 Linus Torvalds      2005-04-16   858  		mb[0] = MBA_SCSI_COMPLETION;
^1da177e4c3f41 Linus Torvalds      2005-04-16   859  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   860  	case MBA_CMPLT_2_32BIT:
9a853f71804d80 Andrew Vasquez      2005-07-06   861  		handles[0] = le32_to_cpu((uint32_t)((mb[2] << 16) | mb[1]));
^1da177e4c3f41 Linus Torvalds      2005-04-16   862  		handles[1] = le32_to_cpu(
^1da177e4c3f41 Linus Torvalds      2005-04-16   863  		    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 7) << 16)) |
^1da177e4c3f41 Linus Torvalds      2005-04-16   864  		    RD_MAILBOX_REG(ha, reg, 6));
^1da177e4c3f41 Linus Torvalds      2005-04-16   865  		handle_cnt = 2;
^1da177e4c3f41 Linus Torvalds      2005-04-16   866  		mb[0] = MBA_SCSI_COMPLETION;
^1da177e4c3f41 Linus Torvalds      2005-04-16   867  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   868  	default:
^1da177e4c3f41 Linus Torvalds      2005-04-16   869  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   870  	}
3a03eb797ce76a Andrew Vasquez      2009-01-05   871  skip_rio:
^1da177e4c3f41 Linus Torvalds      2005-04-16   872  	switch (mb[0]) {
^1da177e4c3f41 Linus Torvalds      2005-04-16   873  	case MBA_SCSI_COMPLETION:	/* Fast Post */
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   874  		if (!vha->flags.online)
^1da177e4c3f41 Linus Torvalds      2005-04-16   875  			break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   876  
^1da177e4c3f41 Linus Torvalds      2005-04-16   877  		for (cnt = 0; cnt < handle_cnt; cnt++)
73208dfd7ab19f Anirban Chakraborty 2008-12-09   878  			qla2x00_process_completed_request(vha, rsp->req,
73208dfd7ab19f Anirban Chakraborty 2008-12-09   879  				handles[cnt]);
^1da177e4c3f41 Linus Torvalds      2005-04-16   880  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   881  
^1da177e4c3f41 Linus Torvalds      2005-04-16   882  	case MBA_RESET:			/* Reset */
7c3df1320e5e87 Saurav Kashyap      2011-07-14   883  		ql_dbg(ql_dbg_async, vha, 0x5002,
7c3df1320e5e87 Saurav Kashyap      2011-07-14   884  		    "Asynchronous RESET.\n");
^1da177e4c3f41 Linus Torvalds      2005-04-16   885  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   886  		set_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
^1da177e4c3f41 Linus Torvalds      2005-04-16   887  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   888  
^1da177e4c3f41 Linus Torvalds      2005-04-16   889  	case MBA_SYSTEM_ERR:		/* System Error */
a82c307e69c465 Quinn Tran          2020-02-26   890  		mbx = 0;
a82c307e69c465 Quinn Tran          2020-02-26   891  		if (IS_QLA81XX(ha) || IS_QLA83XX(ha) ||
a82c307e69c465 Quinn Tran          2020-02-26   892  		    IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
a82c307e69c465 Quinn Tran          2020-02-26   893  			u16 m[4];
a82c307e69c465 Quinn Tran          2020-02-26   894  
a82c307e69c465 Quinn Tran          2020-02-26   895  			m[0] = RD_REG_WORD(&reg24->mailbox4);
a82c307e69c465 Quinn Tran          2020-02-26   896  			m[1] = RD_REG_WORD(&reg24->mailbox5);
a82c307e69c465 Quinn Tran          2020-02-26   897  			m[2] = RD_REG_WORD(&reg24->mailbox6);
a82c307e69c465 Quinn Tran          2020-02-26   898  			mbx = m[3] = RD_REG_WORD(&reg24->mailbox7);
a82c307e69c465 Quinn Tran          2020-02-26   899  
7c3df1320e5e87 Saurav Kashyap      2011-07-14   900  			ql_log(ql_log_warn, vha, 0x5003,
a82c307e69c465 Quinn Tran          2020-02-26   901  			    "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh mbx4=%xh mbx5=%xh mbx6=%xh mbx7=%xh.\n",
a82c307e69c465 Quinn Tran          2020-02-26   902  			    mb[1], mb[2], mb[3], m[0], m[1], m[2], m[3]);
a82c307e69c465 Quinn Tran          2020-02-26  @903  		} else
a82c307e69c465 Quinn Tran          2020-02-26   904  			ql_log(ql_log_warn, vha, 0x5003,
a82c307e69c465 Quinn Tran          2020-02-26   905  			    "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh.\n ",
a82c307e69c465 Quinn Tran          2020-02-26   906  			    mb[1], mb[2], mb[3]);
a82c307e69c465 Quinn Tran          2020-02-26   907  
ff3a920efcdbfa Arun Easi           2020-03-27   908  			if ((IS_QLA27XX(ha) || IS_QLA28XX(ha)) &&
ff3a920efcdbfa Arun Easi           2020-03-27   909  			   RD_REG_WORD(&reg24->mailbox7) & BIT_8)
ff3a920efcdbfa Arun Easi           2020-03-27   910  				ha->isp_ops->mpi_fw_dump(vha, 1);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   911  		ha->isp_ops->fw_dump(vha, 1);
ec7193e2605511 Quinn Tran          2017-03-15   912  		ha->flags.fw_init_done = 0;
4b60c82736d0e2 Quinn Tran          2017-06-13   913  		QLA_FW_STOPPED(ha);
^1da177e4c3f41 Linus Torvalds      2005-04-16   914  
e428924ccdf464 Andrew Vasquez      2007-07-19   915  		if (IS_FWI2_CAPABLE(ha)) {
9a853f71804d80 Andrew Vasquez      2005-07-06   916  			if (mb[1] == 0 && mb[2] == 0) {
7c3df1320e5e87 Saurav Kashyap      2011-07-14   917  				ql_log(ql_log_fatal, vha, 0x5004,
9a853f71804d80 Andrew Vasquez      2005-07-06   918  				    "Unrecoverable Hardware Error: adapter "
9a853f71804d80 Andrew Vasquez      2005-07-06   919  				    "marked OFFLINE!\n");
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   920  				vha->flags.online = 0;
6246b8a1d26c7c Giridhar Malavali   2012-02-09   921  				vha->device_flags |= DFLG_DEV_FAILED;
b1d46989c12ec4 Madhuranath Iyengar 2010-09-03   922  			} else {
25985edcedea63 Lucas De Marchi     2011-03-30   923  				/* Check to see if MPI timeout occurred */
f73cb695d3eccd Chad Dupuis         2014-02-26   924  				if ((mbx & MBX_3) && (ha->port_no == 0))
b1d46989c12ec4 Madhuranath Iyengar 2010-09-03   925  					set_bit(MPI_RESET_NEEDED,
b1d46989c12ec4 Madhuranath Iyengar 2010-09-03   926  					    &vha->dpc_flags);
b1d46989c12ec4 Madhuranath Iyengar 2010-09-03   927  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   928  				set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
b1d46989c12ec4 Madhuranath Iyengar 2010-09-03   929  			}
9a853f71804d80 Andrew Vasquez      2005-07-06   930  		} else if (mb[1] == 0) {
7c3df1320e5e87 Saurav Kashyap      2011-07-14   931  			ql_log(ql_log_fatal, vha, 0x5005,
^1da177e4c3f41 Linus Torvalds      2005-04-16   932  			    "Unrecoverable Hardware Error: adapter marked "
^1da177e4c3f41 Linus Torvalds      2005-04-16   933  			    "OFFLINE!\n");
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   934  			vha->flags.online = 0;
6246b8a1d26c7c Giridhar Malavali   2012-02-09   935  			vha->device_flags |= DFLG_DEV_FAILED;
^1da177e4c3f41 Linus Torvalds      2005-04-16   936  		} else
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   937  			set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
^1da177e4c3f41 Linus Torvalds      2005-04-16   938  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   939  
^1da177e4c3f41 Linus Torvalds      2005-04-16   940  	case MBA_REQ_TRANSFER_ERR:	/* Request Transfer Error */
7c3df1320e5e87 Saurav Kashyap      2011-07-14   941  		ql_log(ql_log_warn, vha, 0x5006,
bdab23da71c369 Andrew Vasquez      2009-10-13   942  		    "ISP Request Transfer Error (%x).\n",  mb[1]);
^1da177e4c3f41 Linus Torvalds      2005-04-16   943  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   944  		set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
^1da177e4c3f41 Linus Torvalds      2005-04-16   945  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   946  
^1da177e4c3f41 Linus Torvalds      2005-04-16   947  	case MBA_RSP_TRANSFER_ERR:	/* Response Transfer Error */
7c3df1320e5e87 Saurav Kashyap      2011-07-14   948  		ql_log(ql_log_warn, vha, 0x5007,
41233cd3a454b6 Joe Carnuccio       2016-07-06   949  		    "ISP Response Transfer Error (%x).\n", mb[1]);
^1da177e4c3f41 Linus Torvalds      2005-04-16   950  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   951  		set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
^1da177e4c3f41 Linus Torvalds      2005-04-16   952  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   953  
^1da177e4c3f41 Linus Torvalds      2005-04-16   954  	case MBA_WAKEUP_THRES:		/* Request Queue Wake-up */
7c3df1320e5e87 Saurav Kashyap      2011-07-14   955  		ql_dbg(ql_dbg_async, vha, 0x5008,
41233cd3a454b6 Joe Carnuccio       2016-07-06   956  		    "Asynchronous WAKEUP_THRES (%x).\n", mb[1]);
41233cd3a454b6 Joe Carnuccio       2016-07-06   957  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   958  
41233cd3a454b6 Joe Carnuccio       2016-07-06   959  	case MBA_LOOP_INIT_ERR:
75d560e0952466 Sawan Chandak       2016-07-06   960  		ql_log(ql_log_warn, vha, 0x5090,
41233cd3a454b6 Joe Carnuccio       2016-07-06   961  		    "LOOP INIT ERROR (%x).\n", mb[1]);
41233cd3a454b6 Joe Carnuccio       2016-07-06   962  		set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2d70c103fd2a06 Nicholas Bellinger  2012-05-15   963  		break;
41233cd3a454b6 Joe Carnuccio       2016-07-06   964  
^1da177e4c3f41 Linus Torvalds      2005-04-16   965  	case MBA_LIP_OCCURRED:		/* Loop Initialization Procedure */
ec7193e2605511 Quinn Tran          2017-03-15   966  		ha->flags.lip_ae = 1;
ec7193e2605511 Quinn Tran          2017-03-15   967  
cfb0919c12a331 Chad Dupuis         2011-11-18   968  		ql_dbg(ql_dbg_async, vha, 0x5009,
7c3df1320e5e87 Saurav Kashyap      2011-07-14   969  		    "LIP occurred (%x).\n", mb[1]);
^1da177e4c3f41 Linus Torvalds      2005-04-16   970  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   971  		if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   972  			atomic_set(&vha->loop_state, LOOP_DOWN);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   973  			atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
3c75ad1d87c7d2 Himanshu Madhani    2019-12-17   974  			qla2x00_mark_all_devices_lost(vha);
^1da177e4c3f41 Linus Torvalds      2005-04-16   975  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16   976  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   977  		if (vha->vp_idx) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   978  			atomic_set(&vha->vp_state, VP_FAILED);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   979  			fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED);
2c3dfe3f6ad8da Seokmann Ju         2007-07-05   980  		}
2c3dfe3f6ad8da Seokmann Ju         2007-07-05   981  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   982  		set_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   983  		set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags);
^1da177e4c3f41 Linus Torvalds      2005-04-16   984  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   985  		vha->flags.management_server_logged_in = 0;
e315cd28b9ef0d Anirban Chakraborty 2008-11-06   986  		qla2x00_post_aen_work(vha, FCH_EVT_LIP, mb[1]);
^1da177e4c3f41 Linus Torvalds      2005-04-16   987  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16   988  
^1da177e4c3f41 Linus Torvalds      2005-04-16   989  	case MBA_LOOP_UP:		/* Loop Up Event */
daae62a33e4f9b Chad Dupuis         2012-05-15   990  		if (IS_QLA2100(ha) || IS_QLA2200(ha))
d8b4521349274a Andrew Vasquez      2006-10-02   991  			ha->link_data_rate = PORT_SPEED_1GB;
daae62a33e4f9b Chad Dupuis         2012-05-15   992  		else
^1da177e4c3f41 Linus Torvalds      2005-04-16   993  			ha->link_data_rate = mb[1];
^1da177e4c3f41 Linus Torvalds      2005-04-16   994  
8e5a9484aee8d4 Chad Dupuis         2014-08-08   995  		ql_log(ql_log_info, vha, 0x500a,
daae62a33e4f9b Chad Dupuis         2012-05-15   996  		    "LOOP UP detected (%s Gbps).\n",
d0297c9a3f429d Joe Carnuccio       2012-11-21   997  		    qla2x00_get_link_speed_str(ha, ha->link_data_rate));
^1da177e4c3f41 Linus Torvalds      2005-04-16   998  
75666f4a8c4103 Himanshu Madhani    2020-02-12   999  		if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
75666f4a8c4103 Himanshu Madhani    2020-02-12  1000  			if (mb[2] & BIT_0)
75666f4a8c4103 Himanshu Madhani    2020-02-12  1001  				ql_log(ql_log_info, vha, 0x11a0,
75666f4a8c4103 Himanshu Madhani    2020-02-12  1002  				    "FEC=enabled (link up).\n");
75666f4a8c4103 Himanshu Madhani    2020-02-12  1003  		}
75666f4a8c4103 Himanshu Madhani    2020-02-12  1004  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1005  		vha->flags.management_server_logged_in = 0;
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1006  		qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, ha->link_data_rate);
e4e3a2ce9556cc Quinn Tran          2017-08-23  1007  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1008  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1009  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1010  	case MBA_LOOP_DOWN:		/* Loop Down Event */
9cd883f07a54e5 Quinn Tran          2017-12-28  1011  		SAVE_TOPO(ha);
ec7193e2605511 Quinn Tran          2017-03-15  1012  		ha->flags.lip_ae = 0;
ec7193e2605511 Quinn Tran          2017-03-15  1013  		ha->current_topology = 0;
ec7193e2605511 Quinn Tran          2017-03-15  1014  
6246b8a1d26c7c Giridhar Malavali   2012-02-09  1015  		mbx = (IS_QLA81XX(ha) || IS_QLA8031(ha))
6246b8a1d26c7c Giridhar Malavali   2012-02-09  1016  			? RD_REG_WORD(&reg24->mailbox4) : 0;
7ec0effd30bb4b Atul Deshmukh       2013-08-27  1017  		mbx = (IS_P3P_TYPE(ha)) ? RD_REG_WORD(&reg82->mailbox_out[4])
7ec0effd30bb4b Atul Deshmukh       2013-08-27  1018  			: mbx;
8e5a9484aee8d4 Chad Dupuis         2014-08-08  1019  		ql_log(ql_log_info, vha, 0x500b,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1020  		    "LOOP DOWN detected (%x %x %x %x).\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1021  		    mb[1], mb[2], mb[3], mbx);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1022  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1023  		if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1024  			atomic_set(&vha->loop_state, LOOP_DOWN);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1025  			atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
2486c62765d73a Himanshu Madhani    2014-09-25  1026  			/*
2486c62765d73a Himanshu Madhani    2014-09-25  1027  			 * In case of loop down, restore WWPN from
2486c62765d73a Himanshu Madhani    2014-09-25  1028  			 * NVRAM in case of FA-WWPN capable ISP
718abbdca79f8a Sawan Chandak       2015-04-09  1029  			 * Restore for Physical Port only
2486c62765d73a Himanshu Madhani    2014-09-25  1030  			 */
718abbdca79f8a Sawan Chandak       2015-04-09  1031  			if (!vha->vp_idx) {
dcbf8f8087ebc4 Sawan Chandak       2019-01-24  1032  				if (ha->flags.fawwpn_enabled &&
dcbf8f8087ebc4 Sawan Chandak       2019-01-24  1033  				    (ha->current_topology == ISP_CFG_F)) {
2486c62765d73a Himanshu Madhani    2014-09-25  1034  					void *wwpn = ha->init_cb->port_name;
bd432bb53cffea Bart Van Assche     2019-04-11  1035  
2486c62765d73a Himanshu Madhani    2014-09-25  1036  					memcpy(vha->port_name, wwpn, WWN_SIZE);
718abbdca79f8a Sawan Chandak       2015-04-09  1037  					fc_host_port_name(vha->host) =
718abbdca79f8a Sawan Chandak       2015-04-09  1038  					    wwn_to_u64(vha->port_name);
718abbdca79f8a Sawan Chandak       2015-04-09  1039  					ql_dbg(ql_dbg_init + ql_dbg_verbose,
83548fe2fcbb78 Quinn Tran          2017-06-02  1040  					    vha, 0x00d8, "LOOP DOWN detected,"
718abbdca79f8a Sawan Chandak       2015-04-09  1041  					    "restore WWPN %016llx\n",
718abbdca79f8a Sawan Chandak       2015-04-09  1042  					    wwn_to_u64(vha->port_name));
2486c62765d73a Himanshu Madhani    2014-09-25  1043  				}
2486c62765d73a Himanshu Madhani    2014-09-25  1044  
ded6411fd88267 Sawan Chandak       2015-04-09  1045  				clear_bit(VP_CONFIG_OK, &vha->vp_flags);
718abbdca79f8a Sawan Chandak       2015-04-09  1046  			}
718abbdca79f8a Sawan Chandak       2015-04-09  1047  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1048  			vha->device_flags |= DFLG_NO_CABLE;
3c75ad1d87c7d2 Himanshu Madhani    2019-12-17  1049  			qla2x00_mark_all_devices_lost(vha);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1050  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16  1051  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1052  		if (vha->vp_idx) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1053  			atomic_set(&vha->vp_state, VP_FAILED);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1054  			fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED);
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1055  		}
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1056  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1057  		vha->flags.management_server_logged_in = 0;
d8b4521349274a Andrew Vasquez      2006-10-02  1058  		ha->link_data_rate = PORT_SPEED_UNKNOWN;
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1059  		qla2x00_post_aen_work(vha, FCH_EVT_LINKDOWN, 0);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1060  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1061  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1062  	case MBA_LIP_RESET:		/* LIP reset occurred */
cfb0919c12a331 Chad Dupuis         2011-11-18  1063  		ql_dbg(ql_dbg_async, vha, 0x500c,
cc3ef7bc40bbed Bjorn Helgaas       2008-09-11  1064  		    "LIP reset occurred (%x).\n", mb[1]);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1065  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1066  		if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1067  			atomic_set(&vha->loop_state, LOOP_DOWN);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1068  			atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
3c75ad1d87c7d2 Himanshu Madhani    2019-12-17  1069  			qla2x00_mark_all_devices_lost(vha);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1070  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16  1071  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1072  		if (vha->vp_idx) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1073  			atomic_set(&vha->vp_state, VP_FAILED);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1074  			fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED);
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1075  		}
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1076  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1077  		set_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1078  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1079  		ha->operating_mode = LOOP;
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1080  		vha->flags.management_server_logged_in = 0;
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1081  		qla2x00_post_aen_work(vha, FCH_EVT_LIPRESET, mb[1]);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1082  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1083  
3a03eb797ce76a Andrew Vasquez      2009-01-05  1084  	/* case MBA_DCBX_COMPLETE: */
^1da177e4c3f41 Linus Torvalds      2005-04-16  1085  	case MBA_POINT_TO_POINT:	/* Point-to-Point */
ec7193e2605511 Quinn Tran          2017-03-15  1086  		ha->flags.lip_ae = 0;
ec7193e2605511 Quinn Tran          2017-03-15  1087  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1088  		if (IS_QLA2100(ha))
^1da177e4c3f41 Linus Torvalds      2005-04-16  1089  			break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1090  
7ec0effd30bb4b Atul Deshmukh       2013-08-27  1091  		if (IS_CNA_CAPABLE(ha)) {
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1092  			ql_dbg(ql_dbg_async, vha, 0x500d,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1093  			    "DCBX Completed -- %04x %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1094  			    mb[1], mb[2], mb[3]);
9aaf2cea4e63ed Chad Dupuis         2013-10-30  1095  			if (ha->notify_dcbx_comp && !vha->vp_idx)
23f2ebd17a1383 Sarang Radke        2010-05-28  1096  				complete(&ha->dcbx_comp);
23f2ebd17a1383 Sarang Radke        2010-05-28  1097  
23f2ebd17a1383 Sarang Radke        2010-05-28  1098  		} else
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1099  			ql_dbg(ql_dbg_async, vha, 0x500e,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1100  			    "Asynchronous P2P MODE received.\n");
^1da177e4c3f41 Linus Torvalds      2005-04-16  1101  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1102  		/*
^1da177e4c3f41 Linus Torvalds      2005-04-16  1103  		 * Until there's a transition from loop down to loop up, treat
^1da177e4c3f41 Linus Torvalds      2005-04-16  1104  		 * this as loop down only.
^1da177e4c3f41 Linus Torvalds      2005-04-16  1105  		 */
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1106  		if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1107  			atomic_set(&vha->loop_state, LOOP_DOWN);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1108  			if (!atomic_read(&vha->loop_down_timer))
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1109  				atomic_set(&vha->loop_down_timer,
^1da177e4c3f41 Linus Torvalds      2005-04-16  1110  				    LOOP_DOWN_TIME);
48acad09907498 Quinn Tran          2018-08-02  1111  			if (!N2N_TOPO(ha))
3c75ad1d87c7d2 Himanshu Madhani    2019-12-17  1112  				qla2x00_mark_all_devices_lost(vha);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1113  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16  1114  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1115  		if (vha->vp_idx) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1116  			atomic_set(&vha->vp_state, VP_FAILED);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1117  			fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED);
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1118  		}
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1119  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1120  		if (!(test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)))
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1121  			set_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1122  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1123  		set_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1124  		set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags);
4346b14942dbb6 Andrew Vasquez      2006-12-13  1125  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1126  		vha->flags.management_server_logged_in = 0;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1127  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1128  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1129  	case MBA_CHG_IN_CONNECTION:	/* Change in connection mode */
^1da177e4c3f41 Linus Torvalds      2005-04-16  1130  		if (IS_QLA2100(ha))
^1da177e4c3f41 Linus Torvalds      2005-04-16  1131  			break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1132  
cfb0919c12a331 Chad Dupuis         2011-11-18  1133  		ql_dbg(ql_dbg_async, vha, 0x500f,
^1da177e4c3f41 Linus Torvalds      2005-04-16  1134  		    "Configuration change detected: value=%x.\n", mb[1]);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1135  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1136  		if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1137  			atomic_set(&vha->loop_state, LOOP_DOWN);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1138  			if (!atomic_read(&vha->loop_down_timer))
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1139  				atomic_set(&vha->loop_down_timer,
^1da177e4c3f41 Linus Torvalds      2005-04-16  1140  				    LOOP_DOWN_TIME);
3c75ad1d87c7d2 Himanshu Madhani    2019-12-17  1141  			qla2x00_mark_all_devices_lost(vha);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1142  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16  1143  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1144  		if (vha->vp_idx) {
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1145  			atomic_set(&vha->vp_state, VP_FAILED);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1146  			fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED);
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1147  		}
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1148  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1149  		set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1150  		set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1151  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1152  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1153  	case MBA_PORT_UPDATE:		/* Port database update */
55903b9d152e91 Santosh Vernekar    2009-07-31  1154  		/*
55903b9d152e91 Santosh Vernekar    2009-07-31  1155  		 * Handle only global and vn-port update events
55903b9d152e91 Santosh Vernekar    2009-07-31  1156  		 *
55903b9d152e91 Santosh Vernekar    2009-07-31  1157  		 * Relevant inputs:
55903b9d152e91 Santosh Vernekar    2009-07-31  1158  		 * mb[1] = N_Port handle of changed port
55903b9d152e91 Santosh Vernekar    2009-07-31  1159  		 * OR 0xffff for global event
55903b9d152e91 Santosh Vernekar    2009-07-31  1160  		 * mb[2] = New login state
55903b9d152e91 Santosh Vernekar    2009-07-31  1161  		 * 7 = Port logged out
55903b9d152e91 Santosh Vernekar    2009-07-31  1162  		 * mb[3] = LSB is vp_idx, 0xff = all vps
55903b9d152e91 Santosh Vernekar    2009-07-31  1163  		 *
55903b9d152e91 Santosh Vernekar    2009-07-31  1164  		 * Skip processing if:
55903b9d152e91 Santosh Vernekar    2009-07-31  1165  		 *       Event is global, vp_idx is NOT all vps,
55903b9d152e91 Santosh Vernekar    2009-07-31  1166  		 *           vp_idx does not match
55903b9d152e91 Santosh Vernekar    2009-07-31  1167  		 *       Event is not global, vp_idx does not match
55903b9d152e91 Santosh Vernekar    2009-07-31  1168  		 */
12cec63e40f9b9 Andrew Vasquez      2010-03-19  1169  		if (IS_QLA2XXX_MIDTYPE(ha) &&
12cec63e40f9b9 Andrew Vasquez      2010-03-19  1170  		    ((mb[1] == 0xffff && (mb[3] & 0xff) != 0xff) ||
12cec63e40f9b9 Andrew Vasquez      2010-03-19  1171  			(mb[1] != 0xffff)) && vha->vp_idx != (mb[3] & 0xff))
73208dfd7ab19f Anirban Chakraborty 2008-12-09  1172  			break;
73208dfd7ab19f Anirban Chakraborty 2008-12-09  1173  
17cac3a175a02c Joe Carnuccio       2015-08-04  1174  		if (mb[2] == 0x7) {
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1175  			ql_dbg(ql_dbg_async, vha, 0x5010,
17cac3a175a02c Joe Carnuccio       2015-08-04  1176  			    "Port %s %04x %04x %04x.\n",
17cac3a175a02c Joe Carnuccio       2015-08-04  1177  			    mb[1] == 0xffff ? "unavailable" : "logout",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1178  			    mb[1], mb[2], mb[3]);
17cac3a175a02c Joe Carnuccio       2015-08-04  1179  
17cac3a175a02c Joe Carnuccio       2015-08-04  1180  			if (mb[1] == 0xffff)
17cac3a175a02c Joe Carnuccio       2015-08-04  1181  				goto global_port_update;
17cac3a175a02c Joe Carnuccio       2015-08-04  1182  
b98ae0d748dbc8 Quinn Tran          2017-06-02  1183  			if (mb[1] == NPH_SNS_LID(ha)) {
b98ae0d748dbc8 Quinn Tran          2017-06-02  1184  				set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
b98ae0d748dbc8 Quinn Tran          2017-06-02  1185  				set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
b98ae0d748dbc8 Quinn Tran          2017-06-02  1186  				break;
b98ae0d748dbc8 Quinn Tran          2017-06-02  1187  			}
b98ae0d748dbc8 Quinn Tran          2017-06-02  1188  
b98ae0d748dbc8 Quinn Tran          2017-06-02  1189  			/* use handle_cnt for loop id/nport handle */
b98ae0d748dbc8 Quinn Tran          2017-06-02  1190  			if (IS_FWI2_CAPABLE(ha))
b98ae0d748dbc8 Quinn Tran          2017-06-02  1191  				handle_cnt = NPH_SNS;
b98ae0d748dbc8 Quinn Tran          2017-06-02  1192  			else
b98ae0d748dbc8 Quinn Tran          2017-06-02  1193  				handle_cnt = SIMPLE_NAME_SERVER;
b98ae0d748dbc8 Quinn Tran          2017-06-02  1194  			if (mb[1] == handle_cnt) {
b98ae0d748dbc8 Quinn Tran          2017-06-02  1195  				set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
b98ae0d748dbc8 Quinn Tran          2017-06-02  1196  				set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
b98ae0d748dbc8 Quinn Tran          2017-06-02  1197  				break;
b98ae0d748dbc8 Quinn Tran          2017-06-02  1198  			}
b98ae0d748dbc8 Quinn Tran          2017-06-02  1199  
17cac3a175a02c Joe Carnuccio       2015-08-04  1200  			/* Port logout */
17cac3a175a02c Joe Carnuccio       2015-08-04  1201  			fcport = qla2x00_find_fcport_by_loopid(vha, mb[1]);
17cac3a175a02c Joe Carnuccio       2015-08-04  1202  			if (!fcport)
17cac3a175a02c Joe Carnuccio       2015-08-04  1203  				break;
17cac3a175a02c Joe Carnuccio       2015-08-04  1204  			if (atomic_read(&fcport->state) != FCS_ONLINE)
17cac3a175a02c Joe Carnuccio       2015-08-04  1205  				break;
17cac3a175a02c Joe Carnuccio       2015-08-04  1206  			ql_dbg(ql_dbg_async, vha, 0x508a,
17cac3a175a02c Joe Carnuccio       2015-08-04  1207  			    "Marking port lost loopid=%04x portid=%06x.\n",
17cac3a175a02c Joe Carnuccio       2015-08-04  1208  			    fcport->loop_id, fcport->d_id.b24);
726b85487067d7 Quinn Tran          2017-01-19  1209  			if (qla_ini_mode_enabled(vha)) {
726b85487067d7 Quinn Tran          2017-01-19  1210  				fcport->logout_on_delete = 0;
d8630bb95f46ea Quinn Tran          2017-12-28  1211  				qlt_schedule_sess_for_deletion(fcport);
726b85487067d7 Quinn Tran          2017-01-19  1212  			}
17cac3a175a02c Joe Carnuccio       2015-08-04  1213  			break;
17cac3a175a02c Joe Carnuccio       2015-08-04  1214  
17cac3a175a02c Joe Carnuccio       2015-08-04  1215  global_port_update:
9764ff8807a245 Andrew Vasquez      2009-07-31  1216  			if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
9764ff8807a245 Andrew Vasquez      2009-07-31  1217  				atomic_set(&vha->loop_state, LOOP_DOWN);
9764ff8807a245 Andrew Vasquez      2009-07-31  1218  				atomic_set(&vha->loop_down_timer,
9764ff8807a245 Andrew Vasquez      2009-07-31  1219  				    LOOP_DOWN_TIME);
9764ff8807a245 Andrew Vasquez      2009-07-31  1220  				vha->device_flags |= DFLG_NO_CABLE;
3c75ad1d87c7d2 Himanshu Madhani    2019-12-17  1221  				qla2x00_mark_all_devices_lost(vha);
9764ff8807a245 Andrew Vasquez      2009-07-31  1222  			}
9764ff8807a245 Andrew Vasquez      2009-07-31  1223  
9764ff8807a245 Andrew Vasquez      2009-07-31  1224  			if (vha->vp_idx) {
9764ff8807a245 Andrew Vasquez      2009-07-31  1225  				atomic_set(&vha->vp_state, VP_FAILED);
9764ff8807a245 Andrew Vasquez      2009-07-31  1226  				fc_vport_set_state(vha->fc_vport,
9764ff8807a245 Andrew Vasquez      2009-07-31  1227  				    FC_VPORT_FAILED);
3c75ad1d87c7d2 Himanshu Madhani    2019-12-17  1228  				qla2x00_mark_all_devices_lost(vha);
9764ff8807a245 Andrew Vasquez      2009-07-31  1229  			}
9764ff8807a245 Andrew Vasquez      2009-07-31  1230  
9764ff8807a245 Andrew Vasquez      2009-07-31  1231  			vha->flags.management_server_logged_in = 0;
9764ff8807a245 Andrew Vasquez      2009-07-31  1232  			ha->link_data_rate = PORT_SPEED_UNKNOWN;
9764ff8807a245 Andrew Vasquez      2009-07-31  1233  			break;
9764ff8807a245 Andrew Vasquez      2009-07-31  1234  		}
9764ff8807a245 Andrew Vasquez      2009-07-31  1235  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1236  		/*
cc3ef7bc40bbed Bjorn Helgaas       2008-09-11  1237  		 * If PORT UPDATE is global (received LIP_OCCURRED/LIP_RESET
^1da177e4c3f41 Linus Torvalds      2005-04-16  1238  		 * event etc. earlier indicating loop is down) then process
^1da177e4c3f41 Linus Torvalds      2005-04-16  1239  		 * it.  Otherwise ignore it and Wait for RSCN to come in.
^1da177e4c3f41 Linus Torvalds      2005-04-16  1240  		 */
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1241  		atomic_set(&vha->loop_down_timer, 0);
8e5a9484aee8d4 Chad Dupuis         2014-08-08  1242  		if (atomic_read(&vha->loop_state) != LOOP_DOWN &&
edd05de1975927 Duane Grigsby       2017-10-13  1243  			!ha->flags.n2n_ae  &&
8e5a9484aee8d4 Chad Dupuis         2014-08-08  1244  		    atomic_read(&vha->loop_state) != LOOP_DEAD) {
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1245  			ql_dbg(ql_dbg_async, vha, 0x5011,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1246  			    "Asynchronous PORT UPDATE ignored %04x/%04x/%04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1247  			    mb[1], mb[2], mb[3]);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1248  			break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1249  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16  1250  
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1251  		ql_dbg(ql_dbg_async, vha, 0x5012,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1252  		    "Port database changed %04x %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1253  		    mb[1], mb[2], mb[3]);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1254  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1255  		/*
^1da177e4c3f41 Linus Torvalds      2005-04-16  1256  		 * Mark all devices as missing so we will login again.
^1da177e4c3f41 Linus Torvalds      2005-04-16  1257  		 */
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1258  		atomic_set(&vha->loop_state, LOOP_UP);
6944dccbb7c9db Quinn Tran          2017-12-28  1259  		vha->scan.scan_retry = 0;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1260  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1261  		set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1262  		set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
ded6411fd88267 Sawan Chandak       2015-04-09  1263  		set_bit(VP_CONFIG_OK, &vha->vp_flags);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1264  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1265  
^1da177e4c3f41 Linus Torvalds      2005-04-16  1266  	case MBA_RSCN_UPDATE:		/* State Change Registration */
3c39740073b20d Seokmann Ju         2008-05-19  1267  		/* Check if the Vport has issued a SCR */
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1268  		if (vha->vp_idx && test_bit(VP_SCR_NEEDED, &vha->vp_flags))
3c39740073b20d Seokmann Ju         2008-05-19  1269  			break;
3c39740073b20d Seokmann Ju         2008-05-19  1270  		/* Only handle SCNs for our Vport index. */
0d6e61bc6a4f3f Andrew Vasquez      2009-08-25  1271  		if (ha->flags.npiv_supported && vha->vp_idx != (mb[3] & 0xff))
f4a8dbc7f6ca8c Shyam Sundar        2007-11-12  1272  			break;
0d6e61bc6a4f3f Andrew Vasquez      2009-08-25  1273  
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1274  		ql_dbg(ql_dbg_async, vha, 0x5013,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1275  		    "RSCN database changed -- %04x %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1276  		    mb[1], mb[2], mb[3]);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1277  
59d72d873ccfaf Ravi Anand          2008-09-11  1278  		rscn_entry = ((mb[1] & 0xff) << 16) | mb[2];
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1279  		host_pid = (vha->d_id.b.domain << 16) | (vha->d_id.b.area << 8)
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1280  				| vha->d_id.b.al_pa;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1281  		if (rscn_entry == host_pid) {
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1282  			ql_dbg(ql_dbg_async, vha, 0x5014,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1283  			    "Ignoring RSCN update to local host "
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1284  			    "port ID (%06x).\n", host_pid);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1285  			break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1286  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16  1287  
59d72d873ccfaf Ravi Anand          2008-09-11  1288  		/* Ignore reserved bits from RSCN-payload. */
59d72d873ccfaf Ravi Anand          2008-09-11  1289  		rscn_entry = ((mb[1] & 0x3ff) << 16) | mb[2];
^1da177e4c3f41 Linus Torvalds      2005-04-16  1290  
bb4cf5b73b47fe Chad Dupuis         2013-02-08  1291  		/* Skip RSCNs for virtual ports on the same physical port */
bb4cf5b73b47fe Chad Dupuis         2013-02-08  1292  		if (qla2x00_is_a_vp_did(vha, rscn_entry))
bb4cf5b73b47fe Chad Dupuis         2013-02-08  1293  			break;
bb4cf5b73b47fe Chad Dupuis         2013-02-08  1294  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1295  		atomic_set(&vha->loop_down_timer, 0);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1296  		vha->flags.management_server_logged_in = 0;
726b85487067d7 Quinn Tran          2017-01-19  1297  		{
726b85487067d7 Quinn Tran          2017-01-19  1298  			struct event_arg ea;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1299  
726b85487067d7 Quinn Tran          2017-01-19  1300  			memset(&ea, 0, sizeof(ea));
726b85487067d7 Quinn Tran          2017-01-19  1301  			ea.id.b24 = rscn_entry;
41dc529a4602ac Quinn Tran          2017-01-19  1302  			ea.id.b.rsvd_1 = rscn_entry >> 24;
897def20042136 Bart Van Assche     2019-08-08  1303  			qla2x00_handle_rscn(vha, &ea);
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1304  			qla2x00_post_aen_work(vha, FCH_EVT_RSCN, rscn_entry);
726b85487067d7 Quinn Tran          2017-01-19  1305  		}
^1da177e4c3f41 Linus Torvalds      2005-04-16  1306  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  1307  	/* case MBA_RIO_RESPONSE: */
^1da177e4c3f41 Linus Torvalds      2005-04-16  1308  	case MBA_ZIO_RESPONSE:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1309  		ql_dbg(ql_dbg_async, vha, 0x5015,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1310  		    "[R|Z]IO update completion.\n");
^1da177e4c3f41 Linus Torvalds      2005-04-16  1311  
e428924ccdf464 Andrew Vasquez      2007-07-19  1312  		if (IS_FWI2_CAPABLE(ha))
2afa19a9377ca6 Anirban Chakraborty 2009-04-06  1313  			qla24xx_process_response_queue(vha, rsp);
4fdfefe52944f5 Andrew Vasquez      2005-10-27  1314  		else
73208dfd7ab19f Anirban Chakraborty 2008-12-09  1315  			qla2x00_process_response_queue(rsp);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1316  		break;
9a853f71804d80 Andrew Vasquez      2005-07-06  1317  
9a853f71804d80 Andrew Vasquez      2005-07-06  1318  	case MBA_DISCARD_RND_FRAME:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1319  		ql_dbg(ql_dbg_async, vha, 0x5016,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1320  		    "Discard RND Frame -- %04x %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1321  		    mb[1], mb[2], mb[3]);
9a853f71804d80 Andrew Vasquez      2005-07-06  1322  		break;
45ebeb560570fd Andrew Vasquez      2006-08-01  1323  
45ebeb560570fd Andrew Vasquez      2006-08-01  1324  	case MBA_TRACE_NOTIFICATION:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1325  		ql_dbg(ql_dbg_async, vha, 0x5017,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1326  		    "Trace Notification -- %04x %04x.\n", mb[1], mb[2]);
45ebeb560570fd Andrew Vasquez      2006-08-01  1327  		break;
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1328  
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1329  	case MBA_ISP84XX_ALERT:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1330  		ql_dbg(ql_dbg_async, vha, 0x5018,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1331  		    "ISP84XX Alert Notification -- %04x %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1332  		    mb[1], mb[2], mb[3]);
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1333  
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1334  		spin_lock_irqsave(&ha->cs84xx->access_lock, flags);
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1335  		switch (mb[1]) {
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1336  		case A84_PANIC_RECOVERY:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1337  			ql_log(ql_log_info, vha, 0x5019,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1338  			    "Alert 84XX: panic recovery %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1339  			    mb[2], mb[3]);
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1340  			break;
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1341  		case A84_OP_LOGIN_COMPLETE:
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1342  			ha->cs84xx->op_fw_version = mb[3] << 16 | mb[2];
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1343  			ql_log(ql_log_info, vha, 0x501a,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1344  			    "Alert 84XX: firmware version %x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1345  			    ha->cs84xx->op_fw_version);
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1346  			break;
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1347  		case A84_DIAG_LOGIN_COMPLETE:
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1348  			ha->cs84xx->diag_fw_version = mb[3] << 16 | mb[2];
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1349  			ql_log(ql_log_info, vha, 0x501b,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1350  			    "Alert 84XX: diagnostic firmware version %x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1351  			    ha->cs84xx->diag_fw_version);
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1352  			break;
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1353  		case A84_GOLD_LOGIN_COMPLETE:
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1354  			ha->cs84xx->diag_fw_version = mb[3] << 16 | mb[2];
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1355  			ha->cs84xx->fw_update = 1;
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1356  			ql_log(ql_log_info, vha, 0x501c,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1357  			    "Alert 84XX: gold firmware version %x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1358  			    ha->cs84xx->gold_fw_version);
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1359  			break;
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1360  		default:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1361  			ql_log(ql_log_warn, vha, 0x501d,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1362  			    "Alert 84xx: Invalid Alert %04x %04x %04x.\n",
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1363  			    mb[1], mb[2], mb[3]);
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1364  		}
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1365  		spin_unlock_irqrestore(&ha->cs84xx->access_lock, flags);
4d4df1932b6b11 Harihara Kadayam    2008-04-03  1366  		break;
3a03eb797ce76a Andrew Vasquez      2009-01-05  1367  	case MBA_DCBX_START:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1368  		ql_dbg(ql_dbg_async, vha, 0x501e,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1369  		    "DCBX Started -- %04x %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1370  		    mb[1], mb[2], mb[3]);
3a03eb797ce76a Andrew Vasquez      2009-01-05  1371  		break;
3a03eb797ce76a Andrew Vasquez      2009-01-05  1372  	case MBA_DCBX_PARAM_UPDATE:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1373  		ql_dbg(ql_dbg_async, vha, 0x501f,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1374  		    "DCBX Parameters Updated -- %04x %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1375  		    mb[1], mb[2], mb[3]);
3a03eb797ce76a Andrew Vasquez      2009-01-05  1376  		break;
3a03eb797ce76a Andrew Vasquez      2009-01-05  1377  	case MBA_FCF_CONF_ERR:
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1378  		ql_dbg(ql_dbg_async, vha, 0x5020,
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1379  		    "FCF Configuration Error -- %04x %04x %04x.\n",
7c3df1320e5e87 Saurav Kashyap      2011-07-14  1380  		    mb[1], mb[2], mb[3]);
3a03eb797ce76a Andrew Vasquez      2009-01-05  1381  		break;
3a03eb797ce76a Andrew Vasquez      2009-01-05  1382  	case MBA_IDC_NOTIFY:
7ec0effd30bb4b Atul Deshmukh       2013-08-27  1383  		if (IS_QLA8031(vha->hw) || IS_QLA8044(ha)) {
67b2a31f517a43 Chad Dupuis         2013-02-08  1384  			mb[4] = RD_REG_WORD(&reg24->mailbox4);
67b2a31f517a43 Chad Dupuis         2013-02-08  1385  			if (((mb[2] & 0x7fff) == MBC_PORT_RESET ||
67b2a31f517a43 Chad Dupuis         2013-02-08  1386  			    (mb[2] & 0x7fff) == MBC_SET_PORT_CONFIG) &&
67b2a31f517a43 Chad Dupuis         2013-02-08  1387  			    (mb[4] & INTERNAL_LOOPBACK_MASK) != 0) {
8fcd6b8b0fbc61 Chad Dupuis         2012-08-22  1388  				set_bit(ISP_QUIESCE_NEEDED, &vha->dpc_flags);
67b2a31f517a43 Chad Dupuis         2013-02-08  1389  				/*
67b2a31f517a43 Chad Dupuis         2013-02-08  1390  				 * Extend loop down timer since port is active.
67b2a31f517a43 Chad Dupuis         2013-02-08  1391  				 */
67b2a31f517a43 Chad Dupuis         2013-02-08  1392  				if (atomic_read(&vha->loop_state) == LOOP_DOWN)
67b2a31f517a43 Chad Dupuis         2013-02-08  1393  					atomic_set(&vha->loop_down_timer,
67b2a31f517a43 Chad Dupuis         2013-02-08  1394  					    LOOP_DOWN_TIME);
8fcd6b8b0fbc61 Chad Dupuis         2012-08-22  1395  				qla2xxx_wake_dpc(vha);
8fcd6b8b0fbc61 Chad Dupuis         2012-08-22  1396  			}
67b2a31f517a43 Chad Dupuis         2013-02-08  1397  		}
81881861ae10ef Bart Van Assche     2017-12-07  1398  		/* fall through */
8fcd6b8b0fbc61 Chad Dupuis         2012-08-22  1399  	case MBA_IDC_COMPLETE:
9aaf2cea4e63ed Chad Dupuis         2013-10-30  1400  		if (ha->notify_lb_portup_comp && !vha->vp_idx)
f356bef134dda5 Chad Dupuis         2013-02-08  1401  			complete(&ha->lb_portup_comp);
f356bef134dda5 Chad Dupuis         2013-02-08  1402  		/* Fallthru */
3a03eb797ce76a Andrew Vasquez      2009-01-05  1403  	case MBA_IDC_TIME_EXT:
7ec0effd30bb4b Atul Deshmukh       2013-08-27  1404  		if (IS_QLA81XX(vha->hw) || IS_QLA8031(vha->hw) ||
7ec0effd30bb4b Atul Deshmukh       2013-08-27  1405  		    IS_QLA8044(ha))
8a659571eccfde Andrew Vasquez      2009-02-08  1406  			qla81xx_idc_event(vha, mb[0], mb[1]);
3a03eb797ce76a Andrew Vasquez      2009-01-05  1407  		break;
7d613ac6acec8c Santosh Vernekar    2012-08-22  1408  
7d613ac6acec8c Santosh Vernekar    2012-08-22  1409  	case MBA_IDC_AEN:
d52cd7747d905f Quinn Tran          2019-09-12  1410  		if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
ff3a920efcdbfa Arun Easi           2020-03-27  1411  			qla27xx_handle_8200_aen(vha, mb);
d52cd7747d905f Quinn Tran          2019-09-12  1412  		} else if (IS_QLA83XX(ha)) {
7d613ac6acec8c Santosh Vernekar    2012-08-22  1413  			mb[4] = RD_REG_WORD(&reg24->mailbox4);
7d613ac6acec8c Santosh Vernekar    2012-08-22  1414  			mb[5] = RD_REG_WORD(&reg24->mailbox5);
7d613ac6acec8c Santosh Vernekar    2012-08-22  1415  			mb[6] = RD_REG_WORD(&reg24->mailbox6);
7d613ac6acec8c Santosh Vernekar    2012-08-22  1416  			mb[7] = RD_REG_WORD(&reg24->mailbox7);
7d613ac6acec8c Santosh Vernekar    2012-08-22  1417  			qla83xx_handle_8200_aen(vha, mb);
d52cd7747d905f Quinn Tran          2019-09-12  1418  		} else {
d52cd7747d905f Quinn Tran          2019-09-12  1419  			ql_dbg(ql_dbg_async, vha, 0x5052,
d52cd7747d905f Quinn Tran          2019-09-12  1420  			    "skip Heartbeat processing mb0-3=[0x%04x] [0x%04x] [0x%04x] [0x%04x]\n",
d52cd7747d905f Quinn Tran          2019-09-12  1421  			    mb[0], mb[1], mb[2], mb[3]);
d52cd7747d905f Quinn Tran          2019-09-12  1422  		}
7d613ac6acec8c Santosh Vernekar    2012-08-22  1423  		break;
7d613ac6acec8c Santosh Vernekar    2012-08-22  1424  
b5a340dd858b5b Joe Carnuccio       2014-09-25  1425  	case MBA_DPORT_DIAGNOSTICS:
b5a340dd858b5b Joe Carnuccio       2014-09-25  1426  		ql_dbg(ql_dbg_async, vha, 0x5052,
425215647fc53b Joe Carnuccio       2019-12-17  1427  		    "D-Port Diagnostics: %04x %04x %04x %04x\n",
425215647fc53b Joe Carnuccio       2019-12-17  1428  		    mb[0], mb[1], mb[2], mb[3]);
e6ad2b79b82f41 Joe Carnuccio       2020-02-12  1429  		memcpy(vha->dport_data, mb, sizeof(vha->dport_data));
425215647fc53b Joe Carnuccio       2019-12-17  1430  		if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
425215647fc53b Joe Carnuccio       2019-12-17  1431  			static char *results[] = {
425215647fc53b Joe Carnuccio       2019-12-17  1432  			    "start", "done(pass)", "done(error)", "undefined" };
425215647fc53b Joe Carnuccio       2019-12-17  1433  			static char *types[] = {
425215647fc53b Joe Carnuccio       2019-12-17  1434  			    "none", "dynamic", "static", "other" };
425215647fc53b Joe Carnuccio       2019-12-17  1435  			uint result = mb[1] >> 0 & 0x3;
425215647fc53b Joe Carnuccio       2019-12-17  1436  			uint type = mb[1] >> 6 & 0x3;
425215647fc53b Joe Carnuccio       2019-12-17  1437  			uint sw = mb[1] >> 15 & 0x1;
425215647fc53b Joe Carnuccio       2019-12-17  1438  			ql_dbg(ql_dbg_async, vha, 0x5052,
425215647fc53b Joe Carnuccio       2019-12-17  1439  			    "D-Port Diagnostics: result=%s type=%s [sw=%u]\n",
425215647fc53b Joe Carnuccio       2019-12-17  1440  			    results[result], types[type], sw);
425215647fc53b Joe Carnuccio       2019-12-17  1441  			if (result == 2) {
425215647fc53b Joe Carnuccio       2019-12-17  1442  				static char *reasons[] = {
425215647fc53b Joe Carnuccio       2019-12-17  1443  				    "reserved", "unexpected reject",
425215647fc53b Joe Carnuccio       2019-12-17  1444  				    "unexpected phase", "retry exceeded",
425215647fc53b Joe Carnuccio       2019-12-17  1445  				    "timed out", "not supported",
425215647fc53b Joe Carnuccio       2019-12-17  1446  				    "user stopped" };
425215647fc53b Joe Carnuccio       2019-12-17  1447  				uint reason = mb[2] >> 0 & 0xf;
425215647fc53b Joe Carnuccio       2019-12-17  1448  				uint phase = mb[2] >> 12 & 0xf;
425215647fc53b Joe Carnuccio       2019-12-17  1449  				ql_dbg(ql_dbg_async, vha, 0x5052,
425215647fc53b Joe Carnuccio       2019-12-17  1450  				    "D-Port Diagnostics: reason=%s phase=%u \n",
425215647fc53b Joe Carnuccio       2019-12-17  1451  				    reason < 7 ? reasons[reason] : "other",
425215647fc53b Joe Carnuccio       2019-12-17  1452  				    phase >> 1);
425215647fc53b Joe Carnuccio       2019-12-17  1453  			}
425215647fc53b Joe Carnuccio       2019-12-17  1454  		}
b5a340dd858b5b Joe Carnuccio       2014-09-25  1455  		break;
b5a340dd858b5b Joe Carnuccio       2014-09-25  1456  
a29b3dd7aa14fa Joe Carnuccio       2016-07-06  1457  	case MBA_TEMPERATURE_ALERT:
a29b3dd7aa14fa Joe Carnuccio       2016-07-06  1458  		ql_dbg(ql_dbg_async, vha, 0x505e,
a29b3dd7aa14fa Joe Carnuccio       2016-07-06  1459  		    "TEMPERATURE ALERT: %04x %04x %04x\n", mb[1], mb[2], mb[3]);
a29b3dd7aa14fa Joe Carnuccio       2016-07-06  1460  		if (mb[1] == 0x12)
a29b3dd7aa14fa Joe Carnuccio       2016-07-06  1461  			schedule_work(&ha->board_disable);
a29b3dd7aa14fa Joe Carnuccio       2016-07-06  1462  		break;
a29b3dd7aa14fa Joe Carnuccio       2016-07-06  1463  
92d4408e34667f Sawan Chandak       2017-08-23  1464  	case MBA_TRANS_INSERT:
92d4408e34667f Sawan Chandak       2017-08-23  1465  		ql_dbg(ql_dbg_async, vha, 0x5091,
92d4408e34667f Sawan Chandak       2017-08-23  1466  		    "Transceiver Insertion: %04x\n", mb[1]);
b0f18eee6fc1ee Andrew Vasquez      2020-02-26  1467  		set_bit(DETECT_SFP_CHANGE, &vha->dpc_flags);
b0f18eee6fc1ee Andrew Vasquez      2020-02-26  1468  		break;
b0f18eee6fc1ee Andrew Vasquez      2020-02-26  1469  
b0f18eee6fc1ee Andrew Vasquez      2020-02-26  1470  	case MBA_TRANS_REMOVE:
b0f18eee6fc1ee Andrew Vasquez      2020-02-26  1471  		ql_dbg(ql_dbg_async, vha, 0x5091, "Transceiver Removal\n");
92d4408e34667f Sawan Chandak       2017-08-23  1472  		break;
92d4408e34667f Sawan Chandak       2017-08-23  1473  
6246b8a1d26c7c Giridhar Malavali   2012-02-09  1474  	default:
6246b8a1d26c7c Giridhar Malavali   2012-02-09  1475  		ql_dbg(ql_dbg_async, vha, 0x5057,
6246b8a1d26c7c Giridhar Malavali   2012-02-09  1476  		    "Unknown AEN:%04x %04x %04x %04x\n",
6246b8a1d26c7c Giridhar Malavali   2012-02-09  1477  		    mb[0], mb[1], mb[2], mb[3]);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1478  	}
2c3dfe3f6ad8da Seokmann Ju         2007-07-05  1479  
2d70c103fd2a06 Nicholas Bellinger  2012-05-15  1480  	qlt_async_event(mb[0], vha, mb);
2d70c103fd2a06 Nicholas Bellinger  2012-05-15  1481  
e315cd28b9ef0d Anirban Chakraborty 2008-11-06  1482  	if (!vha->vp_idx && ha->num_vhosts)
73208dfd7ab19f Anirban Chakraborty 2008-12-09  1483  		qla2x00_alert_all_vps(rsp, mb);
^1da177e4c3f41 Linus Torvalds      2005-04-16  1484  }
^1da177e4c3f41 Linus Torvalds      2005-04-16  1485  

:::::: The code at line 903 was first introduced by commit
:::::: a82c307e69c465e4d80cc15fde3c00f5b95832d6 scsi: qla2xxx: add more FW debug information

:::::: TO: Quinn Tran <qutran@xxxxxxxxxxx>
:::::: CC: Martin K. Petersen <martin.petersen@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux