All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, himanshu.madhani@cavium.com,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 19/43] qla2xxx: Fix session cleanup for N2N
Date: Thu, 21 Dec 2017 14:01:43 +0800	[thread overview]
Message-ID: <201712211345.VH1w6C1l%fengguang.wu@intel.com> (raw)
In-Reply-To: <20171220065644.21511-20-himanshu.madhani@cavium.com>

Hi Quinn,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on next-20171220]
[cannot apply to v4.15-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Himanshu-Madhani/qla2xxx-Driver-update/20171221-085840
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +4828 drivers/scsi/qla2xxx/qla_os.c

  4743	
  4744	static
  4745	void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e)
  4746	{
  4747		unsigned long flags;
  4748		fc_port_t *fcport =  NULL, *tfcp;
  4749		struct qlt_plogi_ack_t *pla =
  4750		    (struct qlt_plogi_ack_t *)e->u.new_sess.pla;
  4751		uint8_t free_fcport = 0;
  4752	
  4753		ql_dbg(ql_dbg_disc, vha, 0xffff,
  4754		    "%s %d %8phC enter\n",
  4755		    __func__, __LINE__, e->u.new_sess.port_name);
  4756	
  4757		spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
  4758		fcport = qla2x00_find_fcport_by_wwpn(vha, e->u.new_sess.port_name, 1);
  4759		if (fcport) {
  4760			fcport->d_id = e->u.new_sess.id;
  4761			if (pla) {
  4762				fcport->fw_login_state = DSC_LS_PLOGI_PEND;
  4763				memcpy(fcport->node_name,
  4764				    pla->iocb.u.isp24.u.plogi.node_name,
  4765				    WWN_SIZE);
  4766				qlt_plogi_ack_link(vha, pla, fcport, QLT_PLOGI_LINK_SAME_WWN);
  4767				/* we took an extra ref_count to prevent PLOGI ACK when
  4768				 * fcport/sess has not been created.
  4769				 */
  4770				pla->ref_count--;
  4771			}
  4772		} else {
  4773			spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
  4774			fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL);
  4775			if (fcport) {
  4776				fcport->d_id = e->u.new_sess.id;
  4777				fcport->scan_state = QLA_FCPORT_FOUND;
  4778				fcport->flags |= FCF_FABRIC_DEVICE;
  4779				fcport->fw_login_state = DSC_LS_PLOGI_PEND;
  4780	
  4781				memcpy(fcport->port_name, e->u.new_sess.port_name,
  4782				    WWN_SIZE);
  4783			} else {
  4784				ql_dbg(ql_dbg_disc, vha, 0xffff,
  4785					   "%s %8phC mem alloc fail.\n",
  4786					   __func__, e->u.new_sess.port_name);
  4787	
  4788				if (pla)
  4789					kmem_cache_free(qla_tgt_plogi_cachep, pla);
  4790				return;
  4791			}
  4792	
  4793			spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
  4794			/* search again to make sure one else got ahead */
  4795			tfcp = qla2x00_find_fcport_by_wwpn(vha,
  4796			    e->u.new_sess.port_name, 1);
  4797			if (tfcp) {
  4798				/* should rarily happen */
  4799				ql_dbg(ql_dbg_disc, vha, 0xffff,
  4800				    "%s %8phC found existing fcport b4 add. DS %d LS %d\n",
  4801				    __func__, tfcp->port_name, tfcp->disc_state,
  4802				    tfcp->fw_login_state);
  4803	
  4804				free_fcport = 1;
  4805			} else {
  4806				list_add_tail(&fcport->list, &vha->vp_fcports);
  4807	
  4808			}
  4809			if (pla) {
  4810				qlt_plogi_ack_link(vha, pla, fcport,
  4811				    QLT_PLOGI_LINK_SAME_WWN);
  4812				pla->ref_count--;
  4813			}
  4814		}
  4815		spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
  4816	
  4817		if (fcport) {
  4818			if (N2N_TOPO(vha->hw))
  4819				fcport->flags &= ~FCF_FABRIC_DEVICE;
  4820	
  4821			if (pla) {
  4822				if (pla->iocb.u.isp24.status_subcode == ELS_PRLI) {
  4823					u16 wd3_lo;
  4824	
  4825					fcport->fw_login_state = DSC_LS_PRLI_PEND;
  4826					fcport->local = 0;
  4827					fcport->loop_id =
> 4828						le16_to_cpu(
  4829						    pla->iocb.u.isp24.nport_handle);
  4830					fcport->fw_login_state = DSC_LS_PRLI_PEND;
  4831					wd3_lo =
  4832					    le16_to_cpu(
  4833						pla->iocb.u.isp24.u.prli.wd3_lo);
  4834	
  4835					if (wd3_lo & BIT_7)
  4836						fcport->conf_compl_supported = 1;
  4837	
  4838					if ((wd3_lo & BIT_4) == 0)
  4839						fcport->port_type = FCT_INITIATOR;
  4840					else
  4841						fcport->port_type = FCT_TARGET;
  4842				}
  4843				qlt_plogi_ack_unref(vha, pla);
  4844			} else {
  4845				spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
  4846				tfcp = qla2x00_find_fcport_by_nportid(vha,
  4847				    &e->u.new_sess.id, 1);
  4848				if (tfcp && (tfcp != fcport)) {
  4849					/*
  4850					 * We have a conflict fcport with same NportID.
  4851					 */
  4852					ql_dbg(ql_dbg_disc, vha, 0xffff,
  4853					    "%s %8phC found conflict b4 add. DS %d LS %d\n",
  4854					    __func__, tfcp->port_name, tfcp->disc_state,
  4855					    tfcp->fw_login_state);
  4856	
  4857					switch (tfcp->disc_state) {
  4858					case DSC_DELETED:
  4859						break;
  4860					case DSC_DELETE_PEND:
  4861						fcport->login_pause = 1;
  4862						tfcp->conflict = fcport;
  4863						break;
  4864					default:
  4865						fcport->login_pause = 1;
  4866						tfcp->conflict = fcport;
  4867						qlt_schedule_sess_for_deletion_lock
  4868							(tfcp);
  4869						break;
  4870					}
  4871				}
  4872				spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
  4873				qla24xx_async_gnl(vha, fcport);
  4874			}
  4875		}
  4876	
  4877		if (free_fcport) {
  4878			qla2x00_free_fcport(fcport);
  4879			if (pla)
  4880				kmem_cache_free(qla_tgt_plogi_cachep, pla);
  4881		}
  4882	}
  4883	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

  reply	other threads:[~2017-12-21  6:01 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20  6:56 [PATCH 00/43] qla2xxx: Driver update Himanshu Madhani
2017-12-20  6:56 ` [PATCH 01/43] qla2xxx: Fix stale memory access for name pointer Himanshu Madhani
2017-12-20 16:25   ` Bart Van Assche
2017-12-20 20:37     ` Madhani, Himanshu
2017-12-21  5:26   ` kbuild test robot
2017-12-21  5:26   ` [RFC PATCH] qla2xxx: sp_str[] can be static kbuild test robot
2017-12-20  6:56 ` [PATCH 02/43] qla2xxx: Fix NULL pointer access for fcport structure Himanshu Madhani
2017-12-20 16:26   ` Bart Van Assche
2017-12-20 20:38     ` Madhani, Himanshu
2017-12-20  6:56 ` [PATCH 03/43] qla2xxx: Use IOCB path to submit Control VP MBX command Himanshu Madhani
2017-12-20 16:29   ` Bart Van Assche
2017-12-20 20:39     ` Madhani, Himanshu
2017-12-20  6:56 ` [PATCH 04/43] qla2xxx: Use chip reset to bring down laser on unload Himanshu Madhani
2017-12-20  6:56 ` [PATCH 05/43] qla2xxx: Add boundary checks for exchanges to be offloaded Himanshu Madhani
2017-12-20  6:56 ` [PATCH 06/43] qla2xxx: Fix stale mem access for IRQ name Himanshu Madhani
2017-12-20 16:39   ` Bart Van Assche
2017-12-20 20:41     ` Madhani, Himanshu
2017-12-20  6:56 ` [PATCH 07/43] qla2xxx: Add ability to track IOCB resource for FW Himanshu Madhani
2017-12-20 16:51   ` Bart Van Assche
2017-12-20 20:57     ` Madhani, Himanshu
2017-12-20  6:56 ` [PATCH 08/43] qla2xxx: Chip reset uses wrong lock during IO flush Himanshu Madhani
2017-12-20  6:56 ` [PATCH 09/43] qla2xxx: Fix Firmware dump size for Extended login and Exchange Offload Himanshu Madhani
2017-12-20  6:56 ` [PATCH 10/43] qla2xxx: Replace GPDB with async ADISC command Himanshu Madhani
2017-12-20  6:56 ` [PATCH 11/43] qla2xxx: Move work element processing out of DPC thread Himanshu Madhani
2017-12-20  6:56 ` [PATCH 12/43] qla2xxx: Enable ATIO interrupt handshake for ISP27XX Himanshu Madhani
2017-12-20  6:56 ` [PATCH 13/43] qla2xxx: Use shadow register " Himanshu Madhani
2017-12-20  6:56 ` [PATCH 14/43] qla2xxx: Add option for use reserve exch for ELS Himanshu Madhani
2017-12-20 16:53   ` Bart Van Assche
2017-12-20 21:40     ` Madhani, Himanshu
2017-12-20  6:56 ` [PATCH 15/43] qla2xxx: Add ability to send PRLO Himanshu Madhani
2017-12-20  6:56 ` [PATCH 16/43] qla2xxx: Don't call dma_free_coherent with IRQ disabled Himanshu Madhani
2017-12-20  6:56 ` [PATCH 17/43] qla2xxx: Allow target mode to accept PRLI in dual mode Himanshu Madhani
2017-12-20  6:56 ` [PATCH 18/43] qla2xxx: Tweak resource count dump Himanshu Madhani
2017-12-20  6:56 ` [PATCH 19/43] qla2xxx: Fix session cleanup for N2N Himanshu Madhani
2017-12-21  6:01   ` kbuild test robot [this message]
2017-12-20  6:56 ` [PATCH 20/43] qla2xxx: Use known NPort ID for Management Server login Himanshu Madhani
2017-12-20  6:56 ` [PATCH 21/43] qla2xxx: Remove calling cancel_work_sync() Himanshu Madhani
2017-12-20 16:56   ` Bart Van Assche
2017-12-20 21:41     ` Madhani, Himanshu
2017-12-20  6:56 ` [PATCH 22/43] qla2xxx: Add switch command to simplify fabric discovery Himanshu Madhani
2017-12-20 18:09   ` Ewan D. Milne
2017-12-21  0:04     ` Madhani, Himanshu
2017-12-20  6:56 ` [PATCH 23/43] qla2xxx: Add lock protection around host lookup Himanshu Madhani
2017-12-20  6:56 ` [PATCH 24/43] qla2xxx: Reduce the use of terminate exchange Himanshu Madhani
2017-12-20  6:56 ` [PATCH 25/43] qla2xxx: Reduce trace noise for Async Events Himanshu Madhani
2017-12-20  6:56 ` [PATCH 26/43] qla2xxx: Fix login state machine freeze Himanshu Madhani
2017-12-20  6:56 ` [PATCH 27/43] qla2xxx: Migrate switch registration commands away from mailbox interface Himanshu Madhani
2017-12-20  6:56 ` [PATCH 28/43] qla2xxx: Remove session creation redundant code Himanshu Madhani
2017-12-20  6:56 ` [PATCH 29/43] qla2xxx: Fix GPNFT/GNNFT error handling Himanshu Madhani
2017-12-20  6:56 ` [PATCH 30/43] qla2xxx: Properly extract ADISC error codes Himanshu Madhani
2017-12-20  6:56 ` [PATCH 31/43] qla2xxx: Add ability to use GPNFT/GNNFT for RSCN handling Himanshu Madhani
2017-12-20  6:56 ` [PATCH 32/43] qla2xxx: Allow relogin and session creation after reset Himanshu Madhani
2017-12-20  6:56 ` [PATCH 33/43] qla2xxx: Increase verbosity of debug messages logged Himanshu Madhani
2017-12-20  6:56 ` [PATCH 34/43] qla2xxx: Delay loop id allocation at login Himanshu Madhani
2017-12-20  6:56 ` [PATCH 35/43] qla2xxx: Add retry limit for fabric scan logic Himanshu Madhani
2017-12-20  6:56 ` [PATCH 36/43] qla2xxx: Add counters for Exchange Buffer to debugfs Himanshu Madhani
2017-12-20  6:56 ` [PATCH 37/43] qla2xxx: Prevent multiple active discovery commands per session Himanshu Madhani
2017-12-20  6:56 ` [PATCH 38/43] qla2xxx: Prevent relogin trigger from sending too many commands Himanshu Madhani
2017-12-20  6:56 ` [PATCH 39/43] qla2xxx: Check FCF_ASYNC_SENT flag Himanshu Madhani
2017-12-20  6:56 ` [PATCH 40/43] qla2xxx: Remove unused argument from qlt_schedule_sess_for_deletion() Himanshu Madhani
2017-12-20  6:56 ` [PATCH 41/43] qla2xxx: Serialize session deletion by using work_lock Himanshu Madhani
2017-12-20  6:56 ` [PATCH 42/43] qla2xxx: Serialize session free in qlt_free_session_done Himanshu Madhani
2017-12-20  6:56 ` [PATCH 43/43] qla2xxx: Update driver version to 10.00.00.04-k Himanshu Madhani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201712211345.VH1w6C1l%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=himanshu.madhani@cavium.com \
    --cc=kbuild-all@01.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.